From 9009b51aa6d0a1a2f382ec8894bd2fa0207d13de Mon Sep 17 00:00:00 2001 From: genone Date: Tue, 1 Jun 2004 21:29:34 +0000 Subject: [PATCH] little fix for package.* files svn path=/; revision=110 --- trunk/src/equery/equery | 2 +- trunk/src/etcat/etcat | 2 +- trunk/src/gentoolkit/gentoolkit.py | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery index 4b40d0a..c383449 100755 --- a/trunk/src/equery/equery +++ b/trunk/src/equery/equery @@ -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 diff --git a/trunk/src/etcat/etcat b/trunk/src/etcat/etcat index e348569..8401182 100755 --- a/trunk/src/etcat/etcat +++ b/trunk/src/etcat/etcat @@ -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)) diff --git a/trunk/src/gentoolkit/gentoolkit.py b/trunk/src/gentoolkit/gentoolkit.py index 31ea74a..9d28b02 100644 --- a/trunk/src/gentoolkit/gentoolkit.py +++ b/trunk/src/gentoolkit/gentoolkit.py @@ -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 -- 2.26.2