forgot V in short option list
authorgenone <genone@gentoo.org>
Sat, 30 Apr 2005 15:47:50 +0000 (15:47 -0000)
committergenone <genone@gentoo.org>
Sat, 30 Apr 2005 15:47:50 +0000 (15:47 -0000)
svn path=/; revision=212

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

index f067f5e05a20a642eb8228ac6b24e4024019ac2e..7cb96d770a838c73d65d4cbae33bb6a00a7eea9d 100644 (file)
@@ -1,3 +1,6 @@
+2005-04-30 Marius Mauch <genone@gentoo.org>
+       * glsa-check: add V to short option list so it actually works
+
 2005-04-26 Marius Mauch <genone@gentoo.org>
        * gentoolkit: fix broken Makefile
        * gentoolkit: add some sticky tape to get the stupid thing working again
index 102e5081c714eeda904e45092d28b9d93e61d808..cccf4d7ac043f11815fdc6e335d0873b00e5b60c 100755 (executable)
@@ -273,7 +273,8 @@ class CmdListBelongs(Command):
                self.default_opts = {
                        "category": "*",
                        "fullRegex": 0,
-                       "earlyOut": 0
+                       "earlyOut": 0,
+                       "nameOnly": 0
                        }
 
        def parseArgs(self, args):
@@ -300,6 +301,8 @@ class CmdListBelongs(Command):
                                opts["earlyOut"] = 1
                        elif x in ["-f", "--full-regex"]:
                                opts["fullRegex"] = 1
+                       elif x in ["-n", "--name-only"]:
+                               opts["nameOnly"] = 1
                        else:
                                query.append(x)
 
@@ -344,7 +347,11 @@ class CmdListBelongs(Command):
                        if not cnt: return
                        for file in cnt.keys():
                                if rx.search(file) and (opts["category"] == "*" or portage.catpkgsplit(pkg)[0] == opts["category"]):
-                                       print pkg
+                                       if opts["nameOnly"]:
+                                               x = portage.catpkgsplit(pkg)
+                                               print x[0]+"/"+x[1]
+                                       else:
+                                               print pkg
                                        return
 
                class DummyExp:
@@ -357,7 +364,12 @@ class CmdListBelongs(Command):
                        if not cnt: return
                        for file in cnt.keys():
                                if rx.search(file) and (opts["category"] == "*" or portage.catpkgsplit(pkg)[0] == opts["category"]):
-                                       s = pkg + " (" + pp.path(fileAsStr(file, cnt[file])) + ")"
+                                       if opts["nameOnly"]:
+                                               x = portage.catpkgsplit(pkg)
+                                               s = x[0]+"/"+x[1]
+                                       else:
+                                               s = pkg
+                                       s += " (" + pp.path(fileAsStr(file, cnt[file])) + ")"
                                        print_info(0, s)
                                        if opts["earlyOut"]:
                                                raise DummyExp
@@ -385,7 +397,8 @@ class CmdListBelongs(Command):
                                        "  " + pp.localoption("-c, --category cat") + " - only search in category " + \
                                                pp.pkgquery("cat") + "\n" + \
                                        "  " + pp.localoption("-f, --full-regex") + "   - supplied query is a regex\n" + \
-                                       "  " + pp.localoption("-e, --earlyout") + "      - stop when first match is found\n"
+                                       "  " + pp.localoption("-e, --earlyout") + "         - stop when first match is found\n" + \
+                                       "  " + pp.localoption("-n, --name-only") + "    - don't print the version."
 
 class CmdDisplayUSEs(Command):
        """Advanced report of a package's USE flags"""
index 739cc756d80895983f256e9b5547d9a78bba757a..a922a516b92208fff5b56c4068a46fbc8a5ca1d6 100644 (file)
@@ -38,7 +38,7 @@ sys.stderr.write("before using this tool AND before reporting a bug.\n\n")
 args = []
 params = []
 try:
-       args, params = getopt(sys.argv[1:], "dplfchinvt", \
+       args, params = getopt(sys.argv[1:], "dplfchinvVt", \
                ["dump", "print", "list", "pretend", "fix", "inject", "help", "info", "version", "test", "nocolor"])
        args = [a for a,b in args]