[Debtags-commits] [svn] r1028 - in debtags/trunk: debian src

Enrico Zini enrico at costa.debian.org
Sun Jul 31 13:54:45 UTC 2005


Author: enrico
Date: Sun Jul 31 13:54:37 2005
New Revision: 1028

Modified:
   debtags/trunk/debian/changelog
   debtags/trunk/src/debtags.cc
Log:
Don't return the program exit value in outputGrepped, when the rest of the code assumes it returns the number of matches.
Don't invoke apt-get install when there are 0 packages to be installed.


Modified: debtags/trunk/debian/changelog
==============================================================================
--- debtags/trunk/debian/changelog	(original)
+++ debtags/trunk/debian/changelog	Sun Jul 31 13:54:37 2005
@@ -7,8 +7,9 @@
     Closes: #319655.
   * Notify invalid tags passed to 'tag add' as errors, not as verbose output.
     Closes: #319656.
+  * Correctly return exit code when grepping.  Closes: #319756.
 
- -- Enrico Zini <enrico at debian.org>  Sun, 31 Jul 2005 15:48:41 +0200
+ -- Enrico Zini <enrico at debian.org>  Sun, 31 Jul 2005 15:53:16 +0200
 
 debtags (1.1) unstable; urgency=low
 

Modified: debtags/trunk/src/debtags.cc
==============================================================================
--- debtags/trunk/src/debtags.cc	(original)
+++ debtags/trunk/src/debtags.cc	Sun Jul 31 13:54:37 2005
@@ -890,7 +890,7 @@
 	//debtags.tagDB().outputPatched(tostrings);
 	debtags.tagDB().outputPatched(filters);
 
-	return filter.countMatched() > 0 ? 0 : 1;
+	return filter.countMatched();
 }
 
 class MaintCollector : public PackageConsumer
@@ -1074,7 +1074,7 @@
 		opts.add("invert-match", 'v', "invert-match", "invert the sense of matching, to select non-matching lines");
 		opts.add("quiet", 'q', "quiet", "do not write anything to standard output, but exit with 0 if any match is found");
 		
-		opts.add("verbose", 0, "verbose", "enable verbose output");
+		opts.add("verbose", 'V', "verbose", "enable verbose output");
 		opts.add("debug", 0, "debug", "enable debugging output (including verbose output)");
 
 		opts.addCommand("update", (int)UPDATE);
@@ -1175,7 +1175,8 @@
 
 				ItemCollector selection;
 
-				outputGrepped(debtags, expression, opts.get("invert-match").defined(), selection);
+				if (!outputGrepped(debtags, expression, opts.get("invert-match").defined(), selection))
+					return 1;
 
 				const char* parms[selection.size() + 1];
 				int i = 0;



More information about the Debtags-commits mailing list