summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-09 04:25:33 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-09 04:25:33 +0000
commita42c0b4a19f17d96bd20ca4f30e626287dae5a30 (patch)
treea292a37437c53e956882f0289fc4438273b672df
parent29c23959715aaa9d02fff96c2bb57a51196ee18b (diff)
downloadportage-a42c0b4a19f17d96bd20ca4f30e626287dae5a30.tar.gz
portage-a42c0b4a19f17d96bd20ca4f30e626287dae5a30.tar.bz2
portage-a42c0b4a19f17d96bd20ca4f30e626287dae5a30.zip
Make digestgen() force fetch unless all required digest types are available. Thanks to jokey for reporting on irc.
svn path=/main/trunk/; revision=5496
-rw-r--r--pym/portage.py14
1 files changed, 12 insertions, 2 deletions
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: