summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-02-10 00:13:16 +0000
committerZac Medico <zmedico@gentoo.org>2010-02-10 00:13:16 +0000
commit33a9d38b3e4e73d4ba5c08d1f151e0b6156712c7 (patch)
tree9b75160128deee5fbe78c1c20496c7f23e9db0d3
parentbdac7ce296a4f98e93fd3d24876a8a5b11437633 (diff)
downloadportage-33a9d38b3e4e73d4ba5c08d1f151e0b6156712c7.tar.gz
portage-33a9d38b3e4e73d4ba5c08d1f151e0b6156712c7.tar.bz2
portage-33a9d38b3e4e73d4ba5c08d1f151e0b6156712c7.zip
Bug #303211 - Discard invalid SIZE metadata when using the old binhost
protocol. svn path=/main/trunk/; revision=15333
-rw-r--r--pym/portage/dbapi/bintree.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index e817e3d03..e07f58a47 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -838,6 +838,17 @@ class binarytree(object):
remote_metadata = self.remotepkgs[mypkg]
for k, v in remote_metadata.items():
remote_metadata[k] = v.strip()
+
+ # Eliminate metadata values with names that digestCheck
+ # uses, since they are not valid when using the old
+ # protocol. Typically this is needed for SIZE metadata
+ # which corresponds to the size of the unpacked files
+ # rather than the binpkg file size, triggering digest
+ # verification failures as reported in bug #303211.
+ remote_metadata.pop('SIZE', None)
+ for k in portage.checksum.hashfunc_map:
+ remote_metadata.pop(k, None)
+
self._remotepkgs[fullpkg] = remote_metadata
#print " -- Injected"
except SystemExit as e: