[SCM] Debian packaging for apache2 branch, next, updated. debian/2.4.2-2-33-gb37559e

Arno Töll arno at debian.org
Sun Jul 29 20:47:25 UTC 2012


The following commit has been merged in the next branch:
commit b37559ec92f0ad2eb9b43b6c2b91179d3a29bd71
Author: Arno Töll <arno at debian.org>
Date:   Sun Jul 29 22:47:20 2012 +0200

    Implement -q (quiet) option to a2query

diff --git a/debian/a2query.in b/debian/a2query.in
index 38f43e1..4bb727a 100755
--- a/debian/a2query.in
+++ b/debian/a2query.in
@@ -58,6 +58,7 @@ our @STATES = ("maint", "admin");
 
 our $MPM = "invalid";
 our $CONFIG_DIR = "/etc/apache2";
+our $QUIET = 0;
 
 # time to introduce more _exit_ values
 our $E_OK = '0';
@@ -147,12 +148,22 @@ This manual and L<a2query> was written by Arno Toell <debian at toell.net>.
 
 =cut
 
+sub output
+{
+	print @_ unless $QUIET;
+}
+
+sub warning
+{
+	print STDERR @_ unless $QUIET;
+}
+
 sub fail
 {
 	die('usage: fail($reason, $retval)') if @_ != 2;
 	my $reason = shift;
 	my $retval = shift;
-	print STDERR "$reason\n";
+	warning "$reason\n";
 	exit $retval;
 }
 
@@ -290,7 +301,7 @@ sub query_state
 		{
 			$state = "unknown";
 		}
-		print("$module (enabled by $verbose_state{$state})\n");
+		output("$module (enabled by $verbose_state{$state})\n");
 		$matches++;
 	}
 	if (!$matches)
@@ -319,8 +330,15 @@ load_modules();
 
 my %opts;
 my $help = 1;
-getopt('m:s:c:havMd', \%opts);
+getopts('m:s:c:havMdq', \%opts);
+#foreach my $key (keys %opts) { print("$key=$opts{$key}\n");}
 
+push @HELP, ["q", "suppress any output. Useful for invokation from scripts"];
+if (exists $opts{'q'})
+{
+	--$help;
+	$QUIET=1;
+}
 
 push @HELP, ["m [MODULE]", "checks whether the module MODULE is enabled, lists all enabled modules if no argument was given"];
 if (exists $opts{'m'})
@@ -351,7 +369,7 @@ push @HELP, ["a", "returns the current Apache 2 module magic version"];
 if (exists $opts{'a'})
 {
 	--$help;
-	print("$API\n");
+	output("$API\n");
 }
 
 
@@ -359,21 +377,21 @@ push @HELP, ["v", "returns the current Apache 2 version"];
 if (exists $opts{'v'})
 {
 	--$help;
-	print("$SERVER_VERSION\n");
+	output("$SERVER_VERSION\n");
 }
 
 push @HELP, ["M", "returns the enabled Apache 2 MPM"];
 if (exists $opts{'M'})
 {
 	--$help;
-	print("$MPM\n");
+	output("$MPM\n");
 }
 
 push @HELP, ["d", "returns the Apache 2 module directory"];
 if (exists $opts{'d'})
 {
 	--$help;
-	print("$MODULE_DIR\n");
+	output("$MODULE_DIR\n");
 }
 
 push @HELP, ["h", "display this help"];
diff --git a/debian/changelog b/debian/changelog
index 72a389d..5e05ae6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,8 +21,9 @@ apache2 (2.4.2-3) UNRELEASED; urgency=low
   * Properly check return code of a2query in the apache2_invoke library
     function. This caused reverse dependencies to fail for newly installed
     modules previously.
+  * Implement -q (quiet) option for a2query (Closes: #681541).
 
- -- Arno Töll <arno at debian.org>  Sun, 29 Jul 2012 21:57:38 +0200
+ -- Arno Töll <arno at debian.org>  Sun, 29 Jul 2012 22:44:58 +0200
 
 apache2 (2.4.2-2) experimental; urgency=low
 

-- 
Debian packaging for apache2



More information about the Pkg-apache-commits mailing list