summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-07-17 04:58:36 +0000
committerZac Medico <zmedico@gentoo.org>2007-07-17 04:58:36 +0000
commitc92f44e31e9aa32b9e20a4df4f222d9ab1ca2ee3 (patch)
treebb40583b511ed422a62c1faae978b3b2eba6fa0a
parentbf5896a61949aa66c6a11798af285b9528120983 (diff)
downloadportage-c92f44e31e9aa32b9e20a4df4f222d9ab1ca2ee3.tar.gz
portage-c92f44e31e9aa32b9e20a4df4f222d9ab1ca2ee3.tar.bz2
portage-c92f44e31e9aa32b9e20a4df4f222d9ab1ca2ee3.zip
When dep_expand throws a ValueError due to an ambiguous atom, try to expand it against the installed packages in case it yields a unique match.
svn path=/main/trunk/; revision=7292
-rw-r--r--pym/emerge/__init__.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index 62d501daa..042d2467d 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -1414,6 +1414,7 @@ class depgraph(object):
"given a list of .tbz2s, .ebuilds and deps, create the appropriate depgraph and return a favorite list"
myfavorites=[]
myroot = self.target_root
+ vardb = self.trees[myroot]["vartree"].dbapi
portdb = self.trees[myroot]["porttree"].dbapi
bindb = self.trees[myroot]["bintree"].dbapi
pkgsettings = self.pkgsettings[myroot]
@@ -1493,13 +1494,19 @@ class depgraph(object):
if "--usepkg" in self.myopts:
mykey = portage.dep_expand(x, mydb=bindb,
settings=pkgsettings)
- if (mykey and not mykey.startswith("null/")) or \
- "--usepkgonly" in self.myopts:
+ if "--usepkgonly" in self.myopts or \
+ (mykey and not portage.dep_getkey(mykey).startswith("null/")):
arg_atoms.append((x, mykey))
continue
- mykey = portage.dep_expand(x,
- mydb=portdb, settings=pkgsettings)
+ try:
+ mykey = portage.dep_expand(x,
+ mydb=portdb, settings=pkgsettings)
+ except ValueError:
+ mykey = portage.dep_expand(x,
+ mydb=vardb, settings=pkgsettings)
+ if portage.dep_getkey(mykey).startswith("null/"):
+ raise
arg_atoms.append((x, mykey))
except ValueError, errpkgs:
print "\n\n!!! The short ebuild name \"" + x + "\" is ambiguous. Please specify"