[news.software.b] Cnews checkgroups

flee@shire.cs.psu.edu (Felix Lee) (02/22/90)

Jay Maynard <jay@splut.conmicro.com> wrote:
>While you're at it, how about making it only produce messages for those
>hierarchies that are mentioned in the message?

Below, a diff to ctl/checkgroups that does this.  It also ignores
groups in the active file flagged other than "y", "n", or "m".

Things still to fix:
* It doesn't delete or replace lines in NEWSLIB/newsgroups.
* It doesn't check for (Moderated).
* It does a half-hearted attempt at understanding "!mod", when it
probably should just ignore it entirely.
* The localgroups file is now unnecessary and can disappear.
--
Felix Lee	flee@shire.cs.psu.edu	*!psuvax1!flee

13c13,16
< # generate newsgroups from localgroups & beheaded stdin (checkgroups article).
---
> # save the checkgroups article.
> sed '1,/^$/d' >> /tmp/$$ck
> 
> # generate newsgroups from localgroups & checkgroups article.
16c19
< (cat $NEWSCTL/localgroups; sed '1,/^$/d') >>$NEWSCTL/newsgroups
---
> cat $NEWSCTL/localgroups /tmp/$$ck >>$NEWSCTL/newsgroups
20a24,28
> # get the hierarchies covered by the checkgroups.
> ckpat=`sed 's/\..*//' /tmp/$$ck | sort -u | tr '\012' ,`
> # and the hierarchies not covered by the checkgroups.
> #nckpat=`sed 's/\..*//;s/^[^!]/!&/' /tmp/$$ck | sort -u | tr '\012' ,`
> 
23,24c31,32
< gngppat=`awk -f $NEWSBIN/relay/canonsys.awk $NEWSCTL/sys |
< 	egrep "^($me|ME):" |
---
> subpat=`awk -f $NEWSBIN/relay/canonsys.awk $NEWSCTL/sys |
> 	egrep "^($me|ME)[/:]" |
32,34c40,41
< # generate list of approved newsgroups from $nl/newsgroups
< (echo junk; echo control; sed 's/[ \	].*//' $NEWSCTL/newsgroups |
< 	egrep "^([^.]*\.|general)") | gngp -a "$gngppat" | sort -u >/tmp/$$a
---
> # generate list of groups in the checkgroups message
> gngp -a "$subpat" /tmp/$$ck | sed '/^!/d;s/[ \	].*//' | sort -u >/tmp/$$a
36,38c43,44
< # generate list of locally-present newsgroups from $nl/active
< egrep "^([^.]*\.|general|junk|control)" $NEWSCTL/active | sed 's/ .*//' |
< 	sort -u >/tmp/$$b
---
> # generate list of groups in our active file
> gngp -a "$ckpat" $NEWSCTL/active | sed '/ [ynm]$/!d;s/ .*//' | sort -u >/tmp/$$b
78c84
< rm -f /tmp/$$*		# clean up temporaries
---
> rm -f /tmp/$$[a-z]*		# clean up temporaries

gary@sci34hub.UUCP (Gary Heston) (10/25/90)

In article <1990Oct24.092028.5980@iddth.id.dk> news@iddth.id.dk (Usenet News Manager) writes:
>gary@sci34hub.UUCP (Gary Heston) writes:
> [ discussing Cnews checkgroups messages ]

>>Relax; ignore it; it doesn't hurt anything.

>My newsgroups list gets garbled and I have to restore it every time.
>It's a very good thing that c-news makes a back-up...

As I understand it, checkgroups should only read the active file and
the checkgroups message, compare the two, and mail a note of differences
to the site admin. It should not read $NEWSLIB/newsgroups, and should 
not write anything in $NEWSLIB (possibly excepting log file entries).

Note that I am currently running Bnews, and will convert to Cnews very
soon (hopefully, today!). In email Karl Kleinpaste has recommended using
the Bnews checkgroups program instead of the Cnews one, as the Cnews
checkgroups has acknowledged problems in it. I plan to go ahead and 
do this (I certainly don't know everything about news; Karl and Henry
Spencer are orders of magnitude above me, so I'll take their advice!).

If something is eating your $NEWSLIB/newsgroups or $NEWSLIB/active files,
something is wrong, somewhere.

-- 
    Gary Heston     { uunet!sci34hub!gary  }    System Mismanager
   SCI Technology, Inc.  OEM Products Department  (i.e., computers)
"The esteemed gentlebeing says I called him a liar. It's true, and I
regret that." Retief, in "Retiefs' Ransom" by Keith Laumer.