summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-31 04:23:06 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-31 04:23:06 +0000
commit64396f7e8e3914d66d4b5efb9bfd80c8cd7a72fd (patch)
tree70a47dc3100da9328a1cd40bb5ac49e37c40a756 /bin/ebuild
parentJust use stat instead of lstat for config protect, so that broken symlinks ar... (diff)
downloadportage-multirepo-64396f7e8e3914d66d4b5efb9bfd80c8cd7a72fd.tar.gz
portage-multirepo-64396f7e8e3914d66d4b5efb9bfd80c8cd7a72fd.tar.bz2
portage-multirepo-64396f7e8e3914d66d4b5efb9bfd80c8cd7a72fd.zip
Rely on PYTHONPATH instead of PORTAGE_PYM_PATH for locating portage's python modules, then fall back to an explicit sys.path insertion if an ImportError occurs.
svn path=/main/trunk/; revision=4884
Diffstat (limited to 'bin/ebuild')
-rwxr-xr-xbin/ebuild8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/ebuild b/bin/ebuild
index 2d8c0890..da405db0 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -21,9 +21,13 @@ if "merge" in pargs:
os.environ["FEATURES"] = os.environ.get("FEATURES", "") + " -noauto"
os.environ["PORTAGE_CALLER"]="ebuild"
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
-import portage, portage_util, portage_const
+import portage_util, portage_const
# do this _after_ 'import portage' to prevent unnecessary tracing
if debug and "python-trace" in portage.features: