INN commit: trunk/backends (mod-active.in)
INN Commit
Russ_Allbery at isc.org
Tue Sep 4 17:40:45 UTC 2007
Date: Tuesday, September 4, 2007 @ 10:40:44
Author: iulius
Revision: 7669
Do not pause the news server when there is no changes to do.
Add a count (and display it) of the number of changes to do.
Modified:
trunk/backends/mod-active.in
---------------+
mod-active.in | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
Modified: mod-active.in
===================================================================
--- mod-active.in 2007-09-04 10:36:56 UTC (rev 7668)
+++ mod-active.in 2007-09-04 17:40:44 UTC (rev 7669)
@@ -14,7 +14,8 @@
$newact = "$oldact.new$$"; # temporary name for new active file
$actime = $inn::activetimes; # active.times file
$pausemsg = 'batch active update, ok'; # message to be used for pausing?
-$diff_flags = ''; # Flags for diff(1); default chosen if null.
+$diff_flags = ''; # flags for diff(1); default chosen if null
+$changes = 0; # number of changes to do
$0 =~ s#^.*/##;
@@ -47,10 +48,13 @@
while (<>) {
if (/^\s*\S*ctlinnd newgroup (\S+) (\S)/) {
$toadd{$1} = $2;
+ $changes += 1;
} elsif (/^\s*\S*ctlinnd rmgroup (\S+)/) {
$eval .= " next if \$group eq '$1';\n";
+ $changes += 1;
} elsif (/^\s*\S*ctlinnd changegroup (\S+) (\S)/) {
$eval .= " s/ \\S+\$/ $2/ if \$group eq '$1';\n";
+ $changes += 1;
}
}
@@ -60,6 +64,13 @@
$eval .= " }\n";
$eval .= "}\n";
+if ($changes == 0) {
+ print "active file not changed\n" if $debug;
+ exit 0;
+}
+
+print "$changes change(s) to do\n" if $debug;
+
&ctlinnd("pause $pausemsg");
open(OLDACT, "< $oldact") || die "$0: open $oldact: $!\n";
More information about the inn-committers
mailing list