From: Zac Medico Date: Tue, 23 May 2006 22:20:19 +0000 (-0000) Subject: Fix repoman so that it works when the portage tree structure contains symlinks for... X-Git-Tag: v2.1~66 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f36b76f38b54d2601cac6f22c511538e6ffe06e6;p=portage.git Fix repoman so that it works when the portage tree structure contains symlinks for bug #109961. svn path=/main/trunk/; revision=3405 --- 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 += "/"