summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-02-08 11:15:30 +0000
committerZac Medico <zmedico@gentoo.org>2008-02-08 11:15:30 +0000
commit626ff9f209fe3d6ff3805d78823f1559690cccaf (patch)
tree9fb0966f9f60bfbf299b8a66334291a14f9bb3a0 /bin
parent1dc15d881f6be809442ad9970fa3120614abcb16 (diff)
downloadportage-626ff9f209fe3d6ff3805d78823f1559690cccaf.tar.gz
portage-626ff9f209fe3d6ff3805d78823f1559690cccaf.tar.bz2
portage-626ff9f209fe3d6ff3805d78823f1559690cccaf.zip
Fix old broken binary package visibility filtering code inside
depgraph.select_files() and xcreate(). svn path=/main/branches/2.1.2/; revision=9297
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emerge43
1 files changed, 21 insertions, 22 deletions
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)