summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-09-19 02:36:35 +0000
committerZac Medico <zmedico@gentoo.org>2006-09-19 02:36:35 +0000
commit33d9b545e0dce0301e038d17ee8589bc34fe7e9c (patch)
tree79f5a1982ecb227c5b09b5bbcb381e93cd2e5880
parent8434ec1080b2b3ed696c0502f2258f6d19c746fb (diff)
downloadportage-33d9b545e0dce0301e038d17ee8589bc34fe7e9c.tar.gz
portage-33d9b545e0dce0301e038d17ee8589bc34fe7e9c.tar.bz2
portage-33d9b545e0dce0301e038d17ee8589bc34fe7e9c.zip
Fix fetch resume logic for bug #145601 and document the meaning of the "fetched" variable.
svn path=/main/trunk/; revision=4478
-rw-r--r--pym/portage.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 967b9aec4..d4f235873 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -2109,6 +2109,12 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
return 0
del distlocks_subdir
for myfile in filedict.keys():
+ """
+ fetched status
+ 0 nonexistent
+ 1 partially downloaded
+ 2 completely downloaded
+ """
myfile_path = os.path.join(mysettings["DISTDIR"], myfile)
fetched=0
file_lock = None
@@ -2289,6 +2295,8 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
try:
os.unlink(mysettings["DISTDIR"]+"/"+myfile)
writemsg(">>> Deleting invalid distfile. (Improper 404 redirect from server.)\n")
+ fetched = 0
+ continue
except SystemExit, e:
raise
except:
@@ -2297,6 +2305,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
raise
except:
pass
+ fetched = 1
continue
if not fetchonly:
fetched=2