Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!psuvax1!news From: flee@shire.cs.psu.edu (Felix Lee) Newsgroups: news.software.b Subject: C news checkgroups (Re: C news canonsys.awk ...) Message-ID: Date: 22 Feb 90 11:52:25 GMT References: <1990Feb18.132237.6360@is.uu.no> <1990Feb19.191324.9367@utzoo.uucp> Sender: news@cs.psu.edu (Usenet) Organization: Penn State University Computer Science Lines: 57 Jay Maynard 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