Try to import portage.util before portage_util
authorAndrew Gaffney <agaffney@gentoo.org>
Tue, 13 Jan 2009 13:20:33 +0000 (07:20 -0600)
committerAndrew Gaffney <agaffney@gentoo.org>
Tue, 13 Jan 2009 13:20:33 +0000 (07:20 -0600)
ChangeLog
modules/catalyst_support.py

index b3e80a608db88a5a61d30909c0fc68a6c1606a78..dac7bd96a2c121f7dd56511287109f9a72826cbf 100644 (file)
--- 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 <agaffney@gentoo.org>
+  modules/catalyst_support.py:
+  Try to import portage.util before portage_util
+
   09 Jan 2009; Andrew Gaffney <agaffney@gentoo.org> TODO:
   Add note about metadata_overlay being default in 2.1.6
 
index 20d8b6f5545a146c86d2c511c560e0ab7b5dbfd5..12aadc10326c08d7626001e17a6a2f03b22f61c5 100644 (file)
@@ -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: