Use os.path.realpath to handle symlinks properly.
authorZac Medico <zmedico@gentoo.org>
Sat, 10 Feb 2007 21:43:35 +0000 (21:43 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 10 Feb 2007 21:43:35 +0000 (21:43 -0000)
svn path=/main/trunk/; revision=5945

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 f43d993aba3abcaeea25565a848cf1b545d2a437..63ce9b2e3025addd23db26523c4a471f97c9cc86 100755 (executable)
@@ -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
index 3d1ab2ca3ea76b18224224e338f299f82d286010..fe108de06cdbf6418c3347cc781f1db4b7dccfc3 100755 (executable)
@@ -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):
index cddb5261b85d7e7c6887298269453bb4660efbe9..89473bd81e38fe82a6ece39344167e3a03b9bf20 100755 (executable)
@@ -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:
index 870f822566d88c23ee7aab24751aae1bdb9e4bf7..6c5b57e6b77c5661b901d90e04a8a75bd8d30c4b 100755 (executable)
@@ -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
index 918633404fac9908d407b73216503fdb212bb13d..c5f58ba82142611f68823d7ba7b9fef23dfeb85b 100755 (executable)
@@ -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
index 36d67501d51b712e259b0421b1d15a7dc572ef13..0d578951c36ccba7edfc550f4796acad3771f437 100755 (executable)
@@ -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
index 66cde8a2c197a78c6f0b7217e214e39f0df09980..e97127b4f1029d871a1c6fe3bbf0f5ca0c015b66 100755 (executable)
@@ -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
index 7be4a09f434d3e6e3f5f14de6bcd78132f29e512..29487680850c30d818437852cf593bd712c64a7a 100755 (executable)
@@ -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)
index f96ee74fc6cebac6d190817f3ef2baf0614bd96b..19eb3142588e0319d3c358604f6cb635561c6ae3 100755 (executable)
@@ -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 *
index 88ccaed6277a851d4c8ad44c2e80987bb104776a..388a9ad44ce3bf70df9f8c143fe9646b48691d1c 100755 (executable)
@@ -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
index d6e563f9ffb981e3c9078e17df42a46111d970a9..3525ea11166214265098af78398a95b2823b78ad 100755 (executable)
@@ -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
 
index e842f38fbb29bfcde52d4b1996224ac3e3eeb441..4c0dd6c949e7c5e4b318bb1e2400af54de513a45 100755 (executable)
@@ -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])
index dc0361eb6e58e7d1b24e5877836c5e49ba3983af..f4812a26e31edf8f944022823c966bab03dda6ce 100755 (executable)
@@ -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
index b43f5c7cfdda21410b219517c0d1304b4c302f4e..ebac4a5916f1e29f919dc15917a0fef5c64b8376 100755 (executable)
@@ -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
 
index 6ea782b6015f337fdaa56a5e198b3ac1b6f83ded..7555fdc0e88e0062cb238f24dbdbd8465ce414ba 100755 (executable)
@@ -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"]
 
index ee348b5a678b051c9561f19d8eaf2796acd19070..4fc1eb9fb8a542ac4013ac64bd1e4a16641e805c 100755 (executable)
--- 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])