summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-01-11 02:18:39 +0000
committerZac Medico <zmedico@gentoo.org>2008-01-11 02:18:39 +0000
commitcea8614c30d30cfbdfcb9bee8585f42f7db04f95 (patch)
treeeb44a92de87a48a9fd02173fa1dc82e6a6fcd6b0
parent48226fb63daf14029f123ba43059b2513813fb8a (diff)
downloadportage-cea8614c30d30cfbdfcb9bee8585f42f7db04f95.tar.gz
portage-cea8614c30d30cfbdfcb9bee8585f42f7db04f95.tar.bz2
portage-cea8614c30d30cfbdfcb9bee8585f42f7db04f95.zip
Fix the "Appending to PORTDIR_OVERLAY..." feature which was
broken by the previous commit. svn path=/main/trunk/; revision=9165
-rwxr-xr-xbin/ebuild24
1 files changed, 11 insertions, 13 deletions
diff --git a/bin/ebuild b/bin/ebuild
index 1c4acef79..67c5b9cce 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -57,10 +57,17 @@ if not os.path.isabs(ebuild):
ebuild = portage.normalize_path(ebuild)
# portdbapi uses the canonical path for the base of the portage tree, but
# subdirectories of the base can be built from symlinks (like crossdev does).
-ebuild_portdir = os.path.realpath(os.path.dirname(os.path.dirname(ebuild)))
-ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-2:])
+ebuild_portdir = os.path.realpath(
+ os.path.dirname(os.path.dirname(os.path.dirname(ebuild))))
+ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-3:])
# Make sure that portdb.findname() returns the correct ebuild.
+if ebuild_portdir not in portage.portdb.porttrees:
+ os.environ["PORTDIR_OVERLAY"] = \
+ os.environ.get("PORTDIR_OVERLAY","") + " " + ebuild_portdir
+ print "Appending %s to PORTDIR_OVERLAY..." % ebuild_portdir
+ portage.close_portdbapi_caches()
+ reload(portage)
del portage.portdb.porttrees[1:]
if ebuild_portdir != portage.portdb.porttree_root:
portage.portdb.porttrees.append(ebuild_portdir)
@@ -92,17 +99,8 @@ else:
portage_ebuild = portage.portdb.findname(cpv)
if not portage_ebuild or portage_ebuild != ebuild:
- overlay = "/".join(ebuild_split[:-2])
- os.environ["PORTDIR_OVERLAY"] = os.environ.get("PORTDIR_OVERLAY","") + " " + overlay
- print "Appending %s to PORTDIR_OVERLAY..." % overlay
- portage.close_portdbapi_caches()
- reload(portage)
- portage_ebuild = portage.portdb.findname(cpv)
-
- if not portage_ebuild or portage_ebuild != ebuild:
- print "!!! %s does not seem to have a valid PORTDIR structure." % overlay
- sys.exit(1)
-
+ print "!!! %s does not seem to have a valid PORTDIR structure." % ebuild
+ sys.exit(1)
if len(pargs) > 1 and "config" in pargs:
print "config must be called on it's own, not combined with any other phase"