From: Andrew Gaffney Date: Tue, 13 Jan 2009 13:20:33 +0000 (-0600) Subject: Try to import portage.util before portage_util X-Git-Tag: CATALYST_2_0_6_916~42 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=25b30b3cf9746b021252f7d4a6f4182d68e9c18d;p=catalyst.git Try to import portage.util before portage_util --- diff --git a/ChangeLog b/ChangeLog index b3e80a60..dac7bd96 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_support.py: + Try to import portage.util before portage_util + 09 Jan 2009; Andrew Gaffney TODO: Add note about metadata_overlay being default in 2.1.6 diff --git a/modules/catalyst_support.py b/modules/catalyst_support.py index 20d8b6f5..12aadc10 100644 --- a/modules/catalyst_support.py +++ b/modules/catalyst_support.py @@ -626,13 +626,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.getconfig(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: