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

index b2d9c65ac435600bd22be4e54c1026022b979d4c..74fdc51bc13d95c3d0f45b19836fd0893966a426 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/util.py:
+  Try to import portage.util before portage_util
+
   13 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
   modules/catalyst/config.py:
   Add validate_values() and compare_key() functions to Spec class
index ccc898222ba694c9f9171151db5932a4a6b0e346..e949d45b1c125f5d8c00f0e7d0de63f1fb984c08 100644 (file)
@@ -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: