diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-07-06 00:05:56 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-07-06 00:05:56 +0000 |
commit | 278dcf3b225620a4bc0ccebb7b28a5539f79fcf1 (patch) | |
tree | 1e97e9660ddab6a10b22fec243259c5a93e9ec2f | |
parent | 222972c8fc4315d3ba93066237f3e1bd06c9c64e (diff) | |
download | portage-278dcf3b225620a4bc0ccebb7b28a5539f79fcf1.tar.gz portage-278dcf3b225620a4bc0ccebb7b28a5539f79fcf1.tar.bz2 portage-278dcf3b225620a4bc0ccebb7b28a5539f79fcf1.zip |
Fix emerge by ebuild path so that it works properly.
svn path=/main/trunk/; revision=7166
-rw-r--r-- | pym/emerge/__init__.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index 1a2582f18..97fc49d8c 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -1498,13 +1498,25 @@ class depgraph(object): return (0,myfavorites) arg_atoms.append((x, "="+mykey)) elif ext==".ebuild": - x = os.path.realpath(x) - mykey=os.path.basename(os.path.normpath(x+"/../.."))+"/"+os.path.splitext(os.path.basename(x))[0] + ebuild_path = portage.util.normalize_path(os.path.abspath(x)) + pkgdir = os.path.dirname(ebuild_path) + tree_root = os.path.dirname(os.path.dirname(pkgdir)) + cp = pkgdir[len(tree_root)+1:] + e = portage.exception.PackageNotFound( + ("%s is not in a valid portage tree " + \ + "hierarchy or does not exist") % x) + if not portage.isvalidatom(cp): + raise e + cat = portage.catsplit(cp)[0] + mykey = cat + "/" + os.path.basename(ebuild_path[:-7]) + if not portage.isvalidatom("="+mykey): + raise e ebuild_path = portdb.findname(mykey) if ebuild_path: - if os.path.realpath(ebuild_path) != x: + if ebuild_path != os.path.join(os.path.realpath(tree_root), + cp, os.path.basename(ebuild_path)): print colorize("BAD", "\n*** You need to adjust PORTDIR or PORTDIR_OVERLAY to emerge this package.\n") - sys.exit(1) + return 0, myfavorites if mykey not in portdb.xmatch( "match-visible", portage.dep_getkey(mykey)): print colorize("BAD", "\n*** You are emerging a masked package. It is MUCH better to use") @@ -1516,7 +1528,7 @@ class depgraph(object): raise portage.exception.PackageNotFound( "%s is not in a valid portage tree hierarchy or does not exist" % x) if not self.create(["ebuild", myroot, mykey], - None, "--onlydeps" not in self.myopts): + None, "--onlydeps" not in self.myopts, arg=x): return (0,myfavorites) arg_atoms.append((x, "="+mykey)) else: |