From c62d783d6780667bc7fc2824951447c6ff5e46a2 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 3 Jun 2008 06:50:32 +0000 Subject: [PATCH] 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 --- pym/portage/__init__.py | 15 +++++++++------ 1 file 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 -- 2.26.2