little fix for package.* files
authorgenone <genone@gentoo.org>
Tue, 1 Jun 2004 21:29:34 +0000 (21:29 -0000)
committergenone <genone@gentoo.org>
Tue, 1 Jun 2004 21:29:34 +0000 (21:29 -0000)
svn path=/; revision=110

trunk/src/equery/equery
trunk/src/etcat/etcat
trunk/src/gentoolkit/gentoolkit.py

index 4b40d0a115ccf7d439635c3ee28050ce773521d5..c383449fa184e5ba52de1fabdf175e9dcf04de0c 100755 (executable)
@@ -381,7 +381,7 @@ class CmdDisplayUSEs(Command):
                     except KeyError:
                         desc = ""
 
-                if u in useflags:
+                if u in p.get_settings("USE"):
                     inuse = 1
                 if u in used:
                     inused = 1
index e34856921b5b7cabb6d4fa42bf27da07cdd2113a..840118280ae97acb7e3d777e61d2c17d4495bbb0 100755 (executable)
@@ -375,7 +375,7 @@ def uses(query, matches):
                                except KeyError:
                                        desc = ""
 
-                       if u in useflags: inuse = 1
+                       if u in p.get_settings("USE"): inuse = 1
                        if u in used: inused = 1
                                
                        output.append((inuse, inused, u, desc))
index 31ea74a477fd517715a224635550aa48496499df..9d28b02ff7acbbc194337df4b879142eb5d539fa 100644 (file)
@@ -44,7 +44,8 @@ class Package:
                if not self._scpv:
                        raise Exception("invalid cpv: %s" % cpv)
                self._db = None
-               self._settings = settings.setcpv(self._cpv)
+               settings.setcpv(self._cpv)
+               self._settings = portage.config(clone=settings)
        def get_name(self):
                """Returns base name of package, no category nor version"""
                return self._scpv[1]
@@ -57,6 +58,10 @@ class Package:
        def get_category(self):
                """Returns category of package"""
                return self._scpv[0]
+       def get_settings(self, key):
+               """Returns the value of the given key for this package (useful 
+               for package.* files."""
+               return self._settings[key]
        def get_cpv(self):
                """Returns full Category/Package-Version string"""
                return self._cpv