Use set.instersection() instead of a for loop. (trunk r10260)
authorZac Medico <zmedico@gentoo.org>
Fri, 9 May 2008 03:00:41 +0000 (03:00 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 9 May 2008 03:00:41 +0000 (03:00 -0000)
svn path=/main/branches/2.1.2/; revision=10261

bin/emerge

index 009e1a95b49a89d9acefb1e6a4f635c242cd866e..ef64ef1b36ac9ebcc867e7556143724a91c13013 100755 (executable)
@@ -5658,6 +5658,11 @@ class PackageCounters(object):
 
 class MergeTask(object):
 
+       _opts_ignore_blockers = \
+               frozenset(["--buildpkgonly",
+               "--fetchonly", "--fetch-all-uri",
+               "--nodeps", "--pretend"])
+
        def __init__(self, settings, trees, myopts):
                self.settings = settings
                self.target_root = settings["ROOT"]
@@ -5678,10 +5683,8 @@ class MergeTask(object):
                self._spawned_pids = []
 
        def _find_blockers(self, new_pkg):
-               for opt in ("--buildpkgonly", "--nodeps",
-                       "--fetchonly", "--fetch-all-uri", "--pretend"):
-                       if opt in self.myopts:
-                               return None
+               if self._opts_ignore_blockers.intersection(self.myopts):
+                       return None
 
                blocker_dblinks = []
                for blocking_pkg in self._blocker_db[