From c3845fcf28236e4838e1cbae1626df9b6eb47f59 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 10 Feb 2007 20:26:20 +0000 Subject: [PATCH] Fix automatic sys.path insertions so that they're relative instead of absolute hard coded. svn path=/main/trunk/; revision=5942 --- bin/archive-conf | 3 ++- bin/chkcontents | 3 ++- bin/clean_locks | 3 ++- bin/dispatch-conf | 3 ++- bin/ebuild | 3 ++- bin/emaint | 3 ++- bin/emerge | 3 ++- bin/env-update | 3 ++- bin/fix-db.py | 3 ++- bin/fixpackages | 3 ++- bin/md5check.py | 3 ++- bin/pkgname | 3 ++- bin/portageq | 3 ++- bin/regenworld | 3 ++- bin/repoman | 3 ++- bin/xpak | 3 ++- 16 files changed, 32 insertions(+), 16 deletions(-) diff --git a/bin/archive-conf b/bin/archive-conf index 874b5cecb..f43d993ab 100755 --- a/bin/archive-conf +++ b/bin/archive-conf @@ -14,7 +14,8 @@ import os, sys try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage import dispatch_conf diff --git a/bin/chkcontents b/bin/chkcontents index 8be51782d..3d1ab2ca3 100755 --- a/bin/chkcontents +++ b/bin/chkcontents @@ -12,7 +12,8 @@ import os.path, os, sys try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage def CONTENTScheck(path): diff --git a/bin/clean_locks b/bin/clean_locks index 3b3c33c5c..cddb5261b 100755 --- a/bin/clean_locks +++ b/bin/clean_locks @@ -7,7 +7,8 @@ import os,sys,errno try: import portage.locks except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage.locks if not sys.argv[1:] or "--help" in sys.argv or "-h" in sys.argv: diff --git a/bin/dispatch-conf b/bin/dispatch-conf index 309bd0db1..870f82256 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -21,7 +21,8 @@ import atexit, commands, os, re, shutil, stat, sys try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage import dispatch_conf diff --git a/bin/ebuild b/bin/ebuild index 20254e007..918633404 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -24,7 +24,8 @@ os.environ["PORTAGE_CALLER"]="ebuild" try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage import portage.util, portage.const diff --git a/bin/emaint b/bin/emaint index ee9336667..36d67501d 100755 --- a/bin/emaint +++ b/bin/emaint @@ -7,7 +7,8 @@ import re try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage import portage.const, portage.exception diff --git a/bin/emerge b/bin/emerge index bb8bf5b12..66cde8a2c 100755 --- a/bin/emerge +++ b/bin/emerge @@ -26,7 +26,8 @@ os.environ["PORTAGE_LEGACY_GLOBALS"] = "false" try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage del os.environ["PORTAGE_LEGACY_GLOBALS"] from portage import digraph, portdbapi diff --git a/bin/env-update b/bin/env-update index 69daaca87..7be4a09f4 100755 --- a/bin/env-update +++ b/bin/env-update @@ -26,7 +26,8 @@ if len(sys.argv) > 1: try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage try: portage.env_update(makelinks) diff --git a/bin/fix-db.py b/bin/fix-db.py index a7be2affa..f96ee74fc 100755 --- a/bin/fix-db.py +++ b/bin/fix-db.py @@ -8,7 +8,8 @@ import os,sys,re try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage from stat import * diff --git a/bin/fixpackages b/bin/fixpackages index c03207d0a..88ccaed62 100755 --- a/bin/fixpackages +++ b/bin/fixpackages @@ -8,7 +8,8 @@ os.environ["PORTAGE_CALLER"]="fixpackages" try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage mysettings = portage.settings diff --git a/bin/md5check.py b/bin/md5check.py index 4cc6d86f9..d6e563f9f 100755 --- a/bin/md5check.py +++ b/bin/md5check.py @@ -8,7 +8,8 @@ os.environ["FEATURES"]="mirror cvs" try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage import portage.util diff --git a/bin/pkgname b/bin/pkgname index ee4807744..e842f38fb 100755 --- a/bin/pkgname +++ b/bin/pkgname @@ -7,7 +7,8 @@ import sys, os try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage a=portage.pkgsplit(sys.argv[1]) diff --git a/bin/portageq b/bin/portageq index 8a70bed87..dc0361eb6 100755 --- a/bin/portageq +++ b/bin/portageq @@ -356,7 +356,8 @@ def main(): try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage if uses_root: sys.argv[2] = portage.root diff --git a/bin/regenworld b/bin/regenworld index 0f7de9a2a..b43f5c7cf 100755 --- a/bin/regenworld +++ b/bin/regenworld @@ -7,7 +7,8 @@ import sys, os try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage import re diff --git a/bin/repoman b/bin/repoman index 28b63b4ed..6ea782b60 100755 --- a/bin/repoman +++ b/bin/repoman @@ -26,7 +26,8 @@ os.environ["PORTAGE_LEGACY_GLOBALS"] = "false" try: import portage except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import portage del os.environ["PORTAGE_LEGACY_GLOBALS"] diff --git a/bin/xpak b/bin/xpak index 8dcbf145c..ee348b5a6 100755 --- a/bin/xpak +++ b/bin/xpak @@ -11,7 +11,8 @@ if len(sys.argv)!=3: try: import xpak except ImportError: - sys.path.insert(0, "/usr/lib/portage/pym") + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) import xpak xpak.xpak(sys.argv[1],sys.argv[2]) -- 2.26.2