diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-07-20 05:43:07 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-07-20 05:43:07 +0000 |
commit | cfc11a56a74ae60cc5ef0f81958ded0bc8a48f25 (patch) | |
tree | 6214911d69de2d48e8234df4921b16a2cb2dfdad | |
parent | a5f7a5031c122f439cd82c06cfea8bcb82854802 (diff) | |
download | portage-cfc11a56a74ae60cc5ef0f81958ded0bc8a48f25.tar.gz portage-cfc11a56a74ae60cc5ef0f81958ded0bc8a48f25.tar.bz2 portage-cfc11a56a74ae60cc5ef0f81958ded0bc8a48f25.zip |
If the fetcher reported success and the file is too small, don't attempt to resume. Upstream probably changed the distfile and we need to show a digest verification failure so the user gets a clue. (trunk r7321)
svn path=/main/branches/2.1.2/; revision=7322
-rw-r--r-- | pym/portage.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py index 16607087e..cde08aa7e 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -2729,7 +2729,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", "gid" : portage_gid, "groups" : userpriv_groups, "umask" : 002}) - + myret = -1 try: if mysettings.selinux_enabled(): @@ -2778,7 +2778,15 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", else: # no exception? file exists. let digestcheck() report # an appropriately for size or checksum errors - if (mystat[stat.ST_SIZE]<mydigests[myfile]["size"]): + + # If the fetcher reported success and the file is + # too small, it's probably because the digest is + # bad (upstream changed the distfile). In this + # case we don't want to attempt to resume. Show a + # digest verification failure to that the user gets + # a clue about what just happened. + if myret != os.EX_OK and \ + mystat.st_size < mydigests[myfile]["size"]: # Fetch failed... Try the next one... Kill 404 files though. if (mystat[stat.ST_SIZE]<100000) and (len(myfile)>4) and not ((myfile[-5:]==".html") or (myfile[-4:]==".htm")): html404=re.compile("<title>.*(not found|404).*</title>",re.I|re.M) |