* In fetch(), ensure that pkg_nofetch is never called more than once.
authorZac Medico <zmedico@gentoo.org>
Sat, 1 Nov 2008 08:32:57 +0000 (08:32 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 1 Nov 2008 08:32:57 +0000 (08:32 -0000)
* In _validate_deps(), revert back to using aux_get since the config
  instance does not cache SRC_URI.

svn path=/main/trunk/; revision=11782

pym/portage/__init__.py

index 92c567f1c0e14cce74ebd934a51d9c005255a43d..bdd8557916ad41c0600eb845f84e2e855df4b7c7 100644 (file)
@@ -3657,6 +3657,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
 
        distdir_writable = can_fetch and not fetch_to_ro
        failed_files = set()
+       restrict_fetch_msg = False
 
        for myfile in filedict:
                """
@@ -4099,7 +4100,8 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                if listonly:
                        writemsg_stdout("\n", noiselevel=-1)
                if fetched != 2:
-                       if restrict_fetch:
+                       if restrict_fetch and not restrict_fetch_msg:
+                               restrict_fetch_msg = True
                                msg = ("\n!!! %s/%s" + \
                                        " has fetch restriction turned on.\n" + \
                                        "!!! This probably means that this " + \
@@ -4135,17 +4137,21 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                                                        mysettings.pop("EBUILD_PHASE", None)
                                                else:
                                                        mysettings["EBUILD_PHASE"] = ebuild_phase
-                               if listonly:
-                                       continue
+
+                       elif restrict_fetch:
+                               pass
                        elif listonly:
-                               continue
+                               pass
                        elif not filedict[myfile]:
                                writemsg("Warning: No mirrors available for file" + \
                                        " '%s'\n" % (myfile), noiselevel=-1)
                        else:
                                writemsg("!!! Couldn't download '%s'. Aborting.\n" % myfile,
                                        noiselevel=-1)
-                       if fetchonly and not restrict_fetch:
+
+                       if listonly:
+                               continue
+                       elif fetchonly:
                                failed_files.add(myfile)
                                continue
                        return 0
@@ -5847,7 +5853,8 @@ def _validate_deps(mysettings, myroot, mydo, mydbapi):
        misc_keys = ["LICENSE", "PROPERTIES", "PROVIDE", "RESTRICT", "SRC_URI"]
        other_keys = ["SLOT"]
        all_keys = dep_keys + misc_keys + other_keys
-       metadata = mysettings.configdict["pkg"]
+       metadata = dict(izip(all_keys,
+               mydbapi.aux_get(mysettings.mycpv, all_keys)))
 
        class FakeTree(object):
                def __init__(self, mydb):