diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-06-21 02:29:43 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-06-21 02:29:43 +0000 |
commit | 02d002cad1ee0a71e6cf62c32418fca9a2618306 (patch) | |
tree | 1089f9935d810fc4bd461cd23331e94d737e6c1d /pym/portage_manifest.py | |
parent | 394bdf9f0ed2b21e7ce3c14d2e785516659cb77a (diff) | |
download | portage-02d002cad1ee0a71e6cf62c32418fca9a2618306.tar.gz portage-02d002cad1ee0a71e6cf62c32418fca9a2618306.tar.bz2 portage-02d002cad1ee0a71e6cf62c32418fca9a2618306.zip |
Force digest generation when assume-digests is enabled but the file size does not match. See bug #137032. This patch is from trunk r3517.
svn path=/main/branches/2.1/; revision=3566
Diffstat (limited to 'pym/portage_manifest.py')
-rw-r--r-- | pym/portage_manifest.py | 12 |
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: |