summaryrefslogtreecommitdiffstats
path: root/pym/portage_manifest.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-06-17 15:56:09 +0000
committerZac Medico <zmedico@gentoo.org>2006-06-17 15:56:09 +0000
commite7f711de30928cf0762d7c694091467ab5a9d191 (patch)
tree29a13a97508e37375f55744fa57fb12fb72e6270 /pym/portage_manifest.py
parent89677e03e6a046f69d6f591d0f49dd3e91f194b9 (diff)
downloadportage-e7f711de30928cf0762d7c694091467ab5a9d191.tar.gz
portage-e7f711de30928cf0762d7c694091467ab5a9d191.tar.bz2
portage-e7f711de30928cf0762d7c694091467ab5a9d191.zip
Force digest generation when assume-digests is enabled but the file size does not match. See bug #137032.
svn path=/main/trunk/; revision=3517
Diffstat (limited to 'pym/portage_manifest.py')
-rw-r--r--pym/portage_manifest.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/pym/portage_manifest.py b/pym/portage_manifest.py
index e484d9e37..13c6932d2 100644
--- a/pym/portage_manifest.py
+++ b/pym/portage_manifest.py
@@ -450,8 +450,16 @@ class Manifest(object):
requiredDistfiles = distlist.copy()
for f in distlist:
fname = os.path.join(self.distdir, f)
- if f in distfilehashes and (assumeDistHashesAlways or \
- (assumeDistHashesSometimes and not os.path.exists(fname))):
+ mystat = None
+ try:
+ mystat = os.stat(fname)
+ except OSError:
+ pass
+ if f in distfilehashes and \
+ ((assumeDistHashesSometimes and mystat is None) or \
+ (assumeDistHashesAlways and mystat is None) or \
+ (assumeDistHashesAlways and mystat is not None and \
+ distfilehashes[f]["size"] == mystat.st_size)):
self.fhashdict["DIST"][f] = distfilehashes[f]
else:
try: