diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-05-08 07:48:21 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-05-08 07:48:21 +0000 |
commit | 9f38ee361f2141a32892f600cb359292fd5ea007 (patch) | |
tree | e628957d3f43a523241441f18c626901a7d4cb06 | |
parent | 51504cbd18433ee73cf81006be3817738757076e (diff) | |
download | portage-9f38ee361f2141a32892f600cb359292fd5ea007.tar.gz portage-9f38ee361f2141a32892f600cb359292fd5ea007.tar.bz2 portage-9f38ee361f2141a32892f600cb359292fd5ea007.zip |
Prevent a TypeError exception when the /etc/make.profile symlink is broken on nonexistent.
svn path=/main/trunk/; revision=3332
-rw-r--r-- | pym/portage.py | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/pym/portage.py b/pym/portage.py index 1b70f5e59..96fb8bb36 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1014,18 +1014,16 @@ class config: # configlist will contain: [ globals, defaults, conf, pkg, auto, backupenv (incrementals), origenv ] # The symlink might not exist or might not be a symlink. - try: - self.profiles=[abssymlink(self.profile_path)] - except SystemExit, e: - raise - except: - self.profiles=[self.profile_path] - - mypath = self.profiles[0] - while os.path.exists(mypath+"/parent"): - mypath = os.path.normpath(mypath+"///"+grabfile(mypath+"/parent")[0]) - if os.path.exists(mypath): - self.profiles.insert(0,mypath) + if self.profile_path is None: + self.profiles = [] + else: + self.profiles = [abssymlink(self.profile_path)] + mypath = self.profiles[0] + while os.path.exists(os.path.join(mypath, "parent")): + mypath = os.path.normpath(os.path.join( + mypath, grabfile(os.path.join(mypath, "parent"))[0])) + if os.path.exists(mypath): + self.profiles.insert(0, mypath) if os.environ.has_key("PORTAGE_CALLER") and os.environ["PORTAGE_CALLER"] == "repoman": pass |