minor bugfixes for glsa-check and equery
authorgenone <genone@gentoo.org>
Wed, 8 Dec 2004 09:55:21 +0000 (09:55 -0000)
committergenone <genone@gentoo.org>
Wed, 8 Dec 2004 09:55:21 +0000 (09:55 -0000)
svn path=/; revision=177

trunk/ChangeLog
trunk/src/equery/equery
trunk/src/glsa-check/glsa.py

index fa9ca84295fdb972d2adc89a1ddc10aebf048d4a..644b4cc8e44a9607b7da4119e4e0bc57dd248f79 100644 (file)
@@ -1,3 +1,7 @@
+2004-12-08 Marius Mauch <genone@gentoo.org>
+       * equery: implemented the --category option
+       * glsa-check: fixed the bug where it wanted to unnecessary merge masked packages
+       
 2004-11-29 Karl Trygve Kalleberg <karltk@gentoo.org>
        * branched v0-3-0: major rework in equery is in progess. the main
        branch is reserved for minor and incremental fixups.
index bd7139b3a3c00adfd6bd384a4d1caa96ffc1c030..079c15bb9843b4ad4290971bdd4b03cbeed77919 100755 (executable)
@@ -343,7 +343,7 @@ class CmdListBelongs(Command):
                        #cnt = pkg.get_contents()
                        if not cnt: return
                        for file in cnt.keys():
-                               if rx.search(file):
+                               if rx.search(file) and (opts["category"] == "*" or portage.catpkgsplit(pkg)[0] == opts["category"]):
                                        print pkg
                                        return
 
@@ -356,7 +356,7 @@ class CmdListBelongs(Command):
                        #cnt = pkg.get_contents()
                        if not cnt: return
                        for file in cnt.keys():
-                               if rx.search(file):
+                               if rx.search(file) and (opts["category"] == "*" or portage.catpkgsplit(pkg)[0] == opts["category"]):
                                        s = pkg + " (" + pp.path(fileAsStr(file, cnt[file])) + ")"
                                        print_info(0, s)
                                        if opts["earlyOut"]:
@@ -1555,8 +1555,7 @@ if __name__ == "__main__":
                try:
                        cmd.perform(local_opts)
                except KeyError, e:
-                       if e and type(e[0]) == types.ListType and \
-                                       string.find(e[0], "Specific key requires operator") == 0:
+                       if e and string.find(e[0], "Specific key requires an operator") >= 0:
                                print_error("Invalid syntax: missing operator")
                                print_error("If you want only specific versions please use one of")
                                print_error("the following operators as prefix for the package name:")
@@ -1567,18 +1566,18 @@ if __name__ == "__main__":
                        else:
                                print_error("Internal portage error, terminating")
                                if len(e[0]):
-                                       print_error(e)
+                                       print_error(str(e))
                        sys.exit(2)
                except ValueError, e:
                        if e and type(e[0]) == types.ListType:
                                print_error("Ambiguous package name " + pp.emph("\"" + local_opts[0] + "\""))
                                print_error("Please use one of the following long names:")
                                for p in e[0]:
-                                       print_error("   " + p)
+                                       print_error("   " + str(p))
                        else:
                                print_error("Internal portage error, terminating")
                                if len(e[0]):
-                                       print_error(e[0])
+                                       print_error(str(e[0]))
                        sys.exit(2)
                except KeyboardInterrupt:
                        print_info(0, "Interrupted by user, aborting.")
index dc7fd8ec456d57ef7b4a503c0ca83cc8eb99465d..c1420880b1237e01eca7cfd1206732356b6a9337 100644 (file)
@@ -364,7 +364,7 @@ def getMinUpgrade(vulnerableList, unaffectedList):
                for c in mylist:
                        c_pv = portage.catpkgsplit(c)
                        i_pv = portage.catpkgsplit(portage.best(v_installed))
-                       if portage.pkgcmp(c_pv[1:], i_pv[1:]) > 0 and (rValue == None or portage.pkgcmp(c_pv[1:], rValue) < 0):
+                       if portage.pkgcmp(c_pv[1:], i_pv[1:]) > 0 and (rValue == None or portage.pkgcmp(c_pv[1:], portage.catpkgsplit(rValue)[1:]) < 0):
                                rValue = c_pv[0]+"/"+c_pv[1]+"-"+c_pv[2]
                                if c_pv[3] != "r0":             # we don't like -r0 for display
                                        rValue += "-"+c_pv[3]