From: Zac Medico Date: Fri, 8 Feb 2008 11:15:30 +0000 (-0000) Subject: Fix old broken binary package visibility filtering code inside X-Git-Tag: v2.1.4.4~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=626ff9f209fe3d6ff3805d78823f1559690cccaf;p=portage.git Fix old broken binary package visibility filtering code inside depgraph.select_files() and xcreate(). svn path=/main/branches/2.1.2/; revision=9297 --- diff --git a/bin/emerge b/bin/emerge index 455079853..2c538e9a7 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1791,12 +1791,9 @@ class depgraph: vardb = self.trees[myroot]["vartree"].dbapi portdb = self.trees[myroot]["porttree"].dbapi bindb = self.trees[myroot]["bintree"].dbapi + bindb_keys = list(bindb._aux_cache_keys) pkgsettings = self.pkgsettings[myroot] arg_atoms = [] - def visible(mylist): - matches = portdb.gvisible(portdb.visible(mylist)) - return [x for x in mylist \ - if x in matches or not portdb.cpv_exists(x)] for x in myfiles: ext = os.path.splitext(x)[1] if ext==".tbz2": @@ -1911,10 +1908,13 @@ class depgraph: if myslots: best_pkgs = [] if "--usepkg" in self.myopts: - mymatches = bindb.match(myatom) - if "--usepkgonly" not in self.myopts: - mymatches = visible(mymatches) - best_pkg = portage.best(mymatches) + best_pkg = None + for cpv in reversed(bindb.match(myatom)): + metadata = dict(izip(bindb_keys, + bindb.aux_get(cpv, bindb_keys))) + if visible(pkgsettings, cpv, metadata, built=True): + best_pkg = cpv + break if best_pkg: best_slot = bindb.aux_get(best_pkg, ["SLOT"])[0] best_pkgs.append(("binary", best_pkg, best_slot)) @@ -1938,11 +1938,12 @@ class depgraph: "porttree"].dbapi.match(myslot_atom): available = True elif "--usepkg" in self.myopts: - mymatches = bindb.match(myslot_atom) - if "--usepkgonly" not in self.myopts: - mymatches = visible(mymatches) - if mymatches: - available = True + for cpv in bindb.match(myslot_atom): + metadata = dict(izip(bindb_keys, + bindb.aux_get(cpv, bindb_keys))) + if visible(pkgsettings, cpv, metadata, built=True): + available = True + break if available: greedy_atoms.append((myarg, myslot_atom)) arg_atoms = greedy_atoms @@ -2912,10 +2913,7 @@ class depgraph: vardb = self.trees[self.target_root]["vartree"].dbapi portdb = self.trees[self.target_root]["porttree"].dbapi bindb = self.trees[self.target_root]["bintree"].dbapi - def visible(mylist): - matches = portdb.gvisible(portdb.visible(mylist)) - return [x for x in mylist \ - if x in matches or not portdb.cpv_exists(x)] + bindb_keys = list(bindb._aux_cache_keys) world_problems = False root_config = self.roots[self.target_root] @@ -2936,11 +2934,12 @@ class depgraph: portdb.match(x): available = True elif "--usepkg" in self.myopts: - mymatches = bindb.match(x) - if "--usepkgonly" not in self.myopts: - mymatches = visible(mymatches) - if mymatches: - available = True + for cpv in bindb.match(x): + metadata = dict(izip(bindb_keys, + bindb.aux_get(cpv, bindb_keys))) + if visible(pkgsettings, cpv, metadata, built=True): + available = True + break if not available: continue mylist.append(x)