home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume19 / cnews2 / pch22aug89 < prev    next >
Internet Message Format  |  1989-09-17  |  60KB

  1. From attcan!utzoo!henry@uunet.uu.net Tue Aug 22 23:35:45 1989
  2. Received: from BBN.COM by pineapple.bbn.com
  3.     id <AA00485@pineapple.bbn.com>; Tue, 22 Aug 89 23:35:24 -0400
  4. Received: from uunet.uu.net by BBN.COM id aa03912; 22 Aug 89 23:36 EDT
  5. Received: from attcan.UUCP by uunet.uu.net (5.61/1.14) with UUCP 
  6.     id AA07897; Tue, 22 Aug 89 23:32:19 -0400
  7. Date: Tue, 22 Aug 89 23:32:19 -0400
  8. From: attcan!utzoo!henry@uunet.uu.net
  9. Message-Id: <8908230332.AA07897@uunet.uu.net>
  10. To: source-patches@uunet.uu.net
  11. Cc: utstat!geoff@uunet.uu.net
  12. Subject: C News patch of 22-Aug-1989
  13. Content-Type: text  
  14. Content-Length: 59094  
  15. Status: R
  16.  
  17. This one is a lot of small stuff; some more major work is coming, but this
  18. one is already pushing 60KB (context diffs are so damned bulky...).
  19.  
  20. Some "make cmp" stuff intended for our own testing, but possibly of use.
  21. A C version of upact.  Some new fflushes in relaynews to make "status 16"
  22. failures report properly.  A new option to expire to suppress the history
  23. rebuild.  "inews -C" now produces an (informative) error message and exits.
  24. Lots of minor cleanup and improvement.
  25.  
  26. start of patch 22-Aug-1989
  27. this should be run with   patch -p0 <thisfile
  28.  
  29. Please do the following (there is no easy way we can convince
  30. patch to do this automatically):
  31. rm expire/lowest.c
  32. mv relay/sh/postnews rna/postnews
  33.  
  34. The following is a complete list of patches to date.
  35.  
  36. Prereq: 23-Jun-1989
  37. Prereq: 7-Jul-1989
  38. Prereq: 23-Jul-1989
  39. *** tmp.dates.with.really.long.filename.for.patch    Tue Aug 22 14:05:43 1989
  40. --- PATCHDATES    Tue Aug 22 14:05:43 1989
  41. ***************
  42. *** 1,3 ****
  43. --- 1,4 ----
  44.   23-Jun-1989
  45.   7-Jul-1989
  46.   23-Jul-1989
  47. + 22-Aug-1989
  48.  
  49. Changed files, if any:
  50.  
  51. *** cnpatch/tmp.file    Tue Aug 22 14:05:49 1989
  52. --- batch/Makefile    Mon Aug 21 19:15:19 1989
  53. ***************
  54. *** 17,21 ****
  55.   
  56.   PGMS=batcher batchih batchsm batchsplit comp compcun nocomp viainews viauux \
  57. !     sendbatches compc7 c7encode viamail viapmail bencode compb
  58.   DTR=Makefile batcher.c batchih batchsplit c7encode.c comp compc7 compcun \
  59.       newsbatch.8 nocomp sendbatches viainews viauux viamail \
  60. --- 17,22 ----
  61.   
  62.   PGMS=batcher batchih batchsm batchsplit comp compcun nocomp viainews viauux \
  63. !     sendbatches compc7 c7encode viamail viapmail bencode compb viauuxz \
  64. !     viaemail
  65.   DTR=Makefile batcher.c batchih batchsplit c7encode.c comp compc7 compcun \
  66.       newsbatch.8 nocomp sendbatches viainews viauux viamail \
  67. ***************
  68. *** 41,44 ****
  69. --- 42,48 ----
  70.       cp $(PGMS) $(PGMDIR)
  71.   
  72. + cmp:    $(PGMS)
  73. +     for f in $(PGMS) ; do cmp $(PGMDIR)/$$f $$f ; done
  74.   newsinstall:    batchparms
  75.       -if test ! -d $(OUTGOING) ; then mkdir $(OUTGOING) ; fi
  76. ***************
  77. *** 61,64 ****
  78. --- 65,74 ----
  79.       sed 's/ihave/sendme/g' batchih >$@
  80.   
  81. + viauuxz:    viauux
  82. +     sed '$$s/-r/-r -z/' viauux >$@
  83. + viaemail:    viamail
  84. +     sed '$$s/rnews/enews/' viamail >$@
  85.   test.1:
  86.       echo 'a test' >$@
  87. ***************
  88. *** 165,167 ****
  89.       rm -rf out.going bin
  90.       rm -f *.o test.* togo togo.* batchparms batcher batchsm 
  91. !     rm -f batchlog batchlog.* c7encode bencode
  92. --- 175,177 ----
  93.       rm -rf out.going bin
  94.       rm -f *.o test.* togo togo.* batchparms batcher batchsm 
  95. !     rm -f batchlog batchlog.* c7encode bencode viauuxz viaemail
  96.  
  97. *** cnpatch/tmp.file    Tue Aug 22 14:05:51 1989
  98. --- batch/batcher.c    Sun Aug 20 00:42:51 1989
  99. ***************
  100. *** 115,119 ****
  101.           error("internal disaster, can't fstat", "");
  102.       if ((sbuf.st_mode&S_IFMT) != S_IFREG) {
  103. !         close(artfile);
  104.           return;        /* Don't try to batch directories etc. */
  105.       }
  106. --- 115,119 ----
  107.           error("internal disaster, can't fstat", "");
  108.       if ((sbuf.st_mode&S_IFMT) != S_IFREG) {
  109. !         (void) close(artfile);
  110.           return;        /* Don't try to batch directories etc. */
  111.       }
  112.  
  113. *** cnpatch/tmp.file    Tue Aug 22 14:05:58 1989
  114. --- batch/sendbatches    Wed Aug 16 15:54:35 1989
  115. ***************
  116. *** 148,152 ****
  117.               if test $? -eq 0 -a ! -s /tmp/nb$$
  118.               then
  119. !                 rm $f /tmp/nb$$
  120.               else
  121.                   (
  122. --- 148,152 ----
  123.               if test $? -eq 0 -a ! -s /tmp/nb$$
  124.               then
  125. !                 rm -f $f /tmp/nb$$
  126.               else
  127.                   (
  128.  
  129. *** cnpatch/tmp.file    Tue Aug 22 14:05:59 1989
  130. --- batch/viainews    Sun Aug  6 02:48:24 1989
  131. ***************
  132. *** 2,4 ****
  133. --- 2,5 ----
  134.   # Feed batch to inews, for ihave/sendme mostly.
  135.   
  136. + HOME=/dev/null ; export HOME    # suppress signatures, .name, etc.
  137.   exec inews -h -W -A
  138.  
  139. *** cnpatch/tmp.file    Tue Aug 22 14:06:01 1989
  140. --- conf/Makefile    Mon Aug 21 19:46:47 1989
  141. ***************
  142. *** 15,18 ****
  143. --- 15,20 ----
  144.       libsmall libstdio libusg libv7 libv8
  145.   DIRS = batch conf expire h hfake input $(LIBDIRS) misc relay rna
  146. + CMPDIRS = batch conf expire input man misc relay rna
  147. + SHS = doit.root doit.bin doit.news again.root
  148.   
  149.   PGMS = spacefor queuelen
  150. ***************
  151. *** 27,30 ****
  152. --- 29,38 ----
  153.       : and build takes care of setnewsids if needed
  154.   
  155. + pcmp:    $(PGMS)
  156. +     for f in $(PGMS) ; do cmp $(NEWSBIN)/$$f $$f ; done
  157. + cmp:
  158. +     : nothing
  159.   newsinstall:
  160.       : build stuff does the real work
  161. ***************
  162. *** 82,86 ****
  163.       rm -f substitutions history history.pag history.dir active localgroups
  164.       rm -f log mailpaths sys cron rc setnewsids setnewsids.o spacefor.bsd
  165. !     rm -f replyusepath spacefor queuelen junk
  166.   
  167.   gclean:    tidy
  168. --- 90,94 ----
  169.       rm -f substitutions history history.pag history.dir active localgroups
  170.       rm -f log mailpaths sys cron rc setnewsids setnewsids.o spacefor.bsd
  171. !     rm -rf replyusepath spacefor queuelen junk save
  172.   
  173.   gclean:    tidy
  174. ***************
  175. *** 92,96 ****
  176.   
  177.   spotless:    gclean
  178. !     rm -f again.root doit.bin doit.news doit.root
  179.   
  180.   lclean:
  181. --- 100,104 ----
  182.   
  183.   spotless:    gclean
  184. !     rm -f $(SHS)
  185.   
  186.   lclean:
  187. ***************
  188. *** 97,98 ****
  189. --- 105,116 ----
  190.       rm -f ../ranlibed
  191.       for d in $(LIBDIRS) ; do cd ../$$d ; make clean ; done
  192. + cmps:
  193. +     for d in $(CMPDIRS) ; do cd ../$$d ; make cmp RBIN=/usr/lib/uucp/bin ; done
  194. + save:    $(SHS)
  195. +     mkdir save
  196. +     mv $(SHS) save
  197. + check:
  198. +     -for f in $(SHS) ; do diff save/$$f $$f ; done
  199.  
  200. *** cnpatch/tmp.file    Tue Aug 22 14:06:03 1989
  201. --- conf/build    Mon Aug 21 19:08:35 1989
  202. ***************
  203. *** 8,12 ****
  204.   # directories in which to do makes
  205.   # batch must precede input; relay must precede misc
  206. ! pgmdirs='conf batch expire input relay misc rna'
  207.   
  208.   # control files built in conf
  209. --- 8,13 ----
  210.   # directories in which to do makes
  211.   # batch must precede input; relay must precede misc
  212. ! # the "doui" code below may add rna to the list
  213. ! pgmdirs='conf batch expire input relay misc'
  214.   
  215.   # control files built in conf
  216. ***************
  217. *** 727,731 ****
  218.   
  219.   echo
  220. ! echo 'The "inews", "postnews", "readnews", and "checknews" commands should'
  221.   echo 'go in one of the directories searched for normal commands, so users'
  222.   echo 'can run them without special arrangements.  What directory should'
  223. --- 728,748 ----
  224.   
  225.   echo
  226. ! echo 'Our "postnews", "readnews", and "checknews" are included mostly for'
  227. ! echo 'completeness.  They are very simple and crude compared to the user'
  228. ! echo 'interface many users are accustomed to.  As far as we know, B News'
  229. ! echo '(or other) versions should run fine with C News.  If you are already'
  230. ! echo 'running such user-interface software, you may not want to change.'
  231. ! ./query 'Do you want to install our user-interface programs [yes]? '
  232. ! read doui
  233. ! case "$doui" in
  234. ! ''|y*|Y*)    doui=yes ; pgmdirs="$pgmdirs rna"    ;;
  235. ! *)    doui=no    ;;
  236. ! esac
  237. ! echo
  238. ! case "$doui" in
  239. ! no)    echo 'The "inews" command(s) should'    ;;
  240. ! *)    echo 'The "inews", "postnews", "readnews", and "checknews" commands should'    ;;
  241. ! esac
  242.   echo 'go in one of the directories searched for normal commands, so users'
  243.   echo 'can run them without special arrangements.  What directory should'
  244. ***************
  245. *** 748,763 ****
  246.   esac
  247.   
  248. ! echo
  249. ! echo 'Postnews can supply a default newsgroup, to assist naive users in'
  250. ! echo 'getting the group right for simple postings.  What should the default'
  251. ! ./query 'newsgroup for postnews be [no default]? '
  252. ! read postdefltgroup
  253.   
  254. ! echo
  255. ! echo 'Postnews can supply a default distribution, to restrict news to a'
  256. ! echo 'local area unless the user specifically changes it.  This is probably'
  257. ! echo 'a good idea.  What should the default distribution for postnews'
  258. ! ./query 'be [world]? '
  259. ! read postdefltdist
  260.   
  261.   echo
  262. --- 765,784 ----
  263.   esac
  264.   
  265. ! case "$doui" in
  266. ! yes)
  267. !     echo
  268. !     echo 'Postnews can supply a default newsgroup, to aid naive users in'
  269. !     echo 'getting this right for simple postings.  What should the default'
  270. !     ./query 'newsgroup for postnews be [no default]? '
  271. !     read postdefltgroup
  272.   
  273. !     echo
  274. !     echo 'Postnews can supply a default distribution, to limit news to a'
  275. !     echo 'local area unless the user specifically changes it.  This is'
  276. !     echo 'probably wise.  What should the default postnews distribution'
  277. !     ./query 'be [world]? '
  278. !     read postdefltdist
  279. !     ;;
  280. ! esac
  281.   
  282.   echo
  283. ***************
  284. *** 771,775 ****
  285.   case "$answer" in
  286.   n*|N*|'')    ;;
  287. ! *)    echo 'You should substitute relay/ihave.not.c for relay/ihave.c'
  288.       echo 'before running doit.bin, so that ihave/sendme is disabled'
  289.       echo 'at your site.'
  290. --- 792,796 ----
  291.   case "$answer" in
  292.   n*|N*|'')    ;;
  293. ! *)    echo 'You may want to substitute relay/ihave.not.c for relay/ihave.c'
  294.       echo 'before running doit.bin, so that ihave/sendme is disabled'
  295.       echo 'at your site.'
  296. ***************
  297. *** 859,866 ****
  298.           echo 'case "$1" in'
  299.           echo '-*s*)    ;;'
  300. !         echo '*)    make substs    ;;'
  301.           echo 'esac'
  302.       else
  303. !         echo ": make substs        not necessary, defaults used"
  304.       fi
  305.       echo ": done"
  306. --- 880,887 ----
  307.           echo 'case "$1" in'
  308.           echo '-*s*)    ;;'
  309. !         echo '*)    make substs || exit 1    ;;'
  310.           echo 'esac'
  311.       else
  312. !         echo ": make substs || exit 1    not necessary, defaults used"
  313.       fi
  314.       echo ": done"
  315. ***************
  316. *** 867,873 ****
  317.       echo ": making spacefor, queuelen, etc...."
  318.       echo "rm -f spacefor queuelen hostname setnewsids"
  319. !     echo "make spacefor.$dftype"
  320.       echo "cp spacefor.$dftype spacefor"
  321. !     echo "make queuelen.$uucptype"
  322.       echo "cp queuelen.$uucptype queuelen"
  323.       if test " $hostname" = " y"
  324. --- 888,894 ----
  325.       echo ": making spacefor, queuelen, etc...."
  326.       echo "rm -f spacefor queuelen hostname setnewsids"
  327. !     echo "make spacefor.$dftype || exit 1"
  328.       echo "cp spacefor.$dftype spacefor"
  329. !     echo "make queuelen.$uucptype || exit 1"
  330.       echo "cp queuelen.$uucptype queuelen"
  331.       if test " $hostname" = " y"
  332. ***************
  333. *** 901,905 ****
  334.       if test " $ranlib" = " y"
  335.       then
  336. !         echo "make ../ranlibed"
  337.       fi
  338.       echo ': library done'
  339. --- 922,926 ----
  340.       if test " $ranlib" = " y"
  341.       then
  342. !         echo "make ../ranlibed || exit 1"
  343.       fi
  344.       echo ': library done'
  345. ***************
  346. *** 922,926 ****
  347.       if test " $sete" != " y"
  348.       then
  349. !         echo "make setnewsids NEWSUSER=$newsuid NEWSGROUP=$newsgid $cc $copts $postlibs"
  350.       fi
  351.       echo "for dir in $pgmdirs"
  352. --- 943,947 ----
  353.       if test " $sete" != " y"
  354.       then
  355. !         echo "make setnewsids NEWSUSER=$newsuid NEWSGROUP=$newsgid $cc $copts $postlibs || exit 1"
  356.       fi
  357.       echo "for dir in $pgmdirs"
  358. ***************
  359. *** 927,931 ****
  360.       echo "do"
  361.       echo "    cd ../\$dir"
  362. !     echo "    make all $dbm $cc $copts $postlibs"
  363.       echo "done"
  364.       echo ": done"
  365. --- 948,952 ----
  366.       echo "do"
  367.       echo "    cd ../\$dir"
  368. !     echo "    make all $dbm $cc $copts $postlibs || exit 1"
  369.       echo "done"
  370.       echo ": done"
  371. ***************
  372. *** 955,960 ****
  373.       fi
  374.       echo "echo '$whoami' >whoami"
  375. !     echo "echo 'general 00000 00000 y' >active"
  376. !     echo "echo 'news.announce.newusers 00000 00000 y' >>active"
  377.       echo ">errlog"
  378.       echo ">history"
  379. --- 976,981 ----
  380.       fi
  381.       echo "echo '$whoami' >whoami"
  382. !     echo "echo 'general 0000000000 0000000001 y' >active"
  383. !     echo "echo 'news.announce.newusers 0000000000 0000000001 y' >>active"
  384.       echo ">errlog"
  385.       echo ">history"
  386. ***************
  387. *** 972,976 ****
  388.   40 *    1-31 *    0-6    su news -c '$newsbin/batch/sendbatches'
  389.   59 0    1-31 *    0-6    su news -c '$newsbin/expire/doexpire'
  390. ! 45 3    1-31 *    0-6    su news -c '$newsbin/expire/superkludge comp.mail.maps'
  391.   10 8    1-31 *    0-6    su news -c '$newsbin/maint/newsdaily'
  392.   00 5,13,21    1-31 *    0-6    su news -c '$newsbin/maint/newswatch'
  393. --- 993,997 ----
  394.   40 *    1-31 *    0-6    su news -c '$newsbin/batch/sendbatches'
  395.   59 0    1-31 *    0-6    su news -c '$newsbin/expire/doexpire'
  396. ! 45 3    1-31 *    0-6    su news -c '$newsbin/expire/superkludge comp.mail.maps news.announce.newusers'
  397.   10 8    1-31 *    0-6    su news -c '$newsbin/maint/newsdaily'
  398.   00 5,13,21    1-31 *    0-6    su news -c '$newsbin/maint/newswatch'
  399. ***************
  400. *** 986,990 ****
  401.       echo "do"
  402.       echo "    cd ../\$dir"
  403. !     echo "    make bininstall BIN=$bin RBIN=$rbin $dbm"
  404.       echo "done"
  405.       echo ": done"
  406. --- 1007,1011 ----
  407.       echo "do"
  408.       echo "    cd ../\$dir"
  409. !     echo "    make bininstall BIN=$bin RBIN=$rbin $dbm || exit 1"
  410.       echo "done"
  411.       echo ": done"
  412. ***************
  413. *** 991,997 ****
  414.       echo ': installing manual pages'
  415.       echo 'cd ../man'
  416.       for chap in $chaps
  417.       do
  418. !         for f in `ls ../man | egrep "\.$chap\$"`
  419.           do
  420.               echo "cp $f $manpages/man$chap/$f"
  421. --- 1012,1022 ----
  422.       echo ': installing manual pages'
  423.       echo 'cd ../man'
  424. +     case "$doui" in
  425. +     yes)    exclude='!!nothing!!'    ;;
  426. +     no)    exclude='^postnews\.'    ;;
  427. +     esac
  428.       for chap in $chaps
  429.       do
  430. !         for f in `ls ../man | egrep -v "$exclude" | egrep "\.$chap\$"`
  431.           do
  432.               echo "cp $f $manpages/man$chap/$f"
  433. ***************
  434. *** 1018,1022 ****
  435.       echo "do"
  436.       echo "    cd ../\$dir"
  437. !     echo "    make newsinstall BIN=$bin RBIN=$rbin $dbm"
  438.       echo "done"
  439.       echo ": done"
  440. --- 1043,1047 ----
  441.       echo "do"
  442.       echo "    cd ../\$dir"
  443. !     echo "    make newsinstall BIN=$bin RBIN=$rbin $dbm || exit 1"
  444.       echo "done"
  445.       echo ": done"
  446.  
  447. *** cnpatch/tmp.file    Tue Aug 22 14:06:07 1989
  448. --- conf/config.proto    Mon Aug 14 13:23:58 1989
  449. ***************
  450. *** 3,6 ****
  451. --- 3,12 ----
  452.   #  available everywhere immediately
  453.   #
  454. + # This is not, repeat NOT, a master control file for all of C News.
  455. + # This is the shell equivalent of libcnews/config.c, a "subroutine
  456. + # library" that gives shell files access to the default settings and
  457. + # lets environment variables override the defaults.  Changing the
  458. + # defaults here will *NOT* change them throughout C News.
  459. + #
  460.   # =()<NEWSCTL=${NEWSCTL-@<NEWSCTL>@}>()=
  461.   NEWSCTL=${NEWSCTL-/usr/lib/news}
  462.  
  463. *** cnpatch/tmp.file    Tue Aug 22 14:06:11 1989
  464. --- conf/spacefor.proto    Sun Aug 20 01:08:15 1989
  465. ***************
  466. *** 37,41 ****
  467.   incoming)    arg="$NEWSARTS/in.coming" ; desire=5000 ;;
  468.   articles)    arg="$NEWSARTS" ; desire=5000 ;;
  469. ! control)    arg="$NEWSCTL" ; desire=3000 ;;
  470.   outbound)    arg="/usr/spool/uucp" ; desire=10000 ;;    # ignore $3
  471.   archive)    arg="$NEWSARTS" ; desire=1 ;;        # system-specific
  472. --- 37,41 ----
  473.   incoming)    arg="$NEWSARTS/in.coming" ; desire=5000 ;;
  474.   articles)    arg="$NEWSARTS" ; desire=5000 ;;
  475. ! control)    arg="$NEWSCTL" ; desire=3000 ;;        # for expire, mostly
  476.   outbound)    arg="/usr/spool/uucp" ; desire=10000 ;;    # ignore $3
  477.   archive)    arg="$NEWSARTS" ; desire=1 ;;        # system-specific
  478.  
  479. *** cnpatch/tmp.file    Tue Aug 22 14:06:12 1989
  480. --- conf/subst.gc    Mon Aug 21 18:43:45 1989
  481. ***************
  482. *** 16,18 ****
  483.   relay/sh/inews
  484.   rna/makefile
  485. ! relay/sh/postnews
  486. --- 16,18 ----
  487.   relay/sh/inews
  488.   rna/makefile
  489. ! rna/postnews
  490.  
  491. *** cnpatch/tmp.file    Tue Aug 22 14:06:29 1989
  492. --- doc/interface    Sat Aug 19 23:26:32 1989
  493. ***************
  494. *** 1,3 ****
  495. ! .DA "4 July 1989"
  496.   .TL
  497.   The Interface Between C News And The Outside World
  498. --- 1,3 ----
  499. ! .DA "19 Aug 1989"
  500.   .TL
  501.   The Interface Between C News And The Outside World
  502. ***************
  503. *** 130,137 ****
  504.   That is, with news's standard PATH, if
  505.   .DS
  506. ! echo hi there Joe | mail joe
  507.   .DE
  508. ! does not result in the message ``hi there Joe'' arriving in the mailbox
  509.   ``joe'', you're going to have to fake it.
  510.   See \fIDirectory Layout\fR for insight on where to put a fake \fImail\fR
  511.   so that C News components will use it rather than \fI/bin/mail\fR.
  512. --- 130,140 ----
  513.   That is, with news's standard PATH, if
  514.   .DS
  515. ! echo "relaynews: hi there Joe" | mail joe
  516.   .DE
  517. ! does not result in the message ``relaynews: hi there Joe''
  518. ! arriving in the mailbox
  519.   ``joe'', you're going to have to fake it.
  520. + (Note that some BSD mailers run into trouble with the colon in the example,
  521. + interpreting such a line as a header.)
  522.   See \fIDirectory Layout\fR for insight on where to put a fake \fImail\fR
  523.   so that C News components will use it rather than \fI/bin/mail\fR.
  524.  
  525. *** cnpatch/tmp.file    Tue Aug 22 14:06:33 1989
  526. --- expire/Makefile    Mon Aug 21 14:50:57 1989
  527. ***************
  528. *** 10,15 ****
  529.       superkludge upact doexpire mkadir
  530.   DTR = README Makefile dircheck doexpire expire.c histdups histinfo.c \
  531. !     histslash.c lowest.c mkdbm.c mkhistory pgood superkludge tgood upact \
  532. !     mkadir
  533.   # =()<NEWSARTS = @<NEWSARTS>@>()=
  534.   NEWSARTS = /usr/spool/news
  535. --- 10,16 ----
  536.       superkludge upact doexpire mkadir
  537.   DTR = README Makefile dircheck doexpire expire.c histdups histinfo.c \
  538. !     histslash.c mkdbm.c mkhistory pgood superkludge tgood upact \
  539. !     mkadir updatemin.c
  540. ! UPACT=upact
  541.   # =()<NEWSARTS = @<NEWSARTS>@>()=
  542.   NEWSARTS = /usr/spool/news
  543. ***************
  544. *** 21,37 ****
  545.   SHELL = /bin/sh
  546.   
  547. ! all:    $(THEM)
  548.       chmod +x $(THEM)
  549.   
  550. ! bininstall:    $(THEM) explist.proto
  551.       -if test ! -d $(NEWSBIN)/expire ; then mkdir $(NEWSBIN)/expire; fi
  552.       cp $(THEM) $(NEWSBIN)/expire
  553.   
  554.   newsinstall:    explist.proto
  555.       -if test ! -r $(NEWSCTL)/explist ; then cp explist.proto $(NEWSCTL)/explist ; fi
  556.   
  557. - cmp:    $(THEM)
  558. -     -for f in $(THEM) ; do cmp $$f $(NEWSBIN)/expire/$$f ; done
  559.   expire: expire.o $(LIBS)
  560.       $(CC) $(LDFLAGS) expire.o $(PRE) $(LIBS) $(DBM) $(POST) -o $@
  561. --- 22,38 ----
  562.   SHELL = /bin/sh
  563.   
  564. ! all:    $(THEM) explist.proto
  565.       chmod +x $(THEM)
  566.   
  567. ! bininstall:    $(THEM)
  568.       -if test ! -d $(NEWSBIN)/expire ; then mkdir $(NEWSBIN)/expire; fi
  569.       cp $(THEM) $(NEWSBIN)/expire
  570.   
  571. + cmp:    $(THEM)
  572. +     for f in $(THEM) ; do cmp $(NEWSBIN)/expire/$$f $$f ; done
  573.   newsinstall:    explist.proto
  574.       -if test ! -r $(NEWSCTL)/explist ; then cp explist.proto $(NEWSCTL)/explist ; fi
  575.   
  576.   expire: expire.o $(LIBS)
  577.       $(CC) $(LDFLAGS) expire.o $(PRE) $(LIBS) $(DBM) $(POST) -o $@
  578. ***************
  579. *** 40,45 ****
  580.       $(CC) $(LDFLAGS) histinfo.o $(PRE) $(LIBS) $(POST) -o $@
  581.   
  582. ! lowest:    lowest.o $(LIBS)
  583. !     $(CC) $(LDFLAGS) lowest.o $(PRE) $(LIBS) $(POST) -o $@
  584.   
  585.   histslash:    histslash.o $(LIBS)
  586. --- 41,46 ----
  587.       $(CC) $(LDFLAGS) histinfo.o $(PRE) $(LIBS) $(POST) -o $@
  588.   
  589. ! updatemin:    updatemin.o $(LIBS)
  590. !     $(CC) $(LDFLAGS) updatemin.o $(PRE) $(LIBS) $(POST) -o $@
  591.   
  592.   histslash:    histslash.o $(LIBS)
  593. ***************
  594. *** 98,102 ****
  595.       echo 'foo 00099 00001 y' >>active.after
  596.       echo 'bar 00099 00000 m' >>active
  597. !     echo 'bar 00099 00099 m' >>active.after
  598.       echo 'bar.ugh 00099 00000 m' >>active
  599.       echo 'bar.ugh 00099 00099 m' >>active.after
  600. --- 99,103 ----
  601.       echo 'foo 00099 00001 y' >>active.after
  602.       echo 'bar 00099 00000 m' >>active
  603. !     echo 'bar 00099 00100 m' >>active.after
  604.       echo 'bar.ugh 00099 00000 m' >>active
  605.       echo 'bar.ugh 00099 00099 m' >>active.after
  606. ***************
  607. *** 108,112 ****
  608.       echo 'mod.unmod 00016 00016 y' >>active.after
  609.       echo 'bletch 00099 00000 y' >>active
  610. !     echo 'bletch 00099 00099 y' >>active.after
  611.       echo '<wont1>    9999~-    foo/1' >>history.proto
  612.       echo :foo/1: >arts/foo/1
  613. --- 109,113 ----
  614.       echo 'mod.unmod 00016 00016 y' >>active.after
  615.       echo 'bletch 00099 00000 y' >>active
  616. !     echo 'bletch 00099 00100 y' >>active.after
  617.       echo '<wont1>    9999~-    foo/1' >>history.proto
  618.       echo :foo/1: >arts/foo/1
  619. ***************
  620. *** 187,191 ****
  621.   
  622.   # the regression test proper
  623. ! r:    $(THEM) dircheck setup tgood pgood
  624.       chmod +x dircheck $(THEM)
  625.       $(RUN) -c explist
  626. --- 188,192 ----
  627.   
  628.   # the regression test proper
  629. ! r:    $(THEM) $(UPACT) dircheck setup tgood pgood
  630.       chmod +x dircheck $(THEM)
  631.       $(RUN) -c explist
  632. ***************
  633. *** 213,217 ****
  634.       cmp history history.after
  635.       : "that's it for expire, on to upact"
  636. !     $(D) ./upact
  637.       cmp active active.after
  638.       : "and for upact, on to mkhistory"
  639. --- 214,218 ----
  640.       cmp history history.after
  641.       : "that's it for expire, on to upact"
  642. !     $(D) ./$(UPACT)
  643.       cmp active active.after
  644.       : "and for upact, on to mkhistory"
  645. ***************
  646. *** 230,233 ****
  647. --- 231,254 ----
  648.       : "success!"
  649.   
  650. + # variant regression test for -r
  651. + rr:    $(THEM) $(UPACT) dircheck setup tgood pgood
  652. +     chmod +x dircheck $(THEM)
  653. +     $(RUN) -p -r explist >test.out 2>test.stderr
  654. +     test ! -s test.stderr ;
  655. +     cmp test.out pgood
  656. +     cmp history.proto history
  657. +     egrep wont history.proto | ./dircheck arts
  658. +     egrep 'will|two|gone|three' history.proto | ./dircheck -n arts
  659. +     egrep will history.proto | ./dircheck arch
  660. +     egrep 'wont|two|gone|three' history.proto | ./dircheck -n arch
  661. +     egrep two history.proto | ./dircheck arch2
  662. +     egrep 'will|wont|gone|three' history.proto | ./dircheck -n arch2
  663. +     egrep three history.proto | ./dircheck arch3
  664. +     egrep 'will|wont|gone|two' history.proto | ./dircheck -n arch3
  665. +     test -f arts/foo/99 ;
  666. +     test -f arts/bar/ugh/99 ;
  667. +     test -f arch2/bar/99 ;
  668. +     test ! -f arts/urp/99 ;
  669.   tidy:
  670.       rm -f junk history history.pag history.dir history.o active
  671. ***************
  672. *** 237,242 ****
  673.   
  674.   clean:    tidy
  675. !     rm -f *.o expire histslash mkdbm histinfo lowest explist.proto
  676. !     rm -f dtr
  677.   
  678.   spotless:    clean    # don't run this unless you know what you're doing
  679. --- 258,263 ----
  680.   
  681.   clean:    tidy
  682. !     rm -f *.o expire histslash mkdbm histinfo explist.proto
  683. !     rm -f dtr updatemin
  684.   
  685.   spotless:    clean    # don't run this unless you know what you're doing
  686.  
  687. *** cnpatch/tmp.file    Tue Aug 22 14:06:35 1989
  688. --- expire/README    Sun Aug 20 01:24:03 1989
  689. ***************
  690. *** 22,28 ****
  691.   dircheck checks the results of expire regression testing.
  692.   histdups, histinfo, histslash, and mkdbm are parts of mkhistory.
  693. ! lowest is an optimized version of part of upact -- it's faster, but it's
  694.       also the only thing in C News that needs to know how to read
  695.       directories, which is a portability hassle, so it's not the default.
  696.   pgood and tgood are regression-test output-should-look-like-this files.
  697.   mkadir is what expire invokes to create archiving subdirectories.
  698. --- 22,31 ----
  699.   dircheck checks the results of expire regression testing.
  700.   histdups, histinfo, histslash, and mkdbm are parts of mkhistory.
  701. ! updatemin is a C version of upact -- it's vastly faster, but it's
  702.       also the only thing in C News that needs to know how to read
  703.       directories, which is a portability hassle, so it's not the default.
  704. +     Compile it with -DBERKDIR if you have 4BSD directory functions
  705. +     rather than standard (POSIX) ones.  "make r UPACT=updatemin"
  706. +     will include it in the regression test.
  707.   pgood and tgood are regression-test output-should-look-like-this files.
  708.   mkadir is what expire invokes to create archiving subdirectories.
  709.  
  710. *** cnpatch/tmp.file    Tue Aug 22 14:06:38 1989
  711. --- expire/expire.c    Sun Aug 20 03:21:09 1989
  712. ***************
  713. *** 75,78 ****
  714. --- 75,79 ----
  715.   int leaders = 0;        /* only first link ("leader") is hard link */
  716.   int verbose = 0;        /* report statistics */
  717. + int rebuild = 1;        /* rebuild history files */
  718.   
  719.   long nkept = 0;            /* count of articles not expired */
  720. ***************
  721. *** 165,169 ****
  722.       ftime(&ftnow);
  723.   
  724. !     while ((c = getopt(argc, argv, "pa:sF:cn:tlvd")) != EOF)
  725.           switch (c) {
  726.           case 'p':    /* print info line for archived articles */
  727. --- 166,170 ----
  728.       ftime(&ftnow);
  729.   
  730. !     while ((c = getopt(argc, argv, "pa:sF:cn:tlvrd")) != EOF)
  731.           switch (c) {
  732.           case 'p':    /* print info line for archived articles */
  733. ***************
  734. *** 194,197 ****
  735. --- 195,201 ----
  736.               verbose = 1;
  737.               break;
  738. +         case 'r':    /* suppress history-file rebuild */
  739. +             rebuild = 0;
  740. +             break;
  741.           case 'd':    /* debug */
  742.               expdebug = 1;
  743. ***************
  744. *** 431,444 ****
  745.       if (old < 0)
  746.           fail("cannot open `%s'", "history");
  747. !     (void) unlink("history.n");
  748. !     (void) unlink("history.n.dir");
  749. !     (void) unlink("history.n.pag");
  750. !     if (spacetight)
  751. !         (void) unlink("history.o");
  752. !     new = eufopen("history.n", "w");
  753. !     (void) fclose(eufopen("history.n.dir", "w"));
  754. !     (void) fclose(eufopen("history.n.pag", "w"));
  755. !     if (dbminit("history.n") < 0)
  756. !         fail("dbminit(history.n) failed", "");
  757.   
  758.       cd(artfile((char *)NULL));
  759. --- 435,450 ----
  760.       if (old < 0)
  761.           fail("cannot open `%s'", "history");
  762. !     if (rebuild) {
  763. !         (void) unlink("history.n");
  764. !         (void) unlink("history.n.dir");
  765. !         (void) unlink("history.n.pag");
  766. !         if (spacetight)
  767. !             (void) unlink("history.o");
  768. !         new = eufopen("history.n", "w");
  769. !         (void) fclose(eufopen("history.n.dir", "w"));
  770. !         (void) fclose(eufopen("history.n.pag", "w"));
  771. !         if (dbminit("history.n") < 0)
  772. !             fail("dbminit(history.n) failed", "");
  773. !     }
  774.   
  775.       cd(artfile((char *)NULL));
  776. ***************
  777. *** 445,449 ****
  778.       while ((line = readline(old)) != NULL) {
  779.           line = doline(line);
  780. !         if (line != NULL) {
  781.               /* extract the message-id */
  782.               nameend = strchr(line, '\t');
  783. --- 451,455 ----
  784.       while ((line = readline(old)) != NULL) {
  785.           line = doline(line);
  786. !         if (line != NULL && rebuild) {
  787.               /* extract the message-id */
  788.               nameend = strchr(line, '\t');
  789. ***************
  790. *** 469,474 ****
  791.               fputs(line, new);
  792.               putc('\n', new);
  793. -             free(line);
  794.           }
  795.       }
  796.       /* side effect of readline() == NULL:  newslock() */
  797. --- 475,481 ----
  798.               fputs(line, new);
  799.               putc('\n', new);
  800.           }
  801. +         if (line != NULL)
  802. +             free(line);
  803.       }
  804.       /* side effect of readline() == NULL:  newslock() */
  805. ***************
  806. *** 475,504 ****
  807.   
  808.       (void) close(old);
  809. !     eufclose(new, "history.n");
  810.   
  811.       if (testing)
  812.           return;
  813. !     cd(ctlfile((char *)NULL));
  814. !     (void) unlink("history.o");
  815. !     if (link("history", "history.o") < 0)
  816. !         fail("can't move history", "");
  817. !     if (unlink("history") < 0)
  818. !         fail("can't finish moving history", "");
  819. !     if (link("history.n", "history") < 0)
  820. !         fail("disaster -- can't reinstate history!", "");
  821. !     if (unlink("history.n") < 0)
  822. !         fail("disaster -- can't unlink history.n!", "");
  823. !     if (unlink("history.dir") < 0)
  824. !         fail("disaster -- can't unlink history.dir!", "");
  825. !     if (unlink("history.pag") < 0)
  826. !         fail("disaster -- can't unlink history.pag!", "");
  827. !     if (link("history.n.dir", "history.dir") < 0)
  828. !         fail("disaster -- can't reinstate history.dir!", "");
  829. !     if (link("history.n.pag", "history.pag") < 0)
  830. !         fail("disaster -- can't reinstate history.pag!", "");
  831. !     if (unlink("history.n.dir") < 0)
  832. !         fail("disaster -- can't unlink history.n.dir!", "");
  833. !     if (unlink("history.n.pag") < 0)
  834. !         fail("disaster -- can't unlink history.n.pag!", "");
  835.   }
  836.   
  837. --- 482,514 ----
  838.   
  839.       (void) close(old);
  840. !     if (rebuild)
  841. !         eufclose(new, "history.n");
  842.   
  843.       if (testing)
  844.           return;
  845. !     if (rebuild) {
  846. !         cd(ctlfile((char *)NULL));
  847. !         (void) unlink("history.o");
  848. !         if (link("history", "history.o") < 0)
  849. !             fail("can't move history", "");
  850. !         if (unlink("history") < 0)
  851. !             fail("can't finish moving history", "");
  852. !         if (link("history.n", "history") < 0)
  853. !             fail("disaster -- can't reinstate history!", "");
  854. !         if (unlink("history.n") < 0)
  855. !             fail("disaster -- can't unlink history.n!", "");
  856. !         if (unlink("history.dir") < 0)
  857. !             fail("disaster -- can't unlink history.dir!", "");
  858. !         if (unlink("history.pag") < 0)
  859. !             fail("disaster -- can't unlink history.pag!", "");
  860. !         if (link("history.n.dir", "history.dir") < 0)
  861. !             fail("disaster -- can't reinstate history.dir!", "");
  862. !         if (link("history.n.pag", "history.pag") < 0)
  863. !             fail("disaster -- can't reinstate history.pag!", "");
  864. !         if (unlink("history.n.dir") < 0)
  865. !             fail("disaster -- can't unlink history.n.dir!", "");
  866. !         if (unlink("history.n.pag") < 0)
  867. !             fail("disaster -- can't unlink history.n.pag!", "");
  868. !     }
  869.   }
  870.   
  871.  
  872. *** cnpatch/tmp.file    Tue Aug 22 14:06:42 1989
  873. --- expire/histinfo.c    Tue Aug 22 13:48:05 1989
  874. ***************
  875. *** 67,71 ****
  876.   char *inname;
  877.   {
  878. !     char *nl, *files;
  879.       char line[MAXLINE], msgid[MAXLINE], expiry[MAXLINE];
  880.       char datercv[30];
  881. --- 67,71 ----
  882.   char *inname;
  883.   {
  884. !     char *nl, *name;
  885.       char line[MAXLINE], msgid[MAXLINE], expiry[MAXLINE];
  886.       char datercv[30];
  887. ***************
  888. *** 74,77 ****
  889. --- 74,78 ----
  890.       static char expnm[] =    "Expires: ";
  891.       register char *p;
  892. +     static char trash[] = "<swill@trash>";
  893.       extern char *strrchr();
  894.       extern char *strchr();
  895. ***************
  896. *** 80,84 ****
  897.       /* set defaults */
  898.       (void) strcpy(expiry, "-");
  899. !     (void) strcpy(msgid, "<swill@trash>");
  900.   
  901.       /* read until EOF or blank line (end of headers) */
  902. --- 81,85 ----
  903.       /* set defaults */
  904.       (void) strcpy(expiry, "-");
  905. !     (void) strcpy(msgid, trash);
  906.   
  907.       /* read until EOF or blank line (end of headers) */
  908. ***************
  909. *** 93,100 ****
  910.   
  911.       /* generate the file name */
  912. !     files = inname;
  913. !     if (strncmp(files, spdir, spdirlen) == 0 &&
  914. !         files[spdirlen] == '/')
  915. !         files += spdirlen + 1;    /* skip spool dir. & slash */
  916.   
  917.       /* generate the date received */
  918. --- 94,101 ----
  919.   
  920.       /* generate the file name */
  921. !     name = inname;
  922. !     if (strncmp(name, spdir, spdirlen) == 0 &&
  923. !         name[spdirlen] == '/')
  924. !         name += spdirlen + 1;    /* skip spool dir. & slash */
  925.   
  926.       /* generate the date received */
  927. ***************
  928. *** 106,109 ****
  929. --- 107,116 ----
  930.           *p = ' ';
  931.   
  932. +     /* deal with empty and trash articles */
  933. +     if (strcmp(msgid, trash) == 0) {
  934. +         (void) sprintf(msgid, "<%s@trash>", name);
  935. +         (void) sprintf(datercv, "0");        /* expire at once */
  936. +     }
  937.       /* whomp out the history line */
  938.       (void) fputs(msgid, stdout);
  939. ***************
  940. *** 113,117 ****
  941.       (void) fputs(expiry, stdout);
  942.       (void) putchar('\t');
  943. !     (void) fputs(files, stdout);
  944.       (void) putchar('\n');
  945.       (void) fflush(stdout);
  946. --- 120,124 ----
  947.       (void) fputs(expiry, stdout);
  948.       (void) putchar('\t');
  949. !     (void) fputs(name, stdout);
  950.       (void) putchar('\n');
  951.       (void) fflush(stdout);
  952.  
  953. *** cnpatch/tmp.file    Tue Aug 22 14:06:46 1989
  954. --- expire/mkdbm.c    Sun Aug 20 00:45:54 1989
  955. ***************
  956. *** 25,29 ****
  957.       close(creat("hist.dir", 0666));
  958.       close(creat("hist.pag", 0666));
  959. !     dbminit("hist");
  960.   
  961.       for (;;) {
  962. --- 25,30 ----
  963.       close(creat("hist.dir", 0666));
  964.       close(creat("hist.pag", 0666));
  965. !     if (dbminit("hist") < 0)
  966. !         error("unable to do dbminit(\"hist\")", "");
  967.   
  968.       for (;;) {
  969.  
  970. *** cnpatch/tmp.file    Tue Aug 22 14:06:47 1989
  971. --- expire/mkhistory    Tue Aug 22 14:04:51 1989
  972. ***************
  973. *** 27,35 ****
  974.   
  975.   cd $NEWSCTL
  976. ! if egrep '^<swill@trash>    ' history.n >/dev/null
  977.   then
  978. !     echo "$0: <swill@trash> found in history.n -- aborting" >&2
  979. !     echo "$0: (some article lacks a Message-ID)" >&2
  980. !     exit 1
  981.   fi
  982.   mkdbm <history.n
  983. --- 27,34 ----
  984.   
  985.   cd $NEWSCTL
  986. ! if egrep '^<[^>]*@trash>    ' history.n >/dev/null
  987.   then
  988. !     echo "$0: (warning) empty/trash articles found, will expire at once" >&2
  989. !     echo "$0:     (grep history file for '@trash' to see them)" >&2
  990.   fi
  991.   mkdbm <history.n
  992.  
  993. *** cnpatch/tmp.file    Tue Aug 22 14:06:51 1989
  994. --- expire/upact    Sun Aug 20 00:37:04 1989
  995. ***************
  996. *** 39,47 ****
  997.       if test -d $NEWSARTS/$dir
  998.       then
  999. -         # min=`lowest $NEWSARTS/$dir`
  1000.           min=`ls $NEWSARTS/$dir | egrep '^[0-9]+$' | sort -nr | tail -1`
  1001.       fi
  1002. !     case "$min" in        # no files, so
  1003. !     "")    min=$max ;;    # use maximum
  1004.       esac
  1005.       case "$min" in
  1006. --- 39,46 ----
  1007.       if test -d $NEWSARTS/$dir
  1008.       then
  1009.           min=`ls $NEWSARTS/$dir | egrep '^[0-9]+$' | sort -nr | tail -1`
  1010.       fi
  1011. !     case "$min" in        # no files, so use max+1
  1012. !     "")    min=`awk "END{ print $max + 1 }" /dev/null`    ;;
  1013.       esac
  1014.       case "$min" in
  1015.  
  1016. *** cnpatch/tmp.file    Tue Aug 22 14:07:03 1989
  1017. --- input/Makefile    Tue Aug  8 12:24:05 1989
  1018. ***************
  1019. *** 25,32 ****
  1020.       rnews.8 bdecode.c recenews recpnews
  1021.   
  1022. ! all:    $(THEM) rnews
  1023. !     chmod +x $(THEM) rnews
  1024.   
  1025. ! bininstall:    $(THEM) rnews
  1026.       -if test ! -d $(NEWSBIN)/input ; then mkdir $(NEWSBIN)/input ; fi
  1027.       rm -f $(NEWSBIN)/input/newsspool
  1028. --- 25,32 ----
  1029.       rnews.8 bdecode.c recenews recpnews
  1030.   
  1031. ! all:    $(THEM)
  1032. !     chmod +x $(THEM)
  1033.   
  1034. ! bininstall:    $(THEM)
  1035.       -if test ! -d $(NEWSBIN)/input ; then mkdir $(NEWSBIN)/input ; fi
  1036.       rm -f $(NEWSBIN)/input/newsspool
  1037. ***************
  1038. *** 35,38 ****
  1039. --- 35,44 ----
  1040.       cp rnews $(RBIN)/cunbatch
  1041.       : "and newsspool needs to be made setuid-news"
  1042. + cmp:    $(THEM)
  1043. +     for f in $(THEM) ; do cmp $(NEWSBIN)/input/$$f $$f ; done
  1044. +     cmp rnews $(RBIN)/rnews
  1045. +     cmp rnews $(RBIN)/cunbatch
  1046. +     ls -lg $(NEWSBIN)/input/newsspool | egrep -s '^-rwsrwsr-x  1 news     news'
  1047.   
  1048.   newsinstall:
  1049.  
  1050. *** cnpatch/tmp.file    Tue Aug 22 14:07:06 1989
  1051. --- input/newsrun    Wed Aug  9 16:01:45 1989
  1052. ***************
  1053. *** 35,39 ****
  1054.       server=`cat $NEWSCTL/server`
  1055.   else
  1056. !     me=me            # don't need actual name
  1057.       server="$me"        # no server file --> we're it
  1058.   fi
  1059. --- 35,39 ----
  1060.       server=`cat $NEWSCTL/server`
  1061.   else
  1062. !     me=thishost        # don't need actual name
  1063.       server="$me"        # no server file --> we're it
  1064.   fi
  1065. ***************
  1066. *** 62,65 ****
  1067. --- 62,66 ----
  1068.   
  1069.       # Do it.
  1070. +     tmp=nruntmp.$$
  1071.       rmlist=
  1072.       for f in $them
  1073. ***************
  1074. *** 68,89 ****
  1075.           if test -r stop
  1076.           then
  1077. !             rm -f $rmlist
  1078.               exit 0
  1079.           fi
  1080.   
  1081. -         # Check for empty.
  1082. -         if test ! -s $f
  1083. -         then
  1084. -             rm -f $f
  1085. -             continue            # NOTE CONTINUE
  1086. -         fi
  1087.           # Space check, if we're close.
  1088.           if test " $muchroom" != " y"
  1089.           then
  1090.               batchsize=`sizeof $f`
  1091.               if test " `spacefor $batchsize articles`" -le 0
  1092.               then
  1093. !                 rm -f $rmlist
  1094.                   exit 0
  1095.               fi
  1096. --- 69,85 ----
  1097.           if test -r stop
  1098.           then
  1099. !             rm -f $tmp $rmlist
  1100.               exit 0
  1101.           fi
  1102.   
  1103.           # Space check, if we're close.
  1104.           if test " $muchroom" != " y"
  1105.           then
  1106. +             rm -f $tmp $rmlist    # free up what we can
  1107. +             rmlist=
  1108.               batchsize=`sizeof $f`
  1109.               if test " `spacefor $batchsize articles`" -le 0
  1110.               then
  1111. !                 # already removed $tmp $rmlist
  1112.                   exit 0
  1113.               fi
  1114. ***************
  1115. *** 93,109 ****
  1116.           # uncompressed batches and never use c7 encoding might
  1117.           # want to remove the c7decode attempt to speed things up.
  1118. !         text=nruntmp.$$
  1119.           if compress -d <$f >$text 2>/dev/null
  1120.           then
  1121. !             rmlist="$rmlist $f $text"
  1122.           elif c7decode <$f 2>/dev/null | compress -d >$text 2>/dev/null
  1123.           then
  1124. !             rmlist="$rmlist $f $text"
  1125.           else
  1126. -             rm -f $text
  1127.               text=$f
  1128. -             rmlist="$rmlist $f"
  1129.           fi
  1130.   
  1131.           # Do it.  -r redirects stdout and stderr into logs.  -n makes
  1132.           # history entries for refused articles; this is right for
  1133. --- 89,110 ----
  1134.           # uncompressed batches and never use c7 encoding might
  1135.           # want to remove the c7decode attempt to speed things up.
  1136. !         text=$tmp
  1137.           if compress -d <$f >$text 2>/dev/null
  1138.           then
  1139. !             : okay
  1140.           elif c7decode <$f 2>/dev/null | compress -d >$text 2>/dev/null
  1141.           then
  1142. !             : okay
  1143.           else
  1144.               text=$f
  1145.           fi
  1146. +         rmlist="$rmlist $f"
  1147.   
  1148. +         # Check for empty.
  1149. +         if test ! -s $text
  1150. +         then
  1151. +             continue            # NOTE CONTINUE
  1152. +         fi
  1153.           # Do it.  -r redirects stdout and stderr into logs.  -n makes
  1154.           # history entries for refused articles; this is right for
  1155. ***************
  1156. *** 138,142 ****
  1157.                   mv $f $bad    # Not $text, save the ORIGINAL!
  1158.               fi
  1159. !             echo "$server $consumer \`$bad' failed, status $st" |
  1160.                               mail "$NEWSMASTER"
  1161.           fi
  1162. --- 139,143 ----
  1163.                   mv $f $bad    # Not $text, save the ORIGINAL!
  1164.               fi
  1165. !             echo "$server relaynews \`$bad' failed, status $st" |
  1166.                               mail "$NEWSMASTER"
  1167.           fi
  1168. ***************
  1169. *** 143,147 ****
  1170.   
  1171.       done
  1172. !     rm -f $rmlist
  1173.   done
  1174.   
  1175. --- 144,148 ----
  1176.   
  1177.       done
  1178. !     rm -f $tmp $rmlist
  1179.   done
  1180.   
  1181.  
  1182. *** cnpatch/tmp.file    Tue Aug 22 14:07:08 1989
  1183. --- input/newsspool.c    Sun Aug 20 00:43:48 1989
  1184. ***************
  1185. *** 197,202 ****
  1186.       extern int errno;
  1187.   
  1188. !     if (fclose(f) == EOF)
  1189. !         error("fclose error on file `%s'", tmpname);
  1190.   
  1191.       p = fullartfile("in.coming/");
  1192. --- 197,202 ----
  1193.       extern int errno;
  1194.   
  1195. !     if (nfclose(f) == EOF)
  1196. !         error("close error on file `%s'", tmpname);
  1197.   
  1198.       p = fullartfile("in.coming/");
  1199.  
  1200. *** cnpatch/tmp.file    Tue Aug 22 14:07:49 1989
  1201. --- man/inews.1    Sun Aug  6 00:42:31 1989
  1202. ***************
  1203. *** 7,11 ****
  1204.   .\" =()<.ds m @<NEWSMASTER>@>()=
  1205.   .ds m usenet
  1206. ! .TH INEWS 1 "6 July 1989" "C News"
  1207.   .SH NAME
  1208.   inews \- `user-friendly' news-posting front-end for relaynews
  1209. --- 7,11 ----
  1210.   .\" =()<.ds m @<NEWSMASTER>@>()=
  1211.   .ds m usenet
  1212. ! .TH INEWS 1 "6 Aug 1989" "C News"
  1213.   .SH NAME
  1214.   inews \- `user-friendly' news-posting front-end for relaynews
  1215. ***************
  1216. *** 177,185 ****
  1217.   and
  1218.   .B \-C
  1219. ! generates
  1220. ! .BI "Control: newgroup" " newsgroup"
  1221. ! and
  1222. ! .BI "Newsgroups:" " newsgroup"
  1223. ! headers.
  1224.   .SH FILES
  1225.   .PD 0
  1226. --- 177,186 ----
  1227.   and
  1228.   .B \-C
  1229. ! tells you to use
  1230. ! .I addgroup
  1231. ! for local group creations
  1232. ! and tells you what to feed to
  1233. ! .B "inews -h"
  1234. ! for global ones.
  1235.   .SH FILES
  1236.   .PD 0
  1237. ***************
  1238. *** 213,217 ****
  1239.   .SH "SEE ALSO"
  1240.   .IR mail (1),
  1241. ! .IR rnews (1)
  1242.   .SH DIAGNOSTICS
  1243.   .I inews
  1244. --- 214,219 ----
  1245.   .SH "SEE ALSO"
  1246.   .IR mail (1),
  1247. ! .IR rnews (1),
  1248. ! .IR newsaux (8)
  1249.   .SH DIAGNOSTICS
  1250.   .I inews
  1251.  
  1252. *** cnpatch/tmp.file    Tue Aug 22 14:07:51 1989
  1253. --- man/newsaux.8    Sat Aug 19 23:10:27 1989
  1254. ***************
  1255. *** 7,11 ****
  1256.   .\" =()<.ds m @<NEWSMASTER>@>()=
  1257.   .ds m usenet
  1258. ! .TH NEWSAUX 8 "4 July 1989" "C News"
  1259.   .SH NAME
  1260.   spacefor \- check available space for news
  1261. --- 7,11 ----
  1262.   .\" =()<.ds m @<NEWSMASTER>@>()=
  1263.   .ds m usenet
  1264. ! .TH NEWSAUX 8 "19 Aug 1989" "C News"
  1265.   .SH NAME
  1266.   spacefor \- check available space for news
  1267. ***************
  1268. *** 34,37 ****
  1269. --- 34,39 ----
  1270.   .br
  1271.   addgroup, delgroup \- add and delete newsgroups, locally only
  1272. + .br
  1273. + adddirs \- make any missing directories for active newsgroups
  1274.   .SH SYNOPSIS
  1275.   .B \*b/spacefor
  1276. ***************
  1277. *** 79,82 ****
  1278. --- 81,86 ----
  1279.   .B \*b/maint/delgroup
  1280.   group
  1281. + .br
  1282. + .B \*b/maint/adddirs
  1283.   .SH DESCRIPTION
  1284.   These programs are minor utilities used by various parts of C News.
  1285. ***************
  1286. *** 180,183 ****
  1287. --- 184,197 ----
  1288.   The effect is purely local; no control message (to propagate the
  1289.   change to other machines) is sent.
  1290. + .PP
  1291. + .I Adddirs
  1292. + sweeps through the \fIactive\fR file checking that directories exist for
  1293. + all newsgroups.
  1294. + (\fIRelaynews\fR
  1295. + will create directories as needed, but some
  1296. + user-interface software gets upset if a newsgroup exists but its directory
  1297. + does not.)
  1298. + This is mostly useful when adding groups in bulk, based on another site's
  1299. + \fIactive\fR file.
  1300.   .SH FILES
  1301.   .ta 6c
  1302. ***************
  1303. *** 217,220 ****
  1304. --- 231,238 ----
  1305.   are unfortunately somewhat system-specific, since \fIdf\fR output and
  1306.   \fIuucp\fR file layout vary between different versions.
  1307. + .PP
  1308. + .I Queuelen
  1309. + probably ought to count bytes rather than batches, but that would make
  1310. + its system-dependency even worse.
  1311.   .PP
  1312.   The need for \fIsizeof\fR and \fInewslock\fR is a botch.
  1313.  
  1314. *** cnpatch/tmp.file    Tue Aug 22 14:07:52 1989
  1315. --- man/newsbatch.8    Sun Aug 20 03:24:09 1989
  1316. ***************
  1317. *** 7,11 ****
  1318.   .\" =()<.ds m @<NEWSMASTER>@>()=
  1319.   .ds m usenet
  1320. ! .TH NEWSBATCH 8 "17 July 1989" "C News"
  1321.   .SH NAME
  1322.   sendbatches, batchsplit \- news batching to other sites
  1323. --- 7,11 ----
  1324.   .\" =()<.ds m @<NEWSMASTER>@>()=
  1325.   .ds m usenet
  1326. ! .TH NEWSBATCH 8 "19 Aug 1989" "C News"
  1327.   .SH NAME
  1328.   sendbatches, batchsplit \- news batching to other sites
  1329. ***************
  1330. *** 17,21 ****
  1331.   c7encode, bencode \- compressed-news-batch encoding
  1332.   .br
  1333. ! viauux, viainews, viamail, viapmail \- news-batch transmission
  1334.   .SH SYNOPSIS
  1335.   .B \*b/batch/sendbatches
  1336. --- 17,23 ----
  1337.   c7encode, bencode \- compressed-news-batch encoding
  1338.   .br
  1339. ! viauux, viauuxz, viainews \- news-batch transmission
  1340. ! .br
  1341. ! viamail, viaemail, viapmail \- news-batch transmission via mail
  1342.   .SH SYNOPSIS
  1343.   .B \*b/batch/sendbatches
  1344. ***************
  1345. *** 63,66 ****
  1346. --- 65,71 ----
  1347.   .B \&.../viauux
  1348.   site
  1349. + .br    
  1350. + .B \&.../viauuxz
  1351. + site
  1352.   .br
  1353.   .B \&.../viainews
  1354. ***************
  1355. *** 70,73 ****
  1356. --- 75,81 ----
  1357.   site
  1358.   .br
  1359. + .B \&.../viaemail
  1360. + site
  1361. + .br
  1362.   .B \&.../viapmail
  1363.   site
  1364. ***************
  1365. *** 202,205 ****
  1366. --- 210,216 ----
  1367.   .IP viauux 9
  1368.   normal transmission via UUCP
  1369. + .IP viauuxz
  1370. + like \fIviauux\fR except with \fB\-z\fR option given to \fIuux\fR
  1371. + (for old UUCPs where don't-report-result-on-zero-status is not default)
  1372.   .IP viainews
  1373.   feed the batch back to \fIinews\fR, ignoring the \fIsite\fR argument
  1374. ***************
  1375. *** 207,210 ****
  1376. --- 218,223 ----
  1377.   .IP viamail
  1378.   mail the batch to \fIsite\fB!rnews\fR
  1379. + .IP viaemail
  1380. + mail the batch to \fIsite\fB!enews\fR
  1381.   .IP viapmail
  1382.   mail the batch to \fIsite\fB!rnews\fR, attempting to
  1383. ***************
  1384. *** 266,268 ****
  1385.   .PP
  1386.   \fIViapmail\fR is obsolescent;
  1387. ! \fIviamail\fR with a batch encoded with \fIbencode\fR is vastly superior.
  1388. --- 279,281 ----
  1389.   .PP
  1390.   \fIViapmail\fR is obsolescent;
  1391. ! \fIviaemail\fR with a batch encoded with \fIbencode\fR is vastly superior.
  1392.  
  1393. *** cnpatch/tmp.file    Tue Aug 22 14:07:56 1989
  1394. --- misc/Makefile    Sat Aug 19 20:43:05 1989
  1395. ***************
  1396. *** 12,16 ****
  1397.   
  1398.   MAINTBIN=newshist
  1399. ! MAINT = $(MAINTBIN) newsdaily newswatch newsboot locknews addgroup delgroup
  1400.   UTILBIN = gngp newslock ctime getdate
  1401.   UTILS = $(UTILBIN) sizeof newshostname
  1402. --- 12,16 ----
  1403.   
  1404.   MAINTBIN=newshist
  1405. ! MAINT = $(MAINTBIN) newsdaily newswatch newsboot locknews addgroup delgroup adddirs
  1406.   UTILBIN = gngp newslock ctime getdate
  1407.   UTILS = $(UTILBIN) sizeof newshostname
  1408. ***************
  1409. *** 26,29 ****
  1410. --- 26,33 ----
  1411.       cp $(MAINT) $(NEWSBIN)/maint
  1412.       cp $(UTILS) $(NEWSBIN)
  1413. + cmp:    $(THEM)
  1414. +     for f in $(MAINT) ; do cmp $(NEWSBIN)/maint/$$f $$f ; done
  1415. +     for f in $(UTILS) ; do cmp $(NEWSBIN)/$$f $$f ; done
  1416.   
  1417.   newsinstall:
  1418.  
  1419. *** cnpatch/tmp.file    Tue Aug 22 14:08:00 1989
  1420. --- misc/addgroup    Wed Aug 16 15:52:50 1989
  1421. ***************
  1422. *** 48,52 ****
  1423.   done
  1424.   
  1425. ! echo "$1 0000000000 0000000000 $2" >>$NEWSCTL/active
  1426.   mkpdir $NEWSARTS/`echo $1 | tr . /`
  1427.   
  1428. --- 48,52 ----
  1429.   done
  1430.   
  1431. ! echo "$1 0000000000 0000000001 $2" >>$NEWSCTL/active
  1432.   mkpdir $NEWSARTS/`echo $1 | tr . /`
  1433.   
  1434.  
  1435. *** cnpatch/tmp.file    Tue Aug 22 14:08:04 1989
  1436. --- misc/newsdaily    Sat Aug 19 20:34:19 1989
  1437. ***************
  1438. *** 53,70 ****
  1439.   # look for input anomalies
  1440.   cd $NEWSARTS/in.coming
  1441. ! them="`ls | egrep -v '^bad$'`"
  1442. ! if test " $them" != " "
  1443.   then
  1444. !     find $them -mtime +1 -print >$tmp    # old non-bad files lying about
  1445. !     if test -s $tmp
  1446. !     then
  1447. !         (
  1448. !             echo 'old input files:'
  1449. !             cat $tmp
  1450. !             echo
  1451. !         ) >>$gripes
  1452. !     fi
  1453.   fi
  1454. ! find bad -type f -mtime -2 -print >$tmp        # recent bad batches
  1455.   if test -s $tmp
  1456.   then
  1457. --- 53,66 ----
  1458.   # look for input anomalies
  1459.   cd $NEWSARTS/in.coming
  1460. ! find . -type f -mtime +1 -print | sed 's;^\./;;' | egrep -v '^bad/' >$tmp
  1461. ! if test -s $tmp        # old non-bad files lying about
  1462.   then
  1463. !     (
  1464. !         echo 'old input files:'
  1465. !         cat $tmp
  1466. !         echo
  1467. !     ) >>$gripes
  1468.   fi
  1469. ! find bad -type f -name '[0-9]*' -mtime -2 -print >$tmp    # recent bad batches
  1470.   if test -s $tmp
  1471.   then
  1472. ***************
  1473. *** 75,83 ****
  1474.       ) >>$gripes
  1475.   fi
  1476. ! find bad -type f -mtime +7 -exec rm -f '{}' ';'
  1477.   
  1478.   # look for output anomalies
  1479.   cd $NEWSARTS/out.going
  1480. ! find * -type f -name 'togo*' -size +0 -mtime +1 -print >$tmp
  1481.   if test -s $tmp
  1482.   then
  1483. --- 71,79 ----
  1484.       ) >>$gripes
  1485.   fi
  1486. ! find bad -type f -name '[0-9]*' -mtime +7 -exec rm -f '{}' ';'
  1487.   
  1488.   # look for output anomalies
  1489.   cd $NEWSARTS/out.going
  1490. ! find . -type f -name 'togo*' -size +0 -mtime +1 -print >$tmp
  1491.   if test -s $tmp
  1492.   then
  1493. ***************
  1494. *** 84,88 ****
  1495.       (
  1496.           echo 'batching possibly stalled for sites:'
  1497. !         sed 's;/.*;;' $tmp | sort -u
  1498.           echo
  1499.       ) >>$gripes
  1500. --- 80,97 ----
  1501.       (
  1502.           echo 'batching possibly stalled for sites:'
  1503. !         sed 's;^\./\([^/]*\)/.*;\1;' $tmp | sort -u
  1504. !         echo
  1505. !     ) >>$gripes
  1506. ! fi
  1507. ! # look for unknown newsgroups on input (misses cross-posted articles)
  1508. ! cd $NEWSCTL
  1509. ! egrep '`' log.o | egrep junked | sed 's/.*`\(.*\)'"'"'.*/\1/' | sort |
  1510. !     uniq -c | sort -nr | sed 5q >$tmp
  1511. ! if test -s $tmp
  1512. ! then
  1513. !     (
  1514. !         echo 'leading five unknown newsgroups by number of articles:'
  1515. !         cat $tmp
  1516.           echo
  1517.       ) >>$gripes
  1518.  
  1519. *** cnpatch/tmp.file    Tue Aug 22 14:08:19 1989
  1520. --- relay/README    Mon Aug 21 18:45:01 1989
  1521. ***************
  1522. *** 11,15 ****
  1523.   ctl    control-message shell files
  1524.   altctl    alternative, not recommended, versions of rmgroup and sendgroups
  1525. ! sh    shell files, including inews and postnews and their flunkies
  1526.   regress    regression-test facilities for relaynews
  1527.   
  1528. --- 11,15 ----
  1529.   ctl    control-message shell files
  1530.   altctl    alternative, not recommended, versions of rmgroup and sendgroups
  1531. ! sh    shell files, including inews and its flunkies
  1532.   regress    regression-test facilities for relaynews
  1533.   
  1534.  
  1535. *** cnpatch/tmp.file    Tue Aug 22 14:08:32 1989
  1536. --- relay/control.c    Sat Aug  5 23:32:52 1989
  1537. ***************
  1538. *** 186,189 ****
  1539. --- 186,190 ----
  1540.           (void) fprintf(stderr,
  1541.               "%s: control `%s' looks unsafe to execute\n", progname, ctlcmd);
  1542. +         (void) fflush(stderr);
  1543.           _exit(1);
  1544.       }
  1545. ***************
  1546. *** 193,196 ****
  1547. --- 194,198 ----
  1548.       if (cmd == NULL) {
  1549.           warning("can't allocate memory in runctlmsg", "");
  1550. +         (void) fflush(stderr);
  1551.           _exit(1);
  1552.       }
  1553. ***************
  1554. *** 228,231 ****
  1555. --- 230,234 ----
  1556.       if (mailcmd == NULL) {
  1557.           warning("can't allocate memory in bombctlmsg", "");
  1558. +         (void) fflush(stderr);
  1559.           _exit(1);
  1560.       }
  1561. ***************
  1562. *** 237,240 ****
  1563. --- 240,244 ----
  1564.           "%s: control message `%s' exited with status 0%o\n",
  1565.           progname, cmd, cmdstat);
  1566. +     (void) fflush(mailf);
  1567.       if (mailf != stderr)
  1568.           (void) pclose(mailf);
  1569.  
  1570. *** cnpatch/tmp.file    Tue Aug 22 14:08:35 1989
  1571. --- relay/ctl/newgroup    Wed Aug 16 15:53:05 1989
  1572. ***************
  1573. *** 47,51 ****
  1574.       *)        flag=y ;;
  1575.       esac
  1576. !     echo "$1 0000000000 0000000000 $flag" >>$NEWSCTL/active
  1577.       (echo "$1 `getdate now` $SENDER" >>$NEWSCTL/active.times)  # rn hook
  1578.       # make the directory since rn will bitch if it's missing
  1579. --- 47,51 ----
  1580.       *)        flag=y ;;
  1581.       esac
  1582. !     echo "$1 0000000000 0000000001 $flag" >>$NEWSCTL/active
  1583.       (echo "$1 `getdate now` $SENDER" >>$NEWSCTL/active.times)  # rn hook
  1584.       # make the directory since rn will bitch if it's missing
  1585.  
  1586. *** cnpatch/tmp.file    Tue Aug 22 14:08:44 1989
  1587. --- relay/makefile    Mon Aug 21 17:31:00 1989
  1588. ***************
  1589. *** 75,80 ****
  1590.       cp ctl/* $(NEWSBIN)/ctl
  1591.       cp aux/* $(NEWSBIN)/relay
  1592. !     ln $(NEWSBIN)/inject/postnews $(BIN)/postnews || cp sh/postnews $(BIN)
  1593.       ln $(NEWSBIN)/inject/inews $(BIN)/inews || cp sh/inews $(BIN)
  1594.   
  1595.   TODO.grep: TODO
  1596. --- 75,88 ----
  1597.       cp ctl/* $(NEWSBIN)/ctl
  1598.       cp aux/* $(NEWSBIN)/relay
  1599. !     rm -f $(BIN)/inews
  1600.       ln $(NEWSBIN)/inject/inews $(BIN)/inews || cp sh/inews $(BIN)
  1601. + cmp:    relaynews
  1602. +     cmp $(NEWSBIN)/relay/relaynews relaynews
  1603. +     ls -lg $(NEWSBIN)/relay/relaynews | egrep -s '^-rwsrwsr-x  1 news     news'
  1604. +     for f in `ls sh` ; do cmp $(NEWSBIN)/inject/$$f sh/$$f ; done
  1605. +     for f in `ls ctl` ; do cmp $(NEWSBIN)/ctl/$$f ctl/$$f ; done
  1606. +     for f in `ls aux` ; do cmp $(NEWSBIN)/relay/$$f aux/$$f ; done
  1607. +     cmp $(BIN)/inews sh/inews
  1608.   
  1609.   TODO.grep: TODO
  1610.  
  1611. *** cnpatch/tmp.file    Tue Aug 22 14:09:04 1989
  1612. --- relay/sh/defhdrs.awk    Mon Aug  7 01:49:14 1989
  1613. ***************
  1614. *** 25,28 ****
  1615. --- 25,33 ----
  1616.       sendername = "Sender:"
  1617.   
  1618. +     # nullify headers with empty contents
  1619. +     for (i in hdrval)
  1620. +         if (hdrval[i] ~ /^[^\t ]*:[\t ]*$/)
  1621. +             hdrval[i] = ""
  1622.       # fill in missing headers
  1623.       if (hdrval[typoname] != "") {    # spelling hack
  1624. ***************
  1625. *** 36,47 ****
  1626.               hdrval[msgidname] = hdrval[msgidname] " " fields[i]
  1627.       }
  1628.       if (hdrval[msgidname] == "")
  1629.           hdrval[msgidname] = msgidname " " defmsgid
  1630.       if (hdrval[orgname] == "")
  1631.           hdrval[orgname] = orgname " " deforg
  1632. -     # replace users headers (if any)
  1633. -     hdrval[datename] = datename " " defdate
  1634. -     hdrval[pathname] = pathname " " defpath
  1635.       if (hdrval[fromname] == "")
  1636.           hdrval[fromname] = fromname " " deffrom
  1637. --- 41,52 ----
  1638.               hdrval[msgidname] = hdrval[msgidname] " " fields[i]
  1639.       }
  1640. +     if (hdrval[pathname] == "")
  1641. +         hdrval[pathname] = pathname " " defpath
  1642.       if (hdrval[msgidname] == "")
  1643.           hdrval[msgidname] = msgidname " " defmsgid
  1644. +     if (hdrval[datename] == "")
  1645. +         hdrval[datename] = datename " " defdate
  1646.       if (hdrval[orgname] == "")
  1647.           hdrval[orgname] = orgname " " deforg
  1648.       if (hdrval[fromname] == "")
  1649.           hdrval[fromname] = fromname " " deffrom
  1650. ***************
  1651. *** 48,51 ****
  1652. --- 53,58 ----
  1653.       else if (hdrval[sendername] == "")
  1654.           hdrval[sendername] = sendername " " deffrom
  1655. +     # replace user's headers (if any) [this is not currently done]
  1656.   
  1657.       # snuff some headers
  1658.  
  1659. *** cnpatch/tmp.file    Tue Aug 22 14:09:05 1989
  1660. --- relay/sh/inews    Mon Aug  7 01:50:19 1989
  1661. ***************
  1662. *** 22,26 ****
  1663.   relayopts=-i            # redirect stdout to log
  1664.   
  1665. - whoami=/tmp/in$$who        # just created to determine effective uid
  1666.   input=/tmp/in$$in        # uncensored input
  1667.   inhdrs=/tmp/in$$hdr        # generated by tear: headers
  1668. --- 22,25 ----
  1669. ***************
  1670. *** 31,36 ****
  1671.   exitflag=/tmp/in$$exit        # exit status, if present
  1672.   outfile=/tmp/in$$out        # relaynews stdout
  1673.   grpok=/tmp/in$$grp        # flag file: groups okay if present
  1674. - rmlist="$inhdrs $inbody $input $censart $nglist $modroute $exitflag $outfile $grpok"
  1675.   
  1676.   umask $NEWSUMASK
  1677. --- 30,35 ----
  1678.   exitflag=/tmp/in$$exit        # exit status, if present
  1679.   outfile=/tmp/in$$out        # relaynews stdout
  1680. + rmlist="$inhdrs $inbody $input $censart $nglist $modroute $exitflag $outfile"
  1681.   grpok=/tmp/in$$grp        # flag file: groups okay if present
  1682.   
  1683.   umask $NEWSUMASK
  1684. ***************
  1685. *** 87,108 ****
  1686.       -o)    shift; ORGANIZATION="$1"; export ORGANIZATION ;;
  1687.   
  1688. !     -C)    # megakludge-o-rama
  1689. !         # first, permit only to super-users
  1690. !         >$whoami
  1691. !         case "`ls -l $whoami | awk '{print $3}'`" in
  1692. !         root)    : a winner ;;
  1693. !         *)
  1694. !             echo "$0: only super-users may create news groups" >&2
  1695. !             exit 1
  1696. !             ;;
  1697. !         esac
  1698. !         rm -f $whoami
  1699. !         shift            # skip -C to get ng as $1
  1700. !         cat <<! >>$input    # generate a control message
  1701. ! Newsgroups: $1
  1702. ! Control: newgroup $1
  1703. ! Subject: newgroup $1
  1704. ! Approved: above-user@above-host
  1705.   !
  1706.           ;;
  1707.       -*)
  1708. --- 86,103 ----
  1709.       -o)    shift; ORGANIZATION="$1"; export ORGANIZATION ;;
  1710.   
  1711. !     -C)
  1712. !         echo "$0: you either want to use addgroup (see newsaux(8)) to make" >&2
  1713. !         echo "$0: $2 locally or this to make it network-wide:" >&2
  1714. !         cat <<eg
  1715. ! inews -h <<'!'
  1716. ! Control: newgroup $2
  1717. ! Subject: newgroup $2
  1718. ! Newsgroups: $2
  1719. ! Approved: you@hostname
  1720. ! Non-empty.
  1721.   !
  1722. + eg
  1723. +         exit 1
  1724.           ;;
  1725.       -*)
  1726. ***************
  1727. *** 219,223 ****
  1728.   # n, x and (unapproved) m flags are dealt with on the spot; if none are
  1729.   # seen, the article is posted normally.
  1730. ! # escape egrep metacharacters.  In theory one could add " ' ` \
  1731.   egreppat="^(` sed -e 's/[.+*()|[]/\\\\&/g' -e 's/,/|/g' <$nglist `) "
  1732.   egrep "$egreppat" $NEWSCTL/active >/dev/null || {
  1733. --- 214,218 ----
  1734.   # n, x and (unapproved) m flags are dealt with on the spot; if none are
  1735.   # seen, the article is posted normally.
  1736. ! # escape egrep metacharacters.  In theory one could add " ' ` \ to the list.
  1737.   egreppat="^(` sed -e 's/[.+*()|[]/\\\\&/g' -e 's/,/|/g' <$nglist `) "
  1738.   egrep "$egreppat" $NEWSCTL/active >/dev/null || {
  1739. ***************
  1740. *** 233,238 ****
  1741.           [nx])
  1742.               echo "$0: sorry, $ng may not be posted to locally." >&2
  1743.               echo 1 >$exitflag
  1744. -             trap 0        # this is a child process - no cleanup
  1745.               exit 1        # dregs in /tmp/in$$*
  1746.               ;;
  1747. --- 228,233 ----
  1748.           [nx])
  1749.               echo "$0: sorry, $ng may not be posted to locally." >&2
  1750. +             trap 0        # this is a child process - no cleanup here
  1751.               echo 1 >$exitflag
  1752.               exit 1        # dregs in /tmp/in$$*
  1753.               ;;
  1754. ***************
  1755. *** 267,273 ****
  1756.                   echo "$0: mailing your article to $moderator" >&2
  1757.                   mail $moderator <$censart
  1758. !                 rm -f $rmlist
  1759.                   echo 0 >$exitflag
  1760. -                 trap 0    # this is a child process - did cleanup
  1761.                   exit 0
  1762.               fi
  1763. --- 262,267 ----
  1764.                   echo "$0: mailing your article to $moderator" >&2
  1765.                   mail $moderator <$censart
  1766. !                 trap 0    # this is a child process - no cleanup here
  1767.                   echo 0 >$exitflag
  1768.                   exit 0
  1769.               fi
  1770. ***************
  1771. *** 288,297 ****
  1772.       exit 1            # abnormal exit - cleans up, makes dead.article
  1773.   fi
  1774.   if test -f $exitflag; then
  1775.       exitstatus="`cat $exitflag`"
  1776.       case "$exitstatus" in
  1777. !     0)    trap 0 ;;    # normal exit - cleanup done, no dead.article
  1778.       esac
  1779. !     exit $exitstatus    # trap 0 will cleanup, make dead.article
  1780.   fi
  1781.   
  1782. --- 282,292 ----
  1783.       exit 1            # abnormal exit - cleans up, makes dead.article
  1784.   fi
  1785. + rm -f $grpok
  1786.   if test -f $exitflag; then
  1787.       exitstatus="`cat $exitflag`"
  1788.       case "$exitstatus" in
  1789. !     0)    rm -f $rmlist; trap 0 ;; # normal exit - cleanup, no dead.article
  1790.       esac
  1791. !     exit $exitstatus    # trap 0 may cleanup, make dead.article
  1792.   fi
  1793.   
  1794.  
  1795. *** cnpatch/tmp.file    Tue Aug 22 14:09:19 1989
  1796. --- rna/makefile    Mon Aug 21 19:31:57 1989
  1797. ***************
  1798. *** 24,28 ****
  1799.   FILES = help
  1800.   LCOMMANDS = postnews.lint uurec.lint readnews.lint uusend.lint expire.lint
  1801. ! PFILES = header.c postnews.c funcs.c active.c history.c maketime.c mtempnam.c
  1802.   RFILES = header.c readnews.c funcs.c active.c newsrc.c history.c maketime.c
  1803.   ROFILES= header.o readnews.o funcs.o active.o newsrc.o history.o maketime.o
  1804. --- 24,29 ----
  1805.   FILES = help
  1806.   LCOMMANDS = postnews.lint uurec.lint readnews.lint uusend.lint expire.lint
  1807. ! # PFILES = header.c postnews.c funcs.c active.c history.c maketime.c mtempnam.c
  1808. ! PFILES = header.c funcs.c active.c history.c maketime.c mtempnam.c
  1809.   RFILES = header.c readnews.c funcs.c active.c newsrc.c history.c maketime.c
  1810.   ROFILES= header.o readnews.o funcs.o active.o newsrc.o history.o maketime.o
  1811. ***************
  1812. *** 39,44 ****
  1813.       $(INSTALL) -c $*.sh bin 755 $@
  1814.   
  1815. ! all: readnews checknews
  1816. !     chmod +x checknews
  1817.       : warning, defs.h may not be right for your system
  1818.   
  1819. --- 40,45 ----
  1820.       $(INSTALL) -c $*.sh bin 755 $@
  1821.   
  1822. ! all: readnews checknews postnews
  1823. !     chmod +x checknews postnews
  1824.       : warning, defs.h may not be right for your system
  1825.   
  1826. ***************
  1827. *** 52,56 ****
  1828.   # bininstall: make directories, install programs
  1829.   bininstall: install
  1830. ! install: $(BINDIR)/readnews $(BINDIR)/checknews
  1831.   $(BINDIR)/readnews: readnews
  1832.       cp readnews $(BINDIR)
  1833. --- 53,57 ----
  1834.   # bininstall: make directories, install programs
  1835.   bininstall: install
  1836. ! install: $(BINDIR)/readnews $(BINDIR)/checknews $(BINDIR)/postnews
  1837.   $(BINDIR)/readnews: readnews
  1838.       cp readnews $(BINDIR)
  1839. ***************
  1840. *** 58,62 ****
  1841. --- 59,70 ----
  1842.   $(BINDIR)/checknews:    checknews
  1843.       cp checknews $(BINDIR)
  1844. + $(BINDIR)/postnews:    postnews
  1845. +     cp postnews $(BINDIR)
  1846.   
  1847. + cmp:    readnews checknews postnews
  1848. +     cmp $(BINDIR)/readnews readnews
  1849. +     cmp $(BINDIR)/checknews checknews
  1850. +     cmp $(BINDIR)/postnews postnews
  1851.   defs.h:    at.h # $C
  1852.       touch defs.h
  1853. ***************
  1854. *** 74,81 ****
  1855.   $(ROFILES): defs.h
  1856.   
  1857. ! postnews: $(BINDIR)/postnews
  1858. ! $(BINDIR)/postnews: $(PFILES) defs.h
  1859. !     $(CC) $(CFLAGS) $(PFILES) -o postnews
  1860. !     $(INSTALL) - postnews news 6711 $(BINDIR)/postnews
  1861.   
  1862.   postgroup: $(BINDIR)/postgroup
  1863. --- 82,89 ----
  1864.   $(ROFILES): defs.h
  1865.   
  1866. ! # postnews: $(BINDIR)/postnews
  1867. ! # $(BINDIR)/postnews: $(PFILES) defs.h
  1868. ! #     $(CC) $(CFLAGS) $(PFILES) -o postnews
  1869. ! #     $(INSTALL) - postnews news 6711 $(BINDIR)/postnews
  1870.   
  1871.   postgroup: $(BINDIR)/postgroup
  1872.  
  1873. Files that are new:
  1874.  
  1875. new expire/updatemin.c (patch can't create, so diff against null):
  1876. Index: expire/updatemin.c
  1877. *** cnpatch/tmp.preposterously.long.name.to.make.patch.behave.right    Tue Aug 22 14:05:42 1989
  1878. --- expire/updatemin.c    Sun Aug 20 00:53:41 1989
  1879. ***************
  1880. *** 0 ****
  1881. --- 1,211 ----
  1882. + /*
  1883. +  * updatemin - update the "min" fields in the active file
  1884. +  */
  1885. + #include <stdio.h>
  1886. + #include <sys/types.h>
  1887. + #include <string.h>
  1888. + #include <signal.h>
  1889. + #ifndef BERKDIR
  1890. + #include <dirent.h>
  1891. + #else
  1892. + #include <sys/dir.h>
  1893. + #define    dirent    direct
  1894. + #endif
  1895. + #include "config.h"
  1896. + #include "fgetmfs.h"
  1897. + #include "alloc.h"
  1898. + void fail();
  1899. + void catch();
  1900. + void slash();
  1901. + long lowest();
  1902. + char newname[] = "active.new";
  1903. + char *progname;
  1904. + extern long atol();
  1905. + /*
  1906. +  - main - parse arguments and handle options
  1907. +  */
  1908. + main(argc, argv)
  1909. + int argc;
  1910. + char *argv[];
  1911. + {
  1912. +     DIR *d;
  1913. +     register FILE *a;
  1914. +     register FILE *new;
  1915. +     char *line;
  1916. + #    define    NF    4
  1917. +     char *field[NF];
  1918. +     register int nf;
  1919. +     register long min;
  1920. +     register char *name;
  1921. +     char minstr[6];
  1922. +     progname = argv[0];
  1923. +     cd(ctlfile((char *)NULL));
  1924. +     (void) umask(newsumask());
  1925. +     catch(SIGINT);
  1926. +     catch(SIGQUIT);
  1927. +     catch(SIGHUP);
  1928. +     catch(SIGTERM);
  1929. +     newslock();
  1930. +     a = fopen("active", "r");
  1931. +     if (a == NULL)
  1932. +         fail("cannot open `%s'", ctlfile("active"));
  1933. +     new = fopen(newname, "w");
  1934. +     if (new == NULL)
  1935. +         fail("cannot create `%s'", ctlfile(newname));
  1936. +     cd(fullartfile((char *)NULL));
  1937. +     while ((line = fgetms(a)) != NULL) {
  1938. +         nf = split(line, field, NF, " \t\n");
  1939. +         if (nf != NF)
  1940. +             fail("bad number of fields in `%s ...'", field[0]);
  1941. +         name = strsave(field[0]);
  1942. +         slash(name);
  1943. +         d = opendir(artfile(name));
  1944. +         if (d != NULL) {
  1945. +             min = lowest(d);
  1946. +             if (min < 0)        /* no articles */
  1947. +                 min = atol(field[1])+1;
  1948. +             closedir(d);
  1949. +         } else                /* no directory */
  1950. +             min = atol(field[2]);
  1951. +         fprintf(new, "%s %s ", field[0], field[1]);
  1952. +         if (min < 10000) {    /* insist on at least five digits */
  1953. +             sprintf(minstr, "%ld", min);
  1954. +             fprintf(new, "%s", "00000"+strlen(minstr));
  1955. +         }
  1956. +         fprintf(new, "%ld %s\n", min, field[3]);
  1957. +         free(name);
  1958. +         free(line);
  1959. +     }
  1960. +     if (nfclose(new) == EOF)
  1961. +         fail("close failed on `%s'", ctlfile(newname));
  1962. +     cd(ctlfile((char *)NULL));
  1963. +     (void) unlink("active.old");
  1964. +     if (link("active", "active.old") < 0)
  1965. +         fail("can't link `active' to `active.old'", "");
  1966. +     if (unlink("active") < 0)
  1967. +         fail("can't unlink `active'", "");
  1968. +     if (link(newname, "active") < 0) {
  1969. +         if (link("active.old", "active") < 0)
  1970. +             fail("disaster -- cannot recover `active'!!", "");
  1971. +         else
  1972. +             fail("can't link in new `active' -- old one used", "");
  1973. +     }
  1974. +     newsunlock();
  1975. +     exit(0);
  1976. + }
  1977. + /*
  1978. +  - lowest - find numerically-lowest name in directory
  1979. +  */
  1980. + long                /* lowest; -1 if none */
  1981. + lowest(d)
  1982. + register DIR *d;
  1983. + {
  1984. +     register struct dirent *dp;
  1985. +     register long this;
  1986. +     register long min = -1;
  1987. +     register int any = 0;
  1988. +     while ((dp = readdir(d)) != NULL) {
  1989. +         if (strspn(dp->d_name, "0123456789") == strlen(dp->d_name)) {
  1990. +             this = atol(dp->d_name);
  1991. +             if (this < min || !any) {
  1992. +                 min = this;
  1993. +                 any = 1;
  1994. +             }
  1995. +         }
  1996. +     }
  1997. +     return(min);
  1998. + }
  1999. + /*
  2000. +  - split - divide a line into fields, like awk split()
  2001. +  */
  2002. + int                /* number of fields */
  2003. + split(line, fields, nfmax, sep)
  2004. + char *line;
  2005. + char *fields[];
  2006. + int nfmax;
  2007. + char *sep;
  2008. + {
  2009. +     register int i;
  2010. +     register char *p;
  2011. +     i = 0;
  2012. +     for (p = strtok(line, sep); p != NULL; p = strtok((char *)NULL, sep)) {
  2013. +         if (i < nfmax)
  2014. +             fields[i] = p;
  2015. +         i++;
  2016. +     }
  2017. +     return(i);
  2018. + }
  2019. + /*
  2020. +  - slash - convert dots to slashes in string
  2021. +  */
  2022. + void
  2023. + slash(s)
  2024. + char *s;
  2025. + {
  2026. +     register char *p = s;
  2027. +     while ((p = strchr(p, '.')) != NULL)
  2028. +         *p = '/';
  2029. + }
  2030. + /*
  2031. +  - interrupt - signal handler
  2032. +  */
  2033. + void
  2034. + interrupt()
  2035. + {
  2036. +     fail("interrupted", "");
  2037. + }
  2038. + /*
  2039. +  - catch - set up to catch a signal
  2040. +  */
  2041. + void
  2042. + catch(sig)
  2043. + int sig;
  2044. + {
  2045. +     if (signal(sig, SIG_IGN) != SIG_IGN)
  2046. +         (void) signal(sig, interrupt);
  2047. + }
  2048. + /*
  2049. +  - fail - some sort of error occurred
  2050. +  */
  2051. + void
  2052. + fail(s1, s2)
  2053. + char *s1;
  2054. + char *s2;
  2055. + {
  2056. +     /* possibly should rm newname, but it may be important evidence */
  2057. +     errunlock(s1, s2);
  2058. + }
  2059. + /*
  2060. +  - unprivileged - keep the configuration stuff happy
  2061. +  */
  2062. + void
  2063. + unprivileged()
  2064. + {
  2065. + }
  2066.  
  2067. new man/Makefile (patch can't create, so diff against null):
  2068. Index: man/Makefile
  2069. *** cnpatch/tmp.preposterously.long.name.to.make.patch.behave.right    Tue Aug 22 14:05:42 1989
  2070. --- man/Makefile    Sat Aug 19 20:47:51 1989
  2071. ***************
  2072. *** 0 ****
  2073. --- 1,4 ----
  2074. + cmp:
  2075. +     -for f in *.1 ; do echo --- $$f --- ; diff /usr/man/man1 $$f ; done
  2076. +     -for f in *.5 ; do echo --- $$f --- ; diff /usr/man/man5 $$f ; done
  2077. +     -for f in *.8 ; do echo --- $$f --- ; diff /usr/man/man8 $$f ; done
  2078.  
  2079. new misc/adddirs (patch can't create, so diff against null):
  2080. Index: misc/adddirs
  2081. *** cnpatch/tmp.preposterously.long.name.to.make.patch.behave.right    Tue Aug 22 14:05:42 1989
  2082. --- misc/adddirs    Sat Aug 19 20:41:27 1989
  2083. ***************
  2084. *** 0 ****
  2085. --- 1,17 ----
  2086. + #! /bin/sh
  2087. + # adddirs - add any directories needed for newsgroups in active file
  2088. + # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  2089. + . ${NEWSCONFIG-/usr/lib/news/bin/config}
  2090. + PATH=$NEWSCTL/bin:$NEWSBIN/maint:$NEWSBIN/relay:$NEWSBIN:$NEWSPATH ; export PATH
  2091. + umask $NEWSUMASK
  2092. + for dir in `sed 's/[     ].*//' $NEWSCTL/active | tr . /`
  2093. + do
  2094. +     if test ! -d $NEWSARTS/$dir
  2095. +     then
  2096. +         echo "making $dir (and parents if needed...)"
  2097. +         : mkpdir $NEWSARTS/$dir
  2098. +     fi
  2099. + done
  2100.  
  2101.  
  2102. end of patch 22-Aug-1989
  2103.  
  2104.  
  2105.