From b6d91984f5c298e172bd4e71d82919000971521f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 10 Feb 2007 21:43:35 +0000 Subject: [PATCH] Use os.path.realpath to handle symlinks properly. svn path=/main/trunk/; revision=5945 --- bin/archive-conf | 2 +- bin/chkcontents | 2 +- bin/clean_locks | 2 +- bin/dispatch-conf | 2 +- bin/ebuild | 2 +- bin/emaint | 2 +- bin/emerge | 2 +- bin/env-update | 2 +- bin/fix-db.py | 2 +- bin/fixpackages | 2 +- bin/md5check.py | 2 +- bin/pkgname | 2 +- bin/portageq | 2 +- bin/regenworld | 2 +- bin/repoman | 2 +- bin/xpak | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bin/archive-conf b/bin/archive-conf index f43d993ab..63ce9b2e3 100755 --- a/bin/archive-conf +++ b/bin/archive-conf @@ -15,7 +15,7 @@ try: import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage import dispatch_conf diff --git a/bin/chkcontents b/bin/chkcontents index 3d1ab2ca3..fe108de06 100755 --- a/bin/chkcontents +++ b/bin/chkcontents @@ -13,7 +13,7 @@ try: import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage def CONTENTScheck(path): diff --git a/bin/clean_locks b/bin/clean_locks index cddb5261b..89473bd81 100755 --- a/bin/clean_locks +++ b/bin/clean_locks @@ -8,7 +8,7 @@ try: import portage.locks except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__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 870f82256..6c5b57e6b 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -22,7 +22,7 @@ try: import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage import dispatch_conf diff --git a/bin/ebuild b/bin/ebuild index 918633404..c5f58ba82 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -25,7 +25,7 @@ try: import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage import portage.util, portage.const diff --git a/bin/emaint b/bin/emaint index 36d67501d..0d578951c 100755 --- a/bin/emaint +++ b/bin/emaint @@ -8,7 +8,7 @@ try: import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage import portage.const, portage.exception diff --git a/bin/emerge b/bin/emerge index 66cde8a2c..e97127b4f 100755 --- a/bin/emerge +++ b/bin/emerge @@ -27,7 +27,7 @@ try: import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__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 7be4a09f4..294876808 100755 --- a/bin/env-update +++ b/bin/env-update @@ -27,7 +27,7 @@ try: import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage try: portage.env_update(makelinks) diff --git a/bin/fix-db.py b/bin/fix-db.py index f96ee74fc..19eb31425 100755 --- a/bin/fix-db.py +++ b/bin/fix-db.py @@ -9,7 +9,7 @@ try: import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage from stat import * diff --git a/bin/fixpackages b/bin/fixpackages index 88ccaed62..388a9ad44 100755 --- a/bin/fixpackages +++ b/bin/fixpackages @@ -9,7 +9,7 @@ try: import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage mysettings = portage.settings diff --git a/bin/md5check.py b/bin/md5check.py index d6e563f9f..3525ea111 100755 --- a/bin/md5check.py +++ b/bin/md5check.py @@ -9,7 +9,7 @@ try: import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage import portage.util diff --git a/bin/pkgname b/bin/pkgname index e842f38fb..4c0dd6c94 100755 --- a/bin/pkgname +++ b/bin/pkgname @@ -8,7 +8,7 @@ try: import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage a=portage.pkgsplit(sys.argv[1]) diff --git a/bin/portageq b/bin/portageq index dc0361eb6..f4812a26e 100755 --- a/bin/portageq +++ b/bin/portageq @@ -357,7 +357,7 @@ def main(): import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage if uses_root: sys.argv[2] = portage.root diff --git a/bin/regenworld b/bin/regenworld index b43f5c7cf..ebac4a591 100755 --- a/bin/regenworld +++ b/bin/regenworld @@ -8,7 +8,7 @@ try: import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage import re diff --git a/bin/repoman b/bin/repoman index 6ea782b60..7555fdc0e 100755 --- a/bin/repoman +++ b/bin/repoman @@ -27,7 +27,7 @@ try: import portage except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage del os.environ["PORTAGE_LEGACY_GLOBALS"] diff --git a/bin/xpak b/bin/xpak index ee348b5a6..4fc1eb9fb 100755 --- a/bin/xpak +++ b/bin/xpak @@ -12,7 +12,7 @@ try: import xpak except ImportError: from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(__file__)), "pym")) + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import xpak xpak.xpak(sys.argv[1],sys.argv[2]) -- 2.26.2