INN commit: branches/2.5 (doc/pod/news.pod frontends/cnfsheadconf.in)

INN Commit rra at isc.org
Fri Jul 3 21:59:34 UTC 2009


    Date: Friday, July 3, 2009 @ 14:59:33
  Author: iulius
Revision: 8546

When "-c" is not specified, cnfsheadconf exits.  It now displays
the status of all CNFS buffers, as written in its documentation.

Modified:
  branches/2.5/doc/pod/news.pod
  branches/2.5/frontends/cnfsheadconf.in

---------------------------+
 doc/pod/news.pod          |    3 ++-
 frontends/cnfsheadconf.in |   31 ++++++++++++++++++++-----------
 2 files changed, 22 insertions(+), 12 deletions(-)

Modified: doc/pod/news.pod
===================================================================
--- doc/pod/news.pod	2009-07-03 21:56:39 UTC (rev 8545)
+++ doc/pod/news.pod	2009-07-03 21:59:33 UTC (rev 8546)
@@ -57,7 +57,8 @@
 =item *
 
 B<cnfsheadconf> now uses the Perl core module C<Math::BigInt> rather
-than the deprecated F<bigint.pl> library.
+than the deprecated F<bigint.pl> library.  When used without specifying
+a CNFS buffer, it properly displays the status of all CNFS buffers.
 
 =back
 

Modified: frontends/cnfsheadconf.in
===================================================================
--- frontends/cnfsheadconf.in	2009-07-03 21:56:39 UTC (rev 8545)
+++ frontends/cnfsheadconf.in	2009-07-03 21:59:33 UTC (rev 8546)
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#! /usr/bin/perl -w
 # fixscript will replace this line with code to load INN::Config
 
 #  $Id$
@@ -84,12 +84,12 @@
 Summary tool for cycbuff header manipulation
 
 Usage:
-	$0 [-c CYCBUFF] [-h] [-w]
+        $0 [-c CYCBUFF] [-h] [-w]
 
-	If called without args, does a one-time status of all CNFS buffers
-	-c <cycbuff>:  prints out status of cycbuff
-	-w:            change header
-	-h:            This information
+        If called without args, does a one-time status of all CNFS buffers.
+        -c <cycbuff>:  print out status of cycbuff
+        -h:            this information
+        -w:            change header
 _end_
     exit(1);
 }
@@ -198,10 +198,19 @@
 
 START:
 
-if (! $buff{$cycbuff} ) {
-	print STDERR "No buffer definition for buffer $cycbuff ...\n";
-	exit(1);
+# If no cycbuff is specified, we check all of them and exit.
+if (not defined $cycbuff) {
+    foreach (sort keys %buff) {
+      &print_cycbuff_head($buff{$_});
+    }
+    exit(0);
 }
+
+if (not defined $buff{$cycbuff}) {
+    print STDERR "No buffer definition for buffer $cycbuff...\n";
+    exit(1);
+}
+
 &print_cycbuff_head($buff{$cycbuff});
 
 sub make_time {
@@ -273,11 +282,11 @@
     printf(" (%4.1f%%) %3d cycles\n",
            100 * Math::BigFloat->new($free) / Math::BigFloat->new($len),
            $cyclenum);
-    print(" Meta $metaname, order: ");
+    print("  Meta $metaname, order: ");
     printf("%d", $orderinmeta);
     print(", current: $currentbuff");
 
-    print "\n Newest: $nupdate_str, $nago_str ago\n";
+    print "\n  Newest: $nupdate_str, $nago_str ago\n";
 
     if ($opt_w) {
 	print "\nBuffer [$name] => ";




More information about the inn-committers mailing list