Fix automatic sys.path insertions so that they're relative instead of absolute hard...
authorZac Medico <zmedico@gentoo.org>
Sat, 10 Feb 2007 20:26:20 +0000 (20:26 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 10 Feb 2007 20:26:20 +0000 (20:26 -0000)
svn path=/main/trunk/; revision=5942

16 files changed:
bin/archive-conf
bin/chkcontents
bin/clean_locks
bin/dispatch-conf
bin/ebuild
bin/emaint
bin/emerge
bin/env-update
bin/fix-db.py
bin/fixpackages
bin/md5check.py
bin/pkgname
bin/portageq
bin/regenworld
bin/repoman
bin/xpak

index 874b5cecb9bbb566d603a025c793c2637239627f..f43d993aba3abcaeea25565a848cf1b545d2a437 100755 (executable)
@@ -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
index 8be51782dc6c4f0539a8a7ad75c87a0233374c9e..3d1ab2ca3ea76b18224224e338f299f82d286010 100755 (executable)
@@ -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):
index 3b3c33c5c3f47ab984d70805f3281e20222d3aac..cddb5261b85d7e7c6887298269453bb4660efbe9 100755 (executable)
@@ -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:
index 309bd0db1372d4dbbbe5a0aa9911b7dcd29ff990..870f822566d88c23ee7aab24751aae1bdb9e4bf7 100755 (executable)
@@ -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
index 20254e007654b06f8f4b1e281d75b6952ac2a974..918633404fac9908d407b73216503fdb212bb13d 100755 (executable)
@@ -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
index ee9336667c2ccddfc99480823d85719e8ed93545..36d67501d51b712e259b0421b1d15a7dc572ef13 100755 (executable)
@@ -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
index bb8bf5b12b824845ad036163b677298059d4c0fa..66cde8a2c197a78c6f0b7217e214e39f0df09980 100755 (executable)
@@ -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
index 69daaca878643cfbb8c2e48805e0dc55dbfd8f3f..7be4a09f434d3e6e3f5f14de6bcd78132f29e512 100755 (executable)
@@ -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)
index a7be2affaf830a4355218e37f2022460409552c6..f96ee74fc6cebac6d190817f3ef2baf0614bd96b 100755 (executable)
@@ -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 *
index c03207d0af4da186f2968c437be17c2177600c31..88ccaed6277a851d4c8ad44c2e80987bb104776a 100755 (executable)
@@ -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
index 4cc6d86f9babcc632ceabcffa75f4b382f9aa007..d6e563f9ffb981e3c9078e17df42a46111d970a9 100755 (executable)
@@ -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
 
index ee4807744c0ddaf0e1d4718851dfa495cb7bbaf2..e842f38fbb29bfcde52d4b1996224ac3e3eeb441 100755 (executable)
@@ -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])
index 8a70bed8704d0dc98b68eee8c5de3e8bf726a33b..dc0361eb6e58e7d1b24e5877836c5e49ba3983af 100755 (executable)
@@ -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
index 0f7de9a2a330b1ce84a93e0634d784a4c89a81bf..b43f5c7cfdda21410b219517c0d1304b4c302f4e 100755 (executable)
@@ -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
 
index 28b63b4ed6293a70c8a60ff3d3d351aed299c47e..6ea782b6015f337fdaa56a5e198b3ac1b6f83ded 100755 (executable)
@@ -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"]
 
index 8dcbf145c2edc7939e48566ebf84ce0caedde549..ee348b5a678b051c9561f19d8eaf2796acd19070 100755 (executable)
--- 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])