From: Andrew Gaffney Date: Tue, 13 Jan 2009 13:19:41 +0000 (-0600) Subject: Try to import portage.util before portage_util X-Git-Tag: CATALYST-2.0.10~3^2~163 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=a0aa9d9e8da16896de58f0504319460ab4ca1ea3;p=catalyst.git Try to import portage.util before portage_util --- diff --git a/ChangeLog b/ChangeLog index b2d9c65a..74fdc51b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ # Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS) # Distributed under the GPL v2 + 13 Jan 2009; Andrew Gaffney + modules/catalyst/util.py: + Try to import portage.util before portage_util + 13 Jan 2009; Andrew Gaffney modules/catalyst/config.py: Add validate_values() and compare_key() functions to Spec class diff --git a/modules/catalyst/util.py b/modules/catalyst/util.py index ccc89822..e949d45b 100644 --- a/modules/catalyst/util.py +++ b/modules/catalyst/util.py @@ -166,13 +166,17 @@ def read_makeconf(mymakeconffile): return snakeoil.fileutils.read_bash_dict(mymakeconffile, sourcing_command="source") except ImportError: try: - import portage_util - return portage_util.getconfig(mymakeconffile, tolerant=1, allow_sourcing=True) - except ImportError: - myf=open(mymakeconffile,"r") - mylines=myf.readlines() - myf.close() - return parse_makeconf(mylines) + import portage.util + return portage.util.genconfig(mymakeconffile, tolerant=1, allow_sourcing=True) + except: + try: + import portage_util + return portage_util.getconfig(mymakeconffile, tolerant=1, allow_sourcing=True) + except ImportError: + myf=open(mymakeconffile,"r") + mylines=myf.readlines() + myf.close() + return parse_makeconf(mylines) except: raise CatalystError, "Could not parse make.conf file "+mymakeconffile else: