INN commit: trunk (6 files)

INN Commit rra at isc.org
Thu Aug 4 21:09:11 UTC 2011


    Date: Thursday, August 4, 2011 @ 14:09:11
  Author: iulius
Revision: 9301

add POD documentation for scanspool

Many thanks to Florian Schlichting for the creation of the POD documentation.

Added:
  trunk/doc/pod/scanspool.pod
Modified:
  trunk/MANIFEST
  trunk/doc/man/	(properties)
  trunk/doc/man/Makefile
  trunk/doc/pod/Makefile
  trunk/frontends/scanspool.in

------------------------+
 MANIFEST               |    2 
 doc/man/Makefile       |    2 
 doc/pod/Makefile       |    4 -
 doc/pod/scanspool.pod  |  178 +++++++++++++++++++++++++++++++++++++++++++++++
 frontends/scanspool.in |   31 +++-----
 5 files changed, 197 insertions(+), 20 deletions(-)

Modified: MANIFEST
===================================================================
--- MANIFEST	2011-08-02 17:37:34 UTC (rev 9300)
+++ MANIFEST	2011-08-04 21:09:11 UTC (rev 9301)
@@ -208,6 +208,7 @@
 doc/man/readers.conf.5                Manpage for readers.conf config file
 doc/man/rnews.1                       Manpage for rnews frontend
 doc/man/scanlogs.8                    Manpage for scanlogs
+doc/man/scanspool.8                   Manpage for scanspool
 doc/man/send-nntp.8                   Manpage for send-nntp and send-ihave
 doc/man/send-uucp.8                   Manpage for send-uucp
 doc/man/sendinpaths.8                 Manpage for sendinpaths
@@ -309,6 +310,7 @@
 doc/pod/readme.pod                    Master file for README
 doc/pod/rnews.pod                     Master file for rnews.1
 doc/pod/scanlogs.pod                  Master file for scanlogs.8
+doc/pod/scanspool.pod                 Master file for scanspool.8
 doc/pod/sendinpaths.pod               Master file for sendinpaths.8
 doc/pod/shlock.pod                    Master file for shlock.1
 doc/pod/simpleftp.pod                 Master file for simpleftp.1


Property changes on: trunk/doc/man
___________________________________________________________________
Modified: svn:ignore
   - active.5
active.times.5
actsync.8
archive.8
auth_krb5.8
batcher.8
buffchan.8
buffindexed.conf.5
ckpasswd.8
cnfsheadconf.8
cnfsstat.8
control.ctl.5
controlchan.8
convdate.1
ctlinnd.8
cvtbatch.8
cycbuff.conf.5
distrib.pats.5
distributions.5
docheckgroups.8
domain.8
expire.ctl.5
expire.8
expireover.8
expirerm.8
fastrm.1
getlist.1
grephistory.1
ident.8
incoming.conf.5
inews.1
inn.conf.5
INN__Config.3pm
innbind.8
inncheck.8
innconfval.1
innd.8
inndf.8
innfeed.conf.5
innfeed.8
innmail.1
innupgrade.8
innxmit.8
libauth.3
libinnhist.3
libstorage.3
list.3
mailpost.8
makedbz.8
makehistory.8
mod-active.8
moderators.5
motd.news.5
newsfeeds.5
news.daily.8
news2mail.8
newslog.5
newsgroups.5
ninpaths.8
nnrpd.8
nntpsend.8
nntpsend.ctl.5
ovdb.5
ovdb_init.8
ovdb_monitor.8
ovdb_server.8
ovdb_stat.8
overchan.8
passwd.nntp.5
perl-nocem.8
pgpverify.1
prunehistory.8
pullnews.1
qio.3
radius.8
radius.conf.5
rc.news.8
readers.conf.5
rnews.1
sasl.conf.5
scanlogs.8
send-uucp.8
sendinpaths.8
shlock.1
simpleftp.1
sm.1
storage.conf.5
subscriptions.5
tally.control.8
tdx-util.8
tinyleaf.8
tst.3
uwildmat.3

   + active.5
active.times.5
actsync.8
archive.8
auth_krb5.8
batcher.8
buffchan.8
buffindexed.conf.5
ckpasswd.8
cnfsheadconf.8
cnfsstat.8
control.ctl.5
controlchan.8
convdate.1
ctlinnd.8
cvtbatch.8
cycbuff.conf.5
distrib.pats.5
distributions.5
docheckgroups.8
domain.8
expire.ctl.5
expire.8
expireover.8
expirerm.8
fastrm.1
getlist.1
grephistory.1
ident.8
incoming.conf.5
inews.1
inn.conf.5
INN__Config.3pm
innbind.8
inncheck.8
innconfval.1
innd.8
inndf.8
innfeed.conf.5
innfeed.8
innmail.1
innupgrade.8
innxmit.8
libauth.3
libinnhist.3
libstorage.3
list.3
mailpost.8
makedbz.8
makehistory.8
mod-active.8
moderators.5
motd.news.5
newsfeeds.5
news.daily.8
news2mail.8
newslog.5
newsgroups.5
ninpaths.8
nnrpd.8
nntpsend.8
nntpsend.ctl.5
ovdb.5
ovdb_init.8
ovdb_monitor.8
ovdb_server.8
ovdb_stat.8
overchan.8
passwd.nntp.5
perl-nocem.8
pgpverify.1
prunehistory.8
pullnews.1
qio.3
radius.8
radius.conf.5
rc.news.8
readers.conf.5
rnews.1
sasl.conf.5
scanlogs.8
scanspool.8
send-uucp.8
sendinpaths.8
shlock.1
simpleftp.1
sm.1
storage.conf.5
subscriptions.5
tally.control.8
tdx-util.8
tinyleaf.8
tst.3
uwildmat.3


Modified: doc/man/Makefile
===================================================================
--- doc/man/Makefile	2011-08-02 17:37:34 UTC (rev 9300)
+++ doc/man/Makefile	2011-08-04 21:09:11 UTC (rev 9301)
@@ -29,7 +29,7 @@
 	makehistory.8 mod-active.8 news.daily.8 news2mail.8 ninpaths.8 \
 	nnrpd.8 nntpsend.8 ovdb_init.8 ovdb_monitor.8 ovdb_server.8 \
 	ovdb_stat.8 overchan.8 perl-nocem.8 prunehistory.8 radius.8 \
-	rc.news.8 scanlogs.8 send-nntp.8 send-uucp.8 sendinpaths.8 \
+	rc.news.8 scanlogs.8 scanspool.8 send-nntp.8 send-uucp.8 sendinpaths.8 \
 	tally.control.8 tdx-util.8 tinyleaf.8 writelog.8
 
 all:

Modified: doc/pod/Makefile
===================================================================
--- doc/pod/Makefile	2011-08-02 17:37:34 UTC (rev 9300)
+++ doc/pod/Makefile	2011-08-04 21:09:11 UTC (rev 9301)
@@ -43,7 +43,8 @@
 	../man/ovdb_init.8 ../man/ovdb_monitor.8 ../man/ovdb_server.8 \
 	../man/ovdb_stat.8 ../man/overchan.8 \
         ../man/prunehistory.8 ../man/radius.8 \
-	../man/rc.news.8 ../man/scanlogs.8 ../man/sendinpaths.8 \
+	../man/rc.news.8 ../man/scanlogs.8 ../man/scanspool.8 \
+	../man/sendinpaths.8 \
 	../man/tally.control.8 ../man/tdx-util.8 \
 	../man/tinyleaf.8
 
@@ -151,6 +152,7 @@
 ../man/radius.8:	radius.pod		; $(POD2MAN) -s 8 $? > $@
 ../man/rc.news.8:	rc.news.pod		; $(POD2MAN) -s 8 $? > $@
 ../man/scanlogs.8:	scanlogs.pod		; $(POD2MAN) -s 8 $? > $@
+../man/scanspool.8:	scanspool.pod		; $(POD2MAN) -s 8 $? > $@
 ../man/sendinpaths.8:	sendinpaths.pod		; $(POD2MAN) -s 8 $? > $@
 ../man/tally.control.8:	tally.control.pod	; $(POD2MAN) -s 8 $? > $@
 ../man/tdx-util.8:	tdx-util.pod		; $(POD2MAN) -s 8 $? > $@

Added: doc/pod/scanspool.pod
===================================================================
--- doc/pod/scanspool.pod	                        (rev 0)
+++ doc/pod/scanspool.pod	2011-08-04 21:09:11 UTC (rev 9301)
@@ -0,0 +1,178 @@
+=head1 NAME
+
+scanspool - Perform a sanity scan over all articles in news spool
+
+=head1 SYNOPSIS
+
+B<scanspool> [B<-cnv>] [B<-a> I<active-file>] [B<-s> I<spool-dir>]
+
+=head1 DESCRIPTION
+
+B<scanspool> is a Perl script for use with a I<tradspool> article spool.
+It will scan the F<active> file as well as all articles in the spool and
+report on the errors it encounters.  As this may take a while, using the
+B<-v> switch is recommended to see how far the program has progressed.
+
+First, B<scanspool> scans the F<active> file, noting problems such as:
+
+=over 4
+
+=item *
+
+malformed lines;
+
+=item *
+
+newsgroups aliased to a non-existent newsgroup;
+
+=item *
+
+newsgroups aliased to a newsgroup that is also aliased.
+
+=back
+
+Then it will examine all articles under your news spool directory,
+complaining about articles that:
+
+=over 4
+
+=item *
+
+have a basename that starts with a leading 0;
+
+=item *
+
+have a basename that is out of range according to the F<active> file;
+
+=item *
+
+do not contain a Newsgroups: header line;
+
+=item *
+
+are all header and no text;
+
+=item *
+
+are in a directory for which there is no newsgroup in the F<active> file;
+
+=item *
+
+are in a newsgroup to which they do not belong.
+
+=back
+
+B<scanspool> understands aliased newsgroups.  Thus, if an article is posted
+to foo.old.name that is aliased to foo.bar, it will be expected to
+be found under foo.bar and not foo.old.name.
+
+Articles posted to a newsgroup of status C<j> or C<x> (the fourth field
+of the F<active> file) will be expected to show up under the I<junk> group.
+
+B<scanspool> assumes that the path of a valid newsgroup's directory
+from the root of the spool tree will not contain any C<.> character.
+Thus, directories such as F<out.going>, F<tmp.dir>, F<in.coming> and
+F<news.archive> will not be searched.  This program also assumes that
+article basenames contain only decimal digits.  Last, files under
+the top level directory F<lost+found> are not scanned.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-a> I<active-file>
+
+The F<active> file to use; I<pathdb>/active is the default.
+
+=item B<-c>
+
+Only check article filenames.  B<scanspool> will therefore not actually
+scan the Newsgroups: header field of the articles.
+
+=item B<-n>
+
+Don't throttle B<innd> while scanning.
+
+=item B<-s> I<spool-dir>
+
+The root of the spool tree; I<patharticles> is the default.
+
+=item B<-v>
+
+Setting this flag enables a verbose mode.  B<scanspool> will then print
+which newsgroup is currently worked upon.  It will list all the articles
+found in non-F<active> directories (that is to say articles sorted into
+groups no longer present in the F<active> file), rather than just printing
+the group once.
+
+=back
+
+=head1 DIAGNOSTICS
+
+The output of B<scanspool> will start with one of the following forms:
+
+=over 4
+
+=item C<FATAL:> (to stderr)
+
+Fatal or internal error.
+
+=item C<WARN:> (to stderr)
+
+F<active> or article format problem, newsgroup alias problem, find(1)
+error, article open error.
+
+=item C<path/123:> (to stdout)
+
+Issues such as:
+
+=over 4
+
+=item *
+
+basename starts with 0;
+
+=item *
+
+article number out of range;
+
+=item *
+
+article in the wrong directory;
+
+=item *
+
+article in a directory not related to an F<active> non-aliased newsgroup.
+
+=back
+
+=item C<\t ...> (to stdout)
+
+Verbose messages start with a tab.
+
+=back
+
+=head1 BUGS
+
+B<scanspool> is unable to detect and properly deal with spool formats
+other than tradspool.  However, if the files that store your articles
+are named other than just all-digits, they will simply be skipped
+(and your F<active> is still checked).
+
+B<scanspool> only considers the first line of the Newsgroups: header field.
+Continuation lines are not taken into account.
+
+=head1 HISTORY
+
+B<scanspool> was written by Landon Curt Noll (chongo was here  /\../\).
+
+This manual page was written by Florian Schlichting, largely based on
+comments in the script.
+
+$Id$
+
+=head1 SEE ALSO
+
+active(5).
+
+=cut


Property changes on: trunk/doc/pod/scanspool.pod
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Modified: frontends/scanspool.in
===================================================================
--- frontends/scanspool.in	2011-08-02 17:37:34 UTC (rev 9300)
+++ frontends/scanspool.in	2011-08-04 21:09:11 UTC (rev 9301)
@@ -11,10 +11,10 @@
 # scanspool - Perform a big scan over all articles in <patharticles>
 #
 # usage:
-#    scanspool [-a active_file] [-s spool_dir] [-v] [-c] [-n]
+#    scanspool [-cnv] [-a active-file] [-s spool-dir]
 #
-#    -a active_file	active file to use (default <pathdb>/active)
-#    -s spool_dir	spool tree (default <patharticles>)
+#    -a active-file	active file to use (default <pathdb>/active)
+#    -s spool-dir	spool tree (default <patharticles>)
 #    -v 		verbose mode
 #			verbose messages begin with a tab
 #			show articles found in non-active directories
@@ -28,7 +28,7 @@
 #
 #	malformed line
 #	group aliased to a non-existent group
-#	group aliased to a group tat is also aliased
+#	group aliased to a group that is also aliased
 #
 # Then it will examine all articles under your news spool directory,
 # looking for articles that:
@@ -41,7 +41,7 @@
 #	article that is in a group to which it does not belong
 #
 # Scanspool understands aliased groups.  Thus, if an article is posted
-# to foo.old.name that is aliases to foo.bar, it will be expected to
+# to foo.old.name that is aliased to foo.bar, it will be expected to
 # be found under foo.bar and not foo.old.name.
 #
 # Any group that is of type 'j' or 'x' (4th field of the active file)
@@ -158,7 +158,6 @@
     my $low;            # low article number
     my $high;           # high article number
     my $type;           # type of newsgroup (4th active field)
-    my $dir;            # directory path of group from $spool
     my $alias;          # realname of an aliased group
     my $linenum;        # active file line number
 
@@ -184,7 +183,7 @@
 
 	# watch for duplicate entries
 	if (defined $realgname{$name}) {
-	    problem("WARNING: ignoring dup group: $name, at line $linenum");
+	    problem("WARNING: ignoring duplicate group: $name, at active line $linenum");
 	    next;
 	}
 
@@ -197,15 +196,11 @@
 
 	# determine the directory and real group name
 	if ($type eq "j" || $type eq "x") {
-	    $dir = "junk";
 	    $alias = $name;
 	} elsif ($type =~ /^=(.+)/o) {
 	    $alias = $1;
-	    ($dir = $alias) =~ s#\.#/#go;
 	    $gname2type{$name} = "=";	# rename type to be just =
 	} else {
-	    $dir = $name;
-	    $dir =~ s#\.#/#go;
 	    $alias = $name;
 	}
 	$realgname{$name} = $alias;
@@ -258,7 +253,7 @@
 #
 # Print a message to stderr.  The message has the program name prepended
 # to it.  Parameters are space separated.  A final newline is appended
-# to it.  This function exists with the code of exitval.
+# to it.  This function exits with the code of exitval.
 #
 # usage:
 #	fatal(exitval, arg, arg2, ...)
@@ -267,9 +262,9 @@
 {
     my ($exitval, @args) = @_;
 
-    # firewall
+    # firewall, in case we're called with less than two arguments
     if ($#_ < 1) {
-	print STDERR "FATAL: fatal called with only ", $#_-1, " arguments\n";
+	print STDERR "FATAL: fatal() called with only ", $#_+1, " arguments\n";
 	if ($#_ < 0) {
 	    $exitval = -1;
 	}
@@ -277,7 +272,7 @@
 
     # print the error message
     my $line = join(" ", @args);
-    print STDERR "$prog: ", $line, "\n";
+    print STDERR "$prog: $line\n";
 
     # unthrottle innd unless -n
     #
@@ -331,16 +326,16 @@
     while ($filename = <$FINDFILE>) {
 
 	# if the line contains find:, assume it is a find error and print it
-	chop($filename);
+	chomp($filename);
 	if ($filename =~ /find:\s/o) {
 	    problem("WARNING:", $filename);
 	    next;
 	}
 
-	# remove the \n and ./ that find put in our path
+	# remove the ./ that find put in our path
 	$filename =~ s#^\./##o;
 
-	# skip is this path has a . in it (beyond a leading ./)
+	# skip if this path has a . in it (beyond a leading ./)
 	next if ($filename =~ /\./o);
 
 	# skip if lost+found




More information about the inn-committers mailing list