summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-01-14 00:20:33 +0000
committerZac Medico <zmedico@gentoo.org>2009-01-14 00:20:33 +0000
commite59a3c77fc90a888326b8f3862b7d15a936a29ea (patch)
tree58854d30d479c7665f77887293635d13ee931e99
parent15859f3b49ff4fc7dfe585e7139d23a453dca5d1 (diff)
downloadportage-e59a3c77fc90a888326b8f3862b7d15a936a29ea.tar.gz
portage-e59a3c77fc90a888326b8f3862b7d15a936a29ea.tar.bz2
portage-e59a3c77fc90a888326b8f3862b7d15a936a29ea.zip
Inside digestgen(), don't unnecessarily call fetch() in cases when the there
are no hashes for comparison and the file already exists in $DISTDIR. svn path=/main/trunk/; revision=12499
-rw-r--r--pym/portage/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 710496eec..1f122bdf5 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -4244,7 +4244,12 @@ def digestgen(myarchives, mysettings, overwrite=1, manifestonly=0, myportdb=None
for myfile in distfiles_map:
myhashes = dist_hashes.get(myfile)
if not myhashes:
- missing_files.append(myfile)
+ try:
+ st = os.stat(os.path.join(mysettings["DISTDIR"], myfile))
+ except OSError:
+ st = None
+ if st is None or st.st_size == 0:
+ missing_files.append(myfile)
continue
size = myhashes.get("size")