From: Zac Medico Date: Tue, 9 Jan 2007 04:25:33 +0000 (-0000) Subject: Make digestgen() force fetch unless all required digest types are available. Thanks... X-Git-Tag: v2.1.2~131 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a42c0b4a19f17d96bd20ca4f30e626287dae5a30;p=portage.git Make digestgen() force fetch unless all required digest types are available. Thanks to jokey for reporting on irc. svn path=/main/trunk/; revision=5496 --- diff --git a/pym/portage.py b/pym/portage.py index 68df71e47..b16d3c711 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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: