From 06be4806697b0557b503f5f7a978ce4ee36088cc Mon Sep 17 00:00:00 2001 From: karltk Date: Mon, 27 Sep 2004 14:25:59 +0000 Subject: [PATCH] Many minor bugfixes to uses svn path=/; revision=142 --- trunk/src/equery/ChangeLog | 4 ++++ trunk/src/equery/equery | 24 ++++++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/trunk/src/equery/ChangeLog b/trunk/src/equery/ChangeLog index 1d40810..f727099 100644 --- a/trunk/src/equery/ChangeLog +++ b/trunk/src/equery/ChangeLog @@ -2,6 +2,10 @@ * Added short commands * Fixed copyright dates * Fixed belongs to search only installed packages + * Fixed reporting bug in uses command + * Fixed reference to cppv + * Added import of die + * Added searching header to uses 2004-09-08 Karl Trygve Kalleberg * Added man page rewrites by Katerina Barone-Adesi , diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery index 2643c2e..a5fa8d5 100755 --- a/trunk/src/equery/equery +++ b/trunk/src/equery/equery @@ -9,7 +9,7 @@ __author__ = "Karl Trygve Kalleberg" __email__ = "karltk@gentoo.org" -__version__ = "0.1.2" +__version__ = "0.1.3" __productname__ = "equery" __description__ = "Gentoo Package Query Tool" @@ -22,13 +22,13 @@ import types # portage (output module) and gentoolkit need special path modifications sys.path.insert(0, "/usr/lib/portage/pym") -sys.path.insert(0, "/usr/lib/gentoolkit/pym") +#sys.path.insert(0, "/usr/lib/gentoolkit/pym") import gentoolkit import portage import gentoolkit.pprinter as pp -from gentoolkit.pprinter import print_info, print_error, print_warn +from gentoolkit.pprinter import print_info, print_error, print_warn, die # Auxiliary functions @@ -217,7 +217,6 @@ class CmdListBelongs(Command): def perform(self, args): (query, opts) = self.parseArgs(args) - # Act intelligently on the query try: q = string.join(query, "|") if opts["fullRegex"]: @@ -326,6 +325,9 @@ class CmdDisplayUSEs(Command): def perform(self, args): (query, opts) = self.parseArgs(args) + + if not Config["piping"]: + print_info(3, "[ Searching for packages matching " + pp.pkgquery(query) + "... ]") matches = gentoolkit.find_packages(query, True) @@ -373,14 +375,17 @@ class CmdDisplayUSEs(Command): print_info(3, "[ : Right column (I) - USE flags packages was installed with ]") # Iterate through matches, printing a report for each package - printed_matches = 0 + matches_found = 0 for p in matches: + if not p.is_installed() and opts["installedOnly"]: continue + matches_found += 1 + bestver = p.get_cpv() iuse = p.get_env_var("IUSE") - + if iuse: usevar = iuse.split() else: @@ -442,13 +447,12 @@ class CmdDisplayUSEs(Command): print_info(0, " : " + desc) else: print_info(0, " : ") - printed_matches += 1 else: if not Config["piping"]: - print_info(1, "[ No USE flags found for " + pp.cppv(p.get_cpv()) + "]") + print_info(1, "[ No USE flags found for " + pp.cpv(p.get_cpv()) + "]") if Config["verbosityLevel"] >= 2: - if printed_matches == 0: + if matches_found == 0: s = "" if opts["installedOnly"]: s = "installed " @@ -1203,7 +1207,7 @@ class CmdFindUSEs(Command): if cat == ".*": scat = "all categories" if not Config["piping"]: - print_info(2, "Searching for USE flag " + pp.useflag(query) + " in " + pp.cpv(scat) + " among:") + print_info(2, "[ Searching for USE flag " + pp.useflag(query) + " in " + pp.cpv(scat) + " among: ]") if opts["includeInstalled"]: print_info(1, pp.section(" *") + " installed packages") if opts["includePortTree"]: -- 2.26.2