For bug #159638, fix the UnboundLocalError in vartree.getprovide().
authorZac Medico <zmedico@gentoo.org>
Tue, 2 Jan 2007 01:30:24 +0000 (01:30 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 2 Jan 2007 01:30:24 +0000 (01:30 -0000)
svn path=/main/trunk/; revision=5440

pym/portage.py

index 82cafc643921a208eda436a51a56c8a7ab2cb133..dd22b24408f65a392804be9b9f58d211111039bd 100644 (file)
@@ -5264,6 +5264,7 @@ class vartree(object):
 
        def get_provide(self,mycpv):
                myprovides=[]
+               mylines = None
                try:
                        mylines, myuse = self.dbapi.aux_get(mycpv, ["PROVIDE","USE"])
                        if mylines:
@@ -5278,11 +5279,13 @@ class vartree(object):
                except SystemExit, e:
                        raise
                except Exception, e:
-                       print
-                       print "Check " + self.root+VDB_PATH+"/"+mycpv+"/PROVIDE and USE."
-                       print "Possibly Invalid: " + str(mylines)
-                       print "Exception: "+str(e)
-                       print
+                       mydir = os.path.join(self.root, VDB_PATH, mycpv)
+                       writemsg("\nParse Error reading PROVIDE and USE in '%s'\n" % mydir,
+                               noiselevel=-1)
+                       if mylines:
+                               writemsg("Possibly Invalid: '%s'\n" % str(mylines),
+                                       noiselevel=-1)
+                       writemsg("Exception: %s\n\n" % str(e))
                        return []
 
        def get_all_provides(self):