Make digestgen() force fetch unless all required digest types are available. Thanks...
authorZac Medico <zmedico@gentoo.org>
Tue, 9 Jan 2007 04:25:33 +0000 (04:25 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 9 Jan 2007 04:25:33 +0000 (04:25 -0000)
svn path=/main/trunk/; revision=5496

pym/portage.py

index 68df71e47719f3c7bb657131a6be7352d0c8c3ac..b16d3c7113a691f63a4b4ca3115ae400ffe1f895 100644 (file)
@@ -2612,8 +2612,18 @@ def digestgen(myarchives, mysettings, overwrite=1, manifestonly=0, myportdb=None
                                distfiles_map.setdefault(myfile, []).append(cpv)
                mf = Manifest(mysettings["O"], mysettings["DISTDIR"],
                        fetchlist_dict=fetchlist_dict)
-               missing_hashes = set(distfiles_map).difference(
-                       mf.fhashdict.get("DIST", {}))
+               required_hash_types = set(portage_const.MANIFEST1_HASH_FUNCTIONS)
+               required_hash_types.update(portage_const.MANIFEST2_HASH_FUNCTIONS)
+               required_hash_types.add("size")
+               dist_hashes = mf.fhashdict.get("DIST", {})
+               missing_hashes = set()
+               for myfile in distfiles_map:
+                       myhashes = dist_hashes.get(myfile)
+                       if not myhashes:
+                               missing_hashes.add(myfile)
+                               continue
+                       if required_hash_types.difference(myhashes):
+                               missing_hashes.add(myfile)
                if missing_hashes:
                        missing_files = []
                        for myfile in missing_hashes: