From: Zac Medico Date: Mon, 31 Aug 2009 07:56:28 +0000 (-0000) Subject: Bug #283292 - Fix FindPortdir() to prevent OSError: [Errno 2] from stat when X-Git-Tag: v2.2_rc41~84 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0d753685a838e7f302146bf8c5aff54e76908435;p=portage.git Bug #283292 - Fix FindPortdir() to prevent OSError: [Errno 2] from stat when $PWD is unset. Thanks to Jonathan Callen for this patch. svn path=/main/trunk/; revision=14174 --- diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py index cf32399d3..c3665d9d8 100644 --- a/pym/repoman/utilities.py +++ b/pym/repoman/utilities.py @@ -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