summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-07-19 11:04:17 -0700
committerZac Medico <zmedico@gentoo.org>2010-07-19 11:04:17 -0700
commitf7e0875d7c341b5447bb3519495fd4ab2d3f565c (patch)
tree042cca9c12242cdbd7b08dcd5bc6c01276ee25c8 /pym
parent4caf362abfd8a435929f49552d808be4bec465bf (diff)
downloadportage-f7e0875d7c341b5447bb3519495fd4ab2d3f565c.tar.gz
portage-f7e0875d7c341b5447bb3519495fd4ab2d3f565c.tar.bz2
portage-f7e0875d7c341b5447bb3519495fd4ab2d3f565c.zip
In portdbapi.getfetchsizes(), only split PORTAGE_RO_DISTDIRS when necessary.
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/porttree.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 9c67c7884..a40678bdd 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -785,8 +785,6 @@ class portdbapi(dbapi):
return {}
filesdict={}
myfiles = self.getFetchMap(mypkg, useflags=useflags)
- ro_distdirs = [x for x in \
- shlex_split(self.settings.get("PORTAGE_RO_DISTDIRS", ""))]
#XXX: maybe this should be improved: take partial downloads
# into account? check checksums?
for myfile in myfiles:
@@ -804,15 +802,17 @@ class portdbapi(dbapi):
pass
if mystat is None:
existing_size = 0
- for x in ro_distdirs:
- try:
- mystat = os.stat(os.path.join(x, myfile))
- except OSError:
- pass
- else:
- if mystat.st_size == fetch_size:
- existing_size = fetch_size
- break
+ ro_distdirs = self.settings.get("PORTAGE_RO_DISTDIRS")
+ if ro_distdirs is not None:
+ for x in shlex_split(ro_distdirs):
+ try:
+ mystat = os.stat(os.path.join(x, myfile))
+ except OSError:
+ pass
+ else:
+ if mystat.st_size == fetch_size:
+ existing_size = fetch_size
+ break
else:
existing_size = mystat.st_size
remaining_size = fetch_size - existing_size