summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-05-23 22:20:19 +0000
committerZac Medico <zmedico@gentoo.org>2006-05-23 22:20:19 +0000
commitf36b76f38b54d2601cac6f22c511538e6ffe06e6 (patch)
treef043405a562668044456cf4ed3c08c6e0656d06c
parent140e009f13836af5d64d7c0eecaf7619bffaf1d6 (diff)
downloadportage-f36b76f38b54d2601cac6f22c511538e6ffe06e6.tar.gz
portage-f36b76f38b54d2601cac6f22c511538e6ffe06e6.tar.bz2
portage-f36b76f38b54d2601cac6f22c511538e6ffe06e6.zip
Fix repoman so that it works when the portage tree structure contains symlinks for bug #109961.
svn path=/main/trunk/; revision=3405
-rwxr-xr-xbin/repoman7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/repoman b/bin/repoman
index a6bbd8fa2..83e8675fe 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -423,6 +423,13 @@ def have_profile_dir(path, maxdepth=3):
portdir=None
portdir_overlay=None
mydir=os.getcwd()
+if "PWD" in os.environ and os.environ["PWD"] != mydir and \
+ os.path.realpath(os.environ["PWD"]) == mydir:
+ # getcwd() returns the canonical path but that makes it hard for repoman to
+ # orient itself if the user has symlinks in their portage tree structure.
+ # We use os.environ["PWD"], if available, to get the non-canonical path of
+ # the current working directory (from the shell).
+ mydir = os.environ["PWD"]
if mydir[-1] != "/":
mydir += "/"