INN commit: trunk (10 files)
INN Commit
Russ_Allbery at isc.org
Wed Sep 5 14:01:32 UTC 2007
Date: Wednesday, September 5, 2007 @ 07:01:32
Author: iulius
Revision: 7670
First step towards a better handling of checkgroups: an improved
version of docheckgroups. Hopefully it is backward compatible.
* The -u flag permits to update the newsgroups file (with the
proper number of tabulations and an alphabetical sort),
removing obsolete descriptions and adding new ones.
* A second argument on command-line permits to specify which
newsgroups should not be checked (it is pretty useful and
will be used to handle drops in control.ctl as for checkgroups
processing).
* Detabify the script, use innshellvars' "${SORT}" instead of
"sort" and add more comments inside the script.
* The output is displayed better (more spaces and rewording)
and mentions the possibility to use the -u flag and mod-active.
* Fix a bug for moderated groups (" (Moderated)" should be
searched, and not "(Moderated)").
* A documentation (I hope enough detailed) for docheckgroups.
It was greatly missing.
* A sample file for localgroups (with documentation).
Added:
trunk/doc/pod/docheckgroups.pod
trunk/samples/localgroups
Modified:
trunk/MANIFEST
trunk/control/docheckgroups.in
trunk/doc/man/ (properties)
trunk/doc/man/Makefile
trunk/doc/pod/Makefile
trunk/site/ (properties)
trunk/site/Makefile
trunk/support/mkmanifest
---------------------------+
MANIFEST | 3
control/docheckgroups.in | 196 ++++++++++++++++++++++++++------------------
doc/man/Makefile | 3
doc/pod/Makefile | 4
doc/pod/docheckgroups.pod | 195 +++++++++++++++++++++++++++++++++++++++++++
samples/localgroups | 16 +++
site/Makefile | 6 -
support/mkmanifest | 1
8 files changed, 341 insertions(+), 83 deletions(-)
Modified: MANIFEST
===================================================================
--- MANIFEST 2007-09-04 17:40:44 UTC (rev 7669)
+++ MANIFEST 2007-09-05 14:01:32 UTC (rev 7670)
@@ -161,6 +161,7 @@
doc/man/cycbuff.conf.5 Manpage for cycbuff.conf config file
doc/man/dbz.3 Manpage for DBZ database interface
doc/man/distrib.pats.5 Manpage for distrib.pats config file
+doc/man/docheckgroups.8 Manpage for docheckgroups
doc/man/domain.8 Manpage for domain resolver
doc/man/expire.8 Manpage for expire
doc/man/expire.ctl.5 Manpage for expire.ctl config file
@@ -265,6 +266,7 @@
doc/pod/ctlinnd.pod Master file for ctlinnd.8
doc/pod/cycbuff.conf.pod Master file for cycbuff.conf.5
doc/pod/distrib.pats.pod Master file for distrib.pats.5
+doc/pod/docheckgroups.pod Master file for docheckgroups.8
doc/pod/domain.pod Master file for domain.8
doc/pod/expire.ctl.pod Master file for expire.ctl.5
doc/pod/expireover.pod Master file for expireover.8
@@ -616,6 +618,7 @@
samples/innfeed.conf Outgoing feed configuration
samples/innreport.conf.in Log summary configuration
samples/innwatch.ctl INN monitoring configuration
+samples/localgroups Local newsgroups with descriptions
samples/moderators Moderation submission addresses
samples/motd.news Sample MOTD file
samples/news2mail.cf news2mail config file
Modified: control/docheckgroups.in
===================================================================
--- control/docheckgroups.in 2007-09-04 17:40:44 UTC (rev 7669)
+++ control/docheckgroups.in 2007-09-05 14:01:32 UTC (rev 7670)
@@ -1,36 +1,53 @@
#! /bin/sh
# fixscript will replace this line with code to load innshellvars
-## $Revision$
+## $Id$
## Script to execute checkgroups text; results to stdout.
+##
+## Usage: docheckgroups [-u] [include-pattern [exclude-pattern]] < message
+##
+## If the -u flag is given, the newsgroups descriptions are automatically
+## updated.
T=${TMPDIR}
+UPDATEDESC=false
cat /dev/null >${T}/$$out
-## Copy the article without headers, append local newsgroups.
-cat >${T}/$$msg
-test -f ${LOCALGROUPS} && cat ${LOCALGROUPS} >>${T}/$$msg
+## Parse arguments.
+if [ $# -gt 0 ]; then
+ case $1 in
+ -u) shift;
+ UPDATEDESC=true;;
+ esac
+fi
+## Copy the message without excluded newsgroups and append local newsgroups.
+cat | ${EGREP} -v "${2:-^#}" >${T}/$$msg
+test -f ${LOCALGROUPS} && cat ${LOCALGROUPS} | ${EGREP} -v "^#" >>${T}/$$msg
+
## Get the top-level newsgroup names from the message and turn it into
## an egrep pattern.
PATS=`${SED} <${T}/$$msg \
- -e 's/[ ].*//' -e 's/\..*//' \
- -e 's/^!//' -e '/^$/d' \
- -e 's/^/^/' -e 's/$/[. ]/' \
- | sort -u \
+ -e 's/[ ].*//' -e 's/\..*//' \
+ -e 's/^!//' -e '/^$/d' \
+ -e 's/^/^/' -e 's/$/[. ]/' \
+ | ${SORT} -u \
| (tr '\012' '|' ; echo '' )\
| ${SED} -e 's/|$//'`
-${EGREP} "${PATS}" ${ACTIVE} | ${EGREP} "${1:-.}" | ${SED} 's/ .*//' | sort >${T}/$$active
-${EGREP} "${PATS}" ${T}/$$msg | ${EGREP} "${1:-.}" | ${SED} 's/[ ].*//' | sort >${T}/$$newsgrps
+## Check for missing and obsolete newsgroups in active.
+${EGREP} "${PATS}" ${ACTIVE} | ${EGREP} "${1:-.}" | ${SED} 's/ .*//' | ${SORT} >${T}/$$active
+${EGREP} "${PATS}" ${T}/$$msg | ${EGREP} "${1:-.}" | ${SED} 's/[ ].*//' | ${SORT} >${T}/$$newsgrps
comm -13 ${T}/$$active ${T}/$$newsgrps >${T}/$$missing
comm -23 ${T}/$$active ${T}/$$newsgrps >${T}/$$remove
-${EGREP} "${PATS}" ${ACTIVE} | ${EGREP} "${1:-.}" | ${SED} -n '/ m$/s/ .*//p' | sort >${T}/$$amod.all
-${EGREP} "${PATS}" ${T}/$$msg | ${EGREP} "${1:-.}" | ${SED} 's/\r\?$//' |
-${SED} -n '/(Moderated)$/s/[ ].*//p' | sort >${T}/$$ng.mod
+## Check for proper moderation flags in active (we need to be careful
+## when dealing with wire-formatted articles manually fed from the spool).
+${EGREP} "${PATS}" ${ACTIVE} | ${EGREP} "${1:-.}" | ${SED} -n '/ m$/s/ .*//p' | ${SORT} >${T}/$$amod.all
+${EGREP} "${PATS}" ${T}/$$msg | ${EGREP} "${1:-.}" | ${SED} 's/\r\?$//' \
+ | ${SED} -n '/ (Moderated)$/s/[ ].*//p' | ${SORT} >${T}/$$ng.mod
comm -12 ${T}/$$missing ${T}/$$ng.mod >${T}/$$add.mod
comm -23 ${T}/$$missing ${T}/$$ng.mod >${T}/$$add.unmod
@@ -41,109 +58,130 @@
comm -23 ${T}/$$ng.mod ${T}/$$amod >${T}/$$nm.all
comm -23 ${T}/$$nm.all ${T}/$$add >${T}/$$notmod
-${EGREP} "${PATS}" ${NEWSGROUPS} | ${EGREP} "${1:-.}" | ${SED} 's/[ ]\+/ /' | sort >${T}/$$localdesc
-${EGREP} "${PATS}" ${T}/$$msg | ${EGREP} "${1:-.}" | ${SED} 's/\r\?$//' |
-${SED} 's/[ ]\+/ /' | sort >${T}/$$newdesc
+## Check for missing and obsolete newsgroups descriptions (possibly
+## in wire format).
+${EGREP} "${PATS}" ${NEWSGROUPS} | ${EGREP} "${1:-.}" | ${SED} 's/[ ]\+/ /' | ${SORT} >${T}/$$localdesc
+${EGREP} "${PATS}" ${T}/$$msg | ${EGREP} "${1:-.}" | ${SED} 's/\r\?$//' \
+ | ${SED} 's/[ ]\+/ /' | ${SORT} >${T}/$$newdesc
-if ! (head -1 ${T}/$$newdesc | egrep " [[:digit:]]+ [[:digit:]]+ " > /dev/null) ; then
- comm -13 ${T}/$$localdesc ${T}/$$newdesc >${T}/$$missingdesc
- comm -23 ${T}/$$localdesc ${T}/$$newdesc >${T}/$$removedesc
+comm -13 ${T}/$$localdesc ${T}/$$newdesc >${T}/$$missingdesc
+comm -23 ${T}/$$localdesc ${T}/$$newdesc >${T}/$$removedesc
+
+## If the -u flag is given, update the newsgroups descriptions.
+if [ "${UPDATEDESC}" = "true" ] ; then
+ ${EGREP} -v "${PATS}" ${NEWSGROUPS} >${T}/$$updatednewsgroups
+ ${EGREP} "${PATS}" ${NEWSGROUPS} | ${EGREP} -v "${1:-.}" >>${T}/$$updatednewsgroups
+ cat ${T}/$$newdesc >>${T}/$$updatednewsgroups
+ mv -f ${NEWSGROUPS} ${NEWSGROUPS}.old
+ ${SORT} ${T}/$$updatednewsgroups | ${SED} 's/[ ]\+/ /' \
+ | ${AWK} -F'\t' '{if (length($1) < 8) {print $1"\t\t\t"$2} \
+ else {if (length($1) < 16) {print $1"\t\t"$2} \
+ else {print $1"\t"$2}}}' >${NEWSGROUPS}
+ chmod 0664 ${NEWSGROUPS} ${NEWSGROUPS}.old
fi
+## Display information on newsgroups which need to be removed/added/changed.
if [ -s ${T}/$$remove ] ; then
(
- echo "# The following newsgroups are non-standard."
- ${SED} "s/^/# /" ${T}/$$remove
- echo "# You can remove them by executing the commands:"
- for i in `cat ${T}/$$remove` ; do
- echo " ${PATHBIN}/ctlinnd rmgroup $i"
- ${EGREP} "^$i " ${NEWSGROUPS} >>${T}/$$ngdel
- done
- echo ''
+ echo "# The following newsgroups are non-standard:"
+ echo "#"
+ ${SED} "s/^/# /" ${T}/$$remove
+ echo "#"
+ echo "# You can remove them by executing the command(s):"
+ echo ""
+ for i in `cat ${T}/$$remove` ; do
+ echo " ${PATHBIN}/ctlinnd rmgroup $i"
+ done
+ echo ""
) >>${T}/$$out
fi
if [ -s ${T}/$$add ] ; then
(
- echo "# The following newsgroups were missing and should be added."
- ${SED} "s/^/# /" ${T}/$$add
- echo "# You can do this by executing the command(s):"
- for i in `cat ${T}/$$add.unmod` ; do
- echo " ${PATHBIN}/ctlinnd newgroup $i y ${FROM}"
- ${EGREP} "^$i " ${T}/$$msg >>${T}/$$ngadd
- done
- for i in `cat ${T}/$$add.mod` ; do
- echo " ${PATHBIN}/ctlinnd newgroup $i m ${FROM}"
- ${EGREP} "^$i " ${T}/$$msg >>${T}/$$ngadd
- done
- echo ''
+ echo "# The following newsgroups are missing and should be added:"
+ echo "#"
+ ${SED} "s/^/# /" ${T}/$$add
+ echo "#"
+ echo "# You can add them by executing the command(s):"
+ echo ""
+ for i in `cat ${T}/$$add.unmod` ; do
+ echo " ${PATHBIN}/ctlinnd newgroup $i y ${FROM}"
+ done
+ for i in `cat ${T}/$$add.mod` ; do
+ echo " ${PATHBIN}/ctlinnd newgroup $i m ${FROM}"
+ done
+ echo ""
) >>${T}/$$out
fi
if [ -s ${T}/$$ismod ] ; then
(
- echo "# The following groups are incorrectly marked as moderated:"
- ${SED} "s/^/# /" ${T}/$$ismod
- echo "# You can correct this by executing the following:"
- for i in `cat ${T}/$$ismod` ; do
- echo " ${PATHBIN}/ctlinnd changegroup $i y"
- ${EGREP} "^$i " ${T}/$$msg >>${T}/$$ngchng
- done
- echo ''
+ echo "# The following newsgroups are incorrectly marked as moderated:"
+ echo "#"
+ ${SED} "s/^/# /" ${T}/$$ismod
+ echo "#"
+ echo "# You can correct this by executing the command(s):"
+ echo ""
+ for i in `cat ${T}/$$ismod` ; do
+ echo " ${PATHBIN}/ctlinnd changegroup $i y"
+ done
+ echo ""
) >>${T}/$$out
fi
if [ -s ${T}/$$notmod ] ; then
(
- echo "# The following groups are incorrectly marked as unmoderated:"
- ${SED} "s/^/# /" ${T}/$$notmod
- echo "# You can correct this by executing the following:"
- for i in `cat ${T}/$$notmod` ;do
- echo " ${PATHBIN}/ctlinnd changegroup $i m"
- ${EGREP} "^$i " ${T}/$$msg >>${T}/$$ngchng
- done
- echo ''
+ echo "# The following newsgroups are incorrectly marked as unmoderated:"
+ echo "#"
+ ${SED} "s/^/# /" ${T}/$$notmod
+ echo "#"
+ echo "# You can correct this by executing the command(s):"
+ echo ""
+ for i in `cat ${T}/$$notmod` ; do
+ echo " ${PATHBIN}/ctlinnd changegroup $i m"
+ done
+ echo ""
) >>${T}/$$out
fi
+## Display information on descriptions which need to be removed/added.
if [ -s ${T}/$$removedesc ] ; then
(
- echo "# The following newsgroups descriptions are obsolete."
+ echo "# The following newsgroups descriptions are obsolete:"
+ echo "#"
${SED} "s/^/# /" ${T}/$$removedesc
- echo "# You can remove them by editing ${NEWSGROUPS}."
- echo ''
+ echo "#"
+ if [ "${UPDATEDESC}" = "true" ] ; then
+ echo "# The file ${NEWSGROUPS} has just been updated accordingly."
+ else
+ echo "# You can remove them by editing ${NEWSGROUPS}"
+ echo "# or by using the -u flag with docheckgroups."
+ fi
+ echo ""
) >>${T}/$$out
fi
if [ -s ${T}/$$missingdesc ] ; then
(
- echo "# The following newsgroups descriptions were missing and should be added."
+ echo "# The following newsgroups descriptions are missing and should be added:"
+ echo "#"
${SED} "s/^/# /" ${T}/$$missingdesc
- echo "# You can add them by editing ${NEWSGROUPS}."
- echo ''
+ echo "#"
+ if [ "${UPDATEDESC}" = "true" ] ; then
+ echo "# The file ${NEWSGROUPS} has just been updated accordingly."
+ else
+ echo "# You can add them by editing ${NEWSGROUPS}"
+ echo "# or by using the -u flag with docheckgroups."
+ fi
+ echo ""
) >>${T}/$$out
fi
-
+## We're done.
test -s ${T}/$$out && {
cat ${T}/$$out
- echo 'exit # so you can feed this message into the shell'
- echo "# And remember to update ${NEWSGROUPS}."
- test -s ${T}/$$ngdel && {
- echo "# Remove these lines:"
- ${SED} "s/^/# /" ${T}/$$ngdel
- echo ''
- }
- test -s ${T}/$$ngadd && {
- echo "# Add these lines:"
- ${SED} "s/^/# /" ${T}/$$ngadd
- echo ''
- }
- test -s ${T}/$$ngchng && {
- echo "# Change these lines:"
- ${SED} "s/^/# /" ${T}/$$ngchng
- echo ''
- }
+ echo "exit # so you can feed this message into the shell (as well as mod-active)."
+ echo ""
}
rm -f ${T}/$$*
Property changes on: trunk/doc/man
___________________________________________________________________
Name: svn:ignore
- active.5
active.times.5
actsync.8
archive.8
auth_krb5.8
auth_smb.8
batcher.8
buffchan.8
buffindexed.conf.5
ckpasswd.8
control.ctl.5
convdate.1
ctlinnd.8
cycbuff.conf.5
distrib.pats.5
domain.8
expire.ctl.5
expireover.8
fastrm.1
getlist.1
grephistory.1
ident.8
inews.1
inn.conf.5
innbind.8
innconfval.1
innd.8
inndf.8
innmail.1
innupgrade.8
libauth.3
libinnhist.3
list.3
mailpost.8
makehistory.8
moderators.5
motd.news.5
newsfeeds.5
newslog.5
newsgroups.5
ninpaths.8
nnrpd.8
ovdb.5
ovdb_init.8
ovdb_monitor.8
ovdb_server.8
ovdb_stat.8
overchan.8
passwd.nntp.5
perl-nocem.8
pgpverify.1
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
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
auth_smb.8
batcher.8
buffchan.8
buffindexed.conf.5
ckpasswd.8
control.ctl.5
convdate.1
ctlinnd.8
cycbuff.conf.5
distrib.pats.5
docheckgroups.8
domain.8
expire.ctl.5
expireover.8
fastrm.1
getlist.1
grephistory.1
ident.8
inews.1
inn.conf.5
innbind.8
innconfval.1
innd.8
inndf.8
innmail.1
innupgrade.8
libauth.3
libinnhist.3
list.3
mailpost.8
makehistory.8
moderators.5
motd.news.5
newsfeeds.5
newslog.5
newsgroups.5
ninpaths.8
nnrpd.8
ovdb.5
ovdb_init.8
ovdb_monitor.8
ovdb_server.8
ovdb_stat.8
overchan.8
passwd.nntp.5
perl-nocem.8
pgpverify.1
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
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 2007-09-04 17:40:44 UTC (rev 7669)
+++ doc/man/Makefile 2007-09-05 14:01:32 UTC (rev 7670)
@@ -20,7 +20,8 @@
SEC8 = actsync.8 archive.8 auth_smb.8 batcher.8 buffchan.8 ckpasswd.8 \
cnfsheadconf.8 cnfsstat.8 controlchan.8 ctlinnd.8 cvtbatch.8 \
- domain.8 expire.8 expireover.8 expirerm.8 filechan.8 ident.8 \
+ docheckgroups.8 domain.8 expire.8 expireover.8 expirerm.8 \
+ filechan.8 ident.8 \
innbind.8 inncheck.8 innd.8 inndf.8 innreport.8 innstat.8 \
innupgrade.8 innwatch.8 innxbatch.8 innxmit.8 mailpost.8 makedbz.8 \
makehistory.8 mod-active.8 news.daily.8 news2mail.8 ninpaths.8 \
Modified: doc/pod/Makefile
===================================================================
--- doc/pod/Makefile 2007-09-04 17:40:44 UTC (rev 7669)
+++ doc/pod/Makefile 2007-09-05 14:01:32 UTC (rev 7670)
@@ -28,7 +28,8 @@
MAN8 = ../man/actsync.8 ../man/archive.8 ../man/auth_krb5.8 \
../man/auth_smb.8 ../man/batcher.8 ../man/buffchan.8 \
- ../man/ckpasswd.8 ../man/ctlinnd.8 ../man/domain.8 \
+ ../man/ckpasswd.8 ../man/ctlinnd.8 ../man/docheckgroups.8 \
+ ../man/domain.8 \
../man/expireover.8 ../man/ident.8 ../man/innd.8 ../man/inndf.8 \
../man/nnrpd.8 ../man/innbind.8 ../man/innupgrade.8 \
../man/mailpost.8 ../man/makehistory.8 ../man/ninpaths.8 \
@@ -103,6 +104,7 @@
../man/buffchan.8: buffchan.pod ; $(POD2MAN) -s 8 $? > $@
../man/ckpasswd.8: ckpasswd.pod ; $(POD2MAN) -s 8 $? > $@
../man/ctlinnd.8: ctlinnd.pod ; $(POD2MAN) -s 8 $? > $@
+../man/docheckgroups.8: docheckgroups.pod ; $(POD2MAN) -s 8 $? > $@
../man/domain.8: domain.pod ; $(POD2MAN) -s 8 $? > $@
../man/expireover.8: expireover.pod ; $(POD2MAN) -s 8 $? > $@
../man/ident.8: ident.pod ; $(POD2MAN) -s 8 $? > $@
Added: doc/pod/docheckgroups.pod
===================================================================
--- doc/pod/docheckgroups.pod (rev 0)
+++ doc/pod/docheckgroups.pod 2007-09-05 14:01:32 UTC (rev 7670)
@@ -0,0 +1,195 @@
+=head1 NAME
+
+docheckgroups - Process checkgroups and output a list of changes
+
+=head1 SYNOPSIS
+
+B<docheckgroups> [B<-u>] [I<include-pattern> [I<exclude-pattern>]]
+
+=head1 DESCRIPTION
+
+B<docheckgroups> is usually run by B<controlchan> in order to process
+checkgroups control messages. It reads a list of newsgroups along
+with their descriptions on its standard input. That list should
+be formatted like the newsgroups(5) file: each line contains the
+name of a newsgroup followed by one or more tabulations and its
+description.
+
+B<docheckgroups> will only check the presence of newsgroups
+which match I<include-pattern> (an B<egrep> expression like
+C<^comp\..*$> for newsgroups starting with C<comp.>) and which
+do not match I<exclude-pattern> (also an B<egrep> expression)
+except for newsgroups mentioned in the I<pathetc>/localgroups file.
+This file is also formatted like the newsgroups(5) file and
+should contain local newsgroups which would otherwise be mentioned
+for removal. There is no need to put local newsgroups of hierarchies
+for which no checkgroups control messages are sent, unless if
+you manually process checkgroups texts for them. Lines beginning
+with a hash sign (C<#>) are not taken into account in this file.
+All the newsgroups and descriptions mentioned in I<pathetc>/localgroups
+are appended to the processed checkgroups.
+
+If I<exclude-pattern> is given, I<include-pattern> should also
+be given before (you can use an empty string ("") if you want
+to include all the newsgroups). Be that as it may, B<docheckgroups>
+will only check newsgroups in the top-level hierarchies which are
+present in the checkgroups.
+
+Then, B<docheckgroups> checks the F<active> and F<newsgroups> files
+and displays on its standard output a list of changes, if any. It
+does not change anything by default; it only points out what should
+be changed:
+
+=over 2
+
+=item *
+
+Newsgroups which should be removed (they are in the F<active> file
+but not in the checkgroups) and the relevant B<ctlinnd> commands
+to achieve that;
+
+=item *
+
+Newsgroups which should be added (they are not in the F<active> file
+but in the checkgroups) and the relevant B<ctlinnd> commands
+to achieve that;
+
+=item *
+
+Newsgroups which are incorrectly marked as moderated or unmoderated
+(they are both in the F<active> file and the checkgroups but their
+status differs) and the relevant B<ctlinnd> commands to fix that;
+
+=item *
+
+Descriptions which should be removed (they are in the F<newsgroups> file
+but not in the checkgroups);
+
+=item *
+
+Descriptions which should be added (they are not in the F<newsgroups> file
+but in the checkgroups).
+
+=back
+
+The output of B<docheckgroups> can be fed into B<mod-active> (it will
+pause the news server, update the F<active> file accordingly, reload it
+and resume the work of the news server) or into the shell (commands for
+B<ctlinnd> will be processed one by one). In order to update the
+F<newsgroups> file, the B<-u> flag must be given to B<docheckgroups>.
+
+When processing a checkgroups manually, it is always advisable to first
+check the raw output of B<docheckgroups>. Then, if everything looks
+fine, use B<mod-active> and the B<-u> flag.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-u>
+
+If this flag is given, B<docheckgroups> will update the F<newsgroups> file:
+it removes obsolete descriptions and adds new ones. It also sorts
+this file alphabetically and improves its general format (see newsgroups(5)
+for an explanation of the preferred number of tabulations).
+
+=back
+
+=head1 EXAMPLES
+
+So as to better understand how B<docheckgroups> works, here are examples
+with the following F<active>:
+
+ a.first 0000000000 0000000001 y
+ a.second.announce 0000000000 0000000001 y
+ a.second.group 0000000000 0000000001 y
+ b.additional 0000000000 0000000001 y
+ b.third 0000000000 0000000001 y
+ c.fourth 0000000000 0000000001 y
+
+the following F<newsgroups> file (using tabulations):
+
+ a.first First group.
+ a.second.announce Announce group.
+ a.second.group Second group.
+ b.third Third group.
+ c.fourth Fourth group.
+
+and the following F<localgroups> file (using tabulations):
+
+ b.additional A local newsgroup I want to keep.
+
+The checkgroups we process is in the file F<test> which contains:
+
+ a.first First group.
+ a.second.announce Announce group. (Moderated)
+ a.second.group Second group.
+ b.third Third group.
+ c.fourth Fourth group.
+
+If we run:
+
+ cat test | docheckgroups
+
+B<docheckgroups> will output that a.second.announce is incorrectly marked
+as unmoderated and that its description is obsolete. Besides, two
+new descriptions will be mentioned for addition (the new one for
+a.second.announce and the missing description for b.additional S<-- it>
+should indeed be in the F<newsgroups> file and not only in F<localgroups>).
+Now that we have checked the output of B<docheckgroups> and that we agree
+with the changes, we run it with the B<-u> flag to update the F<newsgroups>
+file and we redirect the standard output to B<mod-active> to update the
+F<active> file:
+
+ cat test | docheckgroups -u | mod-active
+
+That's all!
+
+Now, suppose we run:
+
+ cat test | docheckgroups "^c\..*$"
+
+Nothing is output (indeed, everything is fine for the c.* hierarchy).
+It would have been similar if the F<test> file had only contained
+the checkgroups for the c.* hierarchy (B<docheckgroups> would not
+have checked a.* and b.*, even if they had been in I<include-pattern>).
+
+In order to check both a.* and c.*, you can run:
+
+ cat test | docheckgroups "^a\..*$|^c\..*$"
+
+And if you want to check a.* but not a.second.*, you can run:
+
+ cat test | docheckgroups "^a\..*$" "^a\.second\..*$"
+
+In our example, B<docheckgroups> will then mention a.second.announce and
+a.second.group for removal since they are in the F<active> file (the
+same goes for their descriptions). Notwithstanding, if you do want to keep
+a.second.announce, just add this group to F<localgroups> and
+B<docheckgroups> will no longer mention it for removal.
+
+=head1 FILES
+
+=over 4
+
+=item I<pathbin>/docheckgroups
+
+The Shell script itself used to process checkgroups.
+
+=item I<pathetc>/localgroups
+
+The list of local newsgroups along with their descriptions.
+
+=back
+
+=head1 HISTORY
+
+Documentation written by Julien Elie <julien at trigofacile.com> for InterNetNews.
+
+$Id$
+
+=head1 SEE ALSO
+
+active(5), controlchan(8), ctlinnd(8), mod-active(8), newsgroups(5).
+
+=cut
Property changes on: trunk/doc/pod/docheckgroups.pod
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: samples/localgroups
===================================================================
--- samples/localgroups (rev 0)
+++ samples/localgroups 2007-09-05 14:01:32 UTC (rev 7670)
@@ -0,0 +1,16 @@
+## $Id$
+##
+## Put your local newsgroups, along with their descriptions,
+## in this file if you want them to be recognized by
+## docheckgroups. They would otherwise be mentioned for removal.
+##
+## There is no need to put here local newsgroups of hierarchies
+## for which no checkgroups control messages are sent (unless
+## you manually process checkgroups texts for them).
+##
+## Lines beginning with a hash sign (#) are not taken into account.
+##
+## See the docheckgroups man page for more information.
+
+#comp.group.to.add An additional local newsgroup in comp.*.
+#comp.other.group Another local newsgroup in comp.*.
Property changes on: trunk/samples/localgroups
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Property changes on: trunk/site
___________________________________________________________________
Name: svn:ignore
- INN.py
active.minimal
actsync.cfg
actsync.ign
buffindexed.conf
config
control.ctl
cycbuff.conf
distrib.pats
expire.ctl
filter.tcl
filter_innd.pl
filter_innd.py
filter_nnrpd.pl
incoming.conf
inn.conf
innfeed.conf
innreport.conf
innwatch.ctl
moderators
motd.news
news2mail.cf
newsfeeds
newsgroups.minimal
nnrpd.track
nnrpd_access.pl
nnrpd_auth.pl
nnrpd_auth.py
nntpsend.ctl
nocem.ctl
ovdb.conf
overview.fmt
passwd.nntp
radius.conf
readers.conf
sasl.conf
send-uucp.cf
startup.tcl
startup_innd.pl
storage.conf
subscriptions
update
+ INN.py
active.minimal
actsync.cfg
actsync.ign
buffindexed.conf
config
control.ctl
cycbuff.conf
distrib.pats
expire.ctl
filter.tcl
filter_innd.pl
filter_innd.py
filter_nnrpd.pl
incoming.conf
inn.conf
innfeed.conf
innreport.conf
innwatch.ctl
localgroups
moderators
motd.news
news2mail.cf
newsfeeds
newsgroups.minimal
nnrpd.track
nnrpd_access.pl
nnrpd_auth.pl
nnrpd_auth.py
nntpsend.ctl
nocem.ctl
ovdb.conf
overview.fmt
passwd.nntp
radius.conf
readers.conf
sasl.conf
send-uucp.cf
startup.tcl
startup_innd.pl
storage.conf
subscriptions
update
Modified: site/Makefile
===================================================================
--- site/Makefile 2007-09-04 17:40:44 UTC (rev 7669)
+++ site/Makefile 2007-09-05 14:01:32 UTC (rev 7670)
@@ -54,7 +54,7 @@
## Scripts from above, plus site-specific config files.
REST = \
newsfeeds incoming.conf nnrpd.track passwd.nntp \
- inn.conf moderators innreport.conf \
+ inn.conf moderators innreport.conf localgroups \
control.ctl expire.ctl nntpsend.ctl overview.fmt \
innwatch.ctl distrib.pats actsync.cfg actsync.ign \
motd.news storage.conf cycbuff.conf buffindexed.conf \
@@ -72,7 +72,7 @@
$D$(PATH_NNRPDTRACK) $D$(PATH_NNTPPASS) \
$D$(PATH_CONFIG) $D$(PATH_MODERATORS) \
$D$(PATH_CONTROLCTL) $D$(PATH_EXPIRECTL) $D$(PATHETC)/nntpsend.ctl \
- $D$(PATHETC)/innreport.conf \
+ $D$(PATHETC)/innreport.conf $D$(PATHETC)/localgroups \
$D$(PATH_CTLWATCH) $D$(PATH_DISTPATS) $D$(PATH_SCHEMA) \
$D$(PATH_ACTSYNC_CFG) $D$(PATH_ACTSYNC_IGN) \
$D$(PATH_MOTD) $D$(PATH_STORAGECONF) \
@@ -183,6 +183,7 @@
$D$(PATHETC)/nntpsend.ctl: nntpsend.ctl ; $(COPY_RPUB) $? $@
$D$(PATHETC)/news2mail.cf: news2mail.cf ; $(COPY_RPUB) $? $@
$D$(PATHETC)/innreport.conf: innreport.conf ; $(COPY_RPUB) $? $@
+$D$(PATHETC)/localgroups: localgroups ; $(COPY_RPUB) $? $@
$D$(PATH_STORAGECONF): storage.conf ; $(COPY_RPUB) $? $@
$D$(PATH_CYCBUFFCONFIG): cycbuff.conf ; $(COPY_RPUB) $? $@
$D$(PATH_BUFFINDEXED): buffindexed.conf ; $(COPY_RPUB) $? $@
@@ -230,6 +231,7 @@
incoming.conf: ../samples/incoming.conf ; $(COPY) $? $@
inn.conf: ../samples/inn.conf ; $(COPY) $? $@
innreport.conf: ../samples/innreport.conf ; $(COPY) $? $@
+localgroups: ../samples/localgroups ; $(COPY) $? $@
storage.conf: ../samples/storage.conf ; $(COPY) $? $@
cycbuff.conf: ../samples/cycbuff.conf ; $(COPY) $? $@
buffindexed.conf: ../samples/buffindexed.conf ; $(COPY) $? $@
Modified: support/mkmanifest
===================================================================
--- support/mkmanifest 2007-09-04 17:40:44 UTC (rev 7669)
+++ support/mkmanifest 2007-09-05 14:01:32 UTC (rev 7670)
@@ -221,6 +221,7 @@
site/innfeed.conf
site/innreport.conf
site/innwatch.ctl
+site/localgroups
site/moderators
site/motd.news
site/news2mail.cf
More information about the inn-committers
mailing list