diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-02-07 23:40:25 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-02-07 23:40:25 +0000 |
commit | 82fde20699ba9e9e805b4db89861563e0e27839b (patch) | |
tree | bc589ef1bd284fa6cad8aa33948e4b2180d30b80 | |
parent | f366e8df96c1c83b43cb98637bd0695fad6ab7ce (diff) | |
download | portage-82fde20699ba9e9e805b4db89861563e0e27839b.tar.gz portage-82fde20699ba9e9e805b4db89861563e0e27839b.tar.bz2 portage-82fde20699ba9e9e805b4db89861563e0e27839b.zip |
Synchronize required hash code in all relevant places.
svn path=/main/trunk/; revision=5924
-rw-r--r-- | pym/portage/__init__.py | 10 | ||||
-rw-r--r-- | pym/portage/manifest.py | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 1bcc0faff..45914dbe2 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -2712,10 +2712,9 @@ def digestgen(myarchives, mysettings, overwrite=1, manifestonly=0, myportdb=None # fetches when sufficient digests already exist. To ease transition # while Manifest 1 is being removed, only require hashes that will # exist before and after the transition. - required_hash_types = set(portage.const.MANIFEST1_HASH_FUNCTIONS - ).intersection(portage.const.MANIFEST2_HASH_FUNCTIONS) - required_hash_types.add(portage.const.MANIFEST2_REQUIRED_HASH) + required_hash_types = set() required_hash_types.add("size") + required_hash_types.add(portage.const.MANIFEST2_REQUIRED_HASH) dist_hashes = mf.fhashdict.get("DIST", {}) missing_hashes = set() for myfile in distfiles_map: @@ -3581,8 +3580,11 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, # Skip files that we already have digests for. mf = Manifest(mysettings["O"], mysettings["DISTDIR"]) mydigests = mf.getTypeDigests("DIST") + required_hash_types = set() + required_hash_types.add("size") + required_hash_types.add(portage.const.MANIFEST2_REQUIRED_HASH) for filename, hashes in mydigests.iteritems(): - if len(hashes) == len(mf.hashes): + if not required_hash_types.difference(hashes): checkme = [i for i in checkme if i != filename] fetchme = [i for i in fetchme \ if os.path.basename(i) != filename] diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py index 08ac13932..732d403f8 100644 --- a/pym/portage/manifest.py +++ b/pym/portage/manifest.py @@ -473,6 +473,9 @@ class Manifest(object): # repoman passes in an empty list, which implies that all distfiles # are required. requiredDistfiles = distlist.copy() + required_hash_types = set() + required_hash_types.add("size") + required_hash_types.add(portage.const.MANIFEST2_REQUIRED_HASH) for f in distlist: fname = os.path.join(self.distdir, f) mystat = None @@ -486,7 +489,7 @@ class Manifest(object): (assumeDistHashesAlways and mystat is not None and \ len(distfilehashes[f]) == len(self.hashes) and \ distfilehashes[f]["size"] == mystat.st_size)) and \ - portage.const.MANIFEST2_REQUIRED_HASH in distfilehashes[f].keys(): + not required_hash_types.difference(distfilehashes[f]): self.fhashdict["DIST"][f] = distfilehashes[f] else: try: |