Filter sets that are not "world candidates" from the favorites list at
authorZac Medico <zmedico@gentoo.org>
Mon, 12 May 2008 22:58:50 +0000 (22:58 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 12 May 2008 22:58:50 +0000 (22:58 -0000)
the last moment since the favorites list needs to be complete for
depgraph.loadResumeCommand() to operate correctly.

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

pym/_emerge/__init__.py

index cee8db101f27f9f328100facadeb8a91e9cc8fda..9acfac2070a76c9308477c3ee06cd428cf617cb5 100644 (file)
@@ -2568,8 +2568,7 @@ class depgraph(object):
                                        self._sets[s] = expanded_set
                                        args.append(SetArg(arg=x, set=expanded_set,
                                                root_config=root_config))
-                                       if sets[s].world_candidate:
-                                               myfavorites.append(x)
+                                       myfavorites.append(x)
                                        continue
                                if not is_valid_package_atom(x):
                                        portage.writemsg("\n\n!!! '%s' is not a valid package atom.\n" % x,
@@ -8286,9 +8285,20 @@ def action_build(settings, trees, mtimedb,
                                        mergecount += 1
 
                        if mergecount==0:
-                               if "--noreplace" in myopts and not oneshot and favorites:
+                               sets = trees[settings["ROOT"]]["root_config"].sets
+                               if "--noreplace" in myopts and \
+                                       not oneshot and favorites:
+                                       # Sets that are not world candidates are filtered
+                                       # out here since the favorites list needs to be
+                                       # complete for depgraph.loadResumeCommand() to
+                                       # operate correctly.
+                                       world_candidates = [x for x in favorites \
+                                               if not (x.startswith(SETPREFIX) and \
+                                               not sets[x[1:]].world_candidate)]
+                               if "--noreplace" in myopts and \
+                                       not oneshot and world_candidates:
                                        print
-                                       for x in favorites:
+                                       for x in world_candidates:
                                                print " %s %s" % (good("*"), x)
                                        prompt="Would you like to add these packages to your world favorites?"
                                elif settings["AUTOCLEAN"] and "yes"==settings["AUTOCLEAN"]: