Many minor bugfixes to uses
authorkarltk <karltk@gentoo.org>
Mon, 27 Sep 2004 14:25:59 +0000 (14:25 -0000)
committerkarltk <karltk@gentoo.org>
Mon, 27 Sep 2004 14:25:59 +0000 (14:25 -0000)
svn path=/; revision=142

trunk/src/equery/ChangeLog
trunk/src/equery/equery

index 1d408104fe05c1eeb826e553b11328dd9499aae1..f727099e35db7a52622671bf66cdff0dd41a1e5c 100644 (file)
@@ -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 <karltk@gentoo.org>
        * Added man page rewrites by Katerina Barone-Adesi <katerinab@gmail.com>,
index 2643c2ed495a0c4accead7a05dbcc797618095c4..a5fa8d52091283ce3e5885a37d70498900e3ab18 100755 (executable)
@@ -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, " : <unknown>")
-                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"]: