summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-06-03 06:50:32 +0000
committerZac Medico <zmedico@gentoo.org>2008-06-03 06:50:32 +0000
commitc62d783d6780667bc7fc2824951447c6ff5e46a2 (patch)
tree546104511cc62adb24ee1055ce7ab606b1abd3fa
parentf596eb79f86fb25f37f726f32c01308bde10fcc3 (diff)
downloadportage-c62d783d6780667bc7fc2824951447c6ff5e46a2.tar.gz
portage-c62d783d6780667bc7fc2824951447c6ff5e46a2.tar.bz2
portage-c62d783d6780667bc7fc2824951447c6ff5e46a2.zip
When pruning the digests to optimize parallel-fetch, use a separate dict
so that the original digests are still available if a file needs to be downloaded. svn path=/main/trunk/; revision=10551
-rw-r--r--pym/portage/__init__.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 51cb281a5..994551434 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -3412,12 +3412,13 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
"""
fetched = 0
- digests = mydigests.get(myfile, {})
- size = digests.get("size")
+ orig_digests = mydigests.get(myfile, {})
+ size = orig_digests.get("size")
+ pruned_digests = orig_digests
if parallel_fetchonly:
- digests.clear()
+ pruned_digests = pruned_digests.copy()
if size is not None:
- digests["size"] = size
+ pruned_digests["size"] = size
myfile_path = os.path.join(mysettings["DISTDIR"], myfile)
has_space = True
@@ -3468,7 +3469,8 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
eout = portage.output.EOutput()
eout.quiet = mysettings.get("PORTAGE_QUIET") == "1"
- match, mystat = _check_distfile(myfile_path, digests, eout)
+ match, mystat = _check_distfile(
+ myfile_path, pruned_digests, eout)
if match:
if can_fetch and not fetch_to_ro:
try:
@@ -3520,7 +3522,8 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
readonly_file = None
for x in ro_distdirs:
filename = os.path.join(x, myfile)
- match, mystat = _check_distfile(filename, digests, eout)
+ match, mystat = _check_distfile(
+ filename, pruned_digests, eout)
if match:
readonly_file = filename
break