Bug #283292 - Fix FindPortdir() to prevent OSError: [Errno 2] from stat when
authorZac Medico <zmedico@gentoo.org>
Mon, 31 Aug 2009 07:56:28 +0000 (07:56 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 31 Aug 2009 07:56:28 +0000 (07:56 -0000)
$PWD is unset. Thanks to Jonathan Callen <en.ABCD@gmail.com> for this patch.

svn path=/main/trunk/; revision=14174

pym/repoman/utilities.py

index cf32399d3d88eefee7b00b2798149f8cba968110..c3665d9d8c8c9c2bc7435f71b1a0c50157497430 100644 (file)
@@ -346,7 +346,7 @@ def FindPortdir(settings):
        portdir_overlay = None
        location = os.getcwd()
        pwd = os.environ.get('PWD', '')
-       if pwd != location and os.path.realpath(pwd) == location:
+       if pwd and pwd != location and os.path.realpath(pwd) == location:
                # 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