[news.software.b] Another nit for C news

bill@twwells.com (T. William Wells) (07/15/89)

In the wake of the escaped checkgroups control message, I discovered
several minor problems with the checkgroups script.

    1) It creates a file newsgroups.bac as a temp but never deletes it.
    2) It does not keep an original copy of the newsgroups file
       around, making recovery from problems more than a little
       irritating. (No, newsgroups.bac is not a backup of the
       original.)
    3) If the comment on the checkgroups input is different from the
       one you have in your newsgroups file, you get two newsgroups
       lines and no way to tell which is the right one.
    4) Since the script distinguishes different representations of
       white space, if the checkgroups has spaces where yours has tabs
       or v.v., it is a real pain to figure out which really belongs.
       This is exacerbated by 2).

Following is a context diff for the changes I made to mine to make it
tolerable:

*** checkgroups.old     Fri Jul 14 14:39:55 1989
--- checkgroups Fri Jul 14 14:47:26 1989
***************
*** 13,23 ****
  # generate newsgroups from localgroups & beheaded stdin (checkgroups article).
  # appending to newsgroups instead of overwriting is a hack,
  # but is about the best we can do until checkgroups is defined.
- (cat $NEWSCTL/localgroups; sed '1,/^$/d') >>$NEWSCTL/newsgroups
- # backup newsgroups, then strip duplicates
  cp $NEWSCTL/newsgroups $NEWSCTL/newsgroups.bac || exit 1
! sort -u -o $NEWSCTL/newsgroups $NEWSCTL/newsgroups.bac

  # generate list of approved newsgroups from $nl/newsgroups
  # [^.]*\. in next two egreps was net.|mod.|fa., which is inadequate - geoff
  (echo junk; echo control; sed 's/[ \  ].*//' $NEWSCTL/newsgroups |
--- 13,31 ----
  # generate newsgroups from localgroups & beheaded stdin (checkgroups article).
  # appending to newsgroups instead of overwriting is a hack,
  # but is about the best we can do until checkgroups is defined.
  cp $NEWSCTL/newsgroups $NEWSCTL/newsgroups.bac || exit 1
! (cat $NEWSCTL/localgroups; sed '1,/^$/d') >>$NEWSCTL/newsgroups
! sort -u -o $NEWSCTL/newsgroups $NEWSCTL/newsgroups

+ # display differences between old and new newsgroups file
+ sort -u $NEWSCTL/localgroups | comm -13 - $NEWSCTL/newsgroups |
+       diff $NEWSCTL/newsgroups.bac - >/tmp/$$change
+ if test -s /tmp/$$change; then
+       echo "Changes to your newsgroups file:"
+       cat /tmp/$$change
+       echo ""
+ fi 2>&1 >/tmp/$$out
+
  # generate list of approved newsgroups from $nl/newsgroups
  # [^.]*\. in next two egreps was net.|mod.|fa., which is inadequate - geoff
  (echo junk; echo control; sed 's/[ \  ].*//' $NEWSCTL/newsgroups |
***************
*** 38,44 ****
	echo "You can do this by executing the commands:"
	sed "s;.*;       $NEWSBIN/maint/delgroup &;" /tmp/$$remove
	echo ""
! fi 2>&1 >/tmp/$$out

  if test -s /tmp/$$add; then
	echo "The following newsgroups were missing." # "and were added."
--- 46,52 ----
	echo "You can do this by executing the commands:"
	sed "s;.*;       $NEWSBIN/maint/delgroup &;" /tmp/$$remove
	echo ""
! fi 2>&1 >>/tmp/$$out

  if test -s /tmp/$$add; then
	echo "The following newsgroups were missing." # "and were added."

---
Bill                    { uunet | novavax | ankh | sunvice } !twwells!bill
bill@twwells.com

henry@utzoo.uucp (Henry Spencer) (07/18/89)

In article <1989Jul14.185052.18976@twwells.com> bill@twwells.com (T. William Wells) writes:
>...several minor problems with the checkgroups script.
>Following is a context diff for the changes I made to mine to make it
>tolerable...

We don't have a high opinion of checkgroups and consequently haven't looked
closely at it for a long time.  Sorry to hear that it is causing trouble; at
some point I'll look at your changes for possible incorporation.
-- 
$10 million equals 18 PM       |     Henry Spencer at U of Toronto Zoology
(Pentagon-Minutes). -Tom Neff  | uunet!attcan!utzoo!henry henry@zoo.toronto.edu