*** Makefile.base 1994/01/25 19:42:40 1.18 --- Makefile.base 1994/02/22 01:21:48 *************** *** 1,6 **** # See README for instructions on how to configure and install. # ! # $Id: Makefile.base,v 1.18 1994/01/25 19:42:40 jik Exp $ BINDIR=#bindir# MANDIR=#mandir# --- 1,6 ---- # See README for instructions on how to configure and install. # ! # $Id: Makefile.base,v 1.20 1994/02/22 01:21:48 jik Exp $ BINDIR=#bindir# MANDIR=#mandir# *************** *** 28,34 **** post_faq.man: post_faq.man.base config.sed -rm -f post_faq.man.bak ! -mv post-faq.man post_faq.man.bak sed -f config.sed post_faq.man.base >post_faq.man chmod -w post_faq.man --- 28,34 ---- post_faq.man: post_faq.man.base config.sed -rm -f post_faq.man.bak ! -mv post_faq.man post_faq.man.bak sed -f config.sed post_faq.man.base >post_faq.man chmod -w post_faq.man *************** *** 42,48 **** config.dat: cp config.dat.in config.dat ! install: ${EXPORTS} install -c -m 0755 post_faq.pl ${DESTDIR}${BINDIR}/post_faq.pl install -c -m 0644 post_faq.man ${DESTDIR}${MANDIR}/post_faq.1 install -c -m 0644 faqfile.pl ${DESTDIR}${LIBDIR}/faqfile.pl --- 42,48 ---- config.dat: cp config.dat.in config.dat ! install: ${EXPORTS} FRC install -c -m 0755 post_faq.pl ${DESTDIR}${BINDIR}/post_faq.pl install -c -m 0644 post_faq.man ${DESTDIR}${MANDIR}/post_faq.1 install -c -m 0644 faqfile.pl ${DESTDIR}${LIBDIR}/faqfile.pl *************** *** 56,58 **** --- 56,62 ---- patch: $(SHARS) makepatch $(SHARS) mv patch post_faq.patch`cat PATCHLEVEL` + + FRC: + + .PHONY: FRC *** config.dat.in 1994/01/25 19:14:31 1.13 --- config.dat.in 1994/02/17 15:37:53 *************** *** 15,20 **** --- 15,28 ---- # The path of the program (usually inews, but sometimes others) to # which to feed the prepared article + # + # If you want to call inews with arguments (e.g., if you want to + # suppress signature inclusion with INN inews by passing it the "-S" + # argument), then don't add the arguments here. Instead, either (a) + # create a wrapper script which calls inews with the appropriate + # arguments, and put it here, or (b) modify post_faq.pl.base to + # include the extra argument(s) (search for "-h" in the file and add + # the other arguments there). inews /afs/sipb.mit.edu/project/sipb/bin/inews # SITE INFORMATION *** post_faq.man.base 1994/01/25 19:29:09 1.18 --- post_faq.man.base 1994/02/23 21:43:07 *************** *** 1,4 **** ! .\" $Id: post_faq.man.base,v 1.18 1994/01/25 19:29:09 jik Exp $ .\" .\" Copyright (c) 1991 Jonathan I. Kamens. See the GNU Public License .\" (any version) for terms of distribution. --- 1,4 ---- ! .\" $Id: post_faq.man.base,v 1.19 1994/02/23 21:43:03 jik Exp $ .\" .\" Copyright (c) 1991 Jonathan I. Kamens. See the GNU Public License .\" (any version) for terms of distribution. *************** *** 265,276 **** .B force Whether or not to force the posting of the FAQ, ignoring the interval. If unspecified, the default or command-line-specified value is used. ! If specified, it should be a number -- 0 never to force, 1 to force ! the next time the FAQ is posted and then switch back to the default, ! 2 to always force, or -1 to always force the posting NOT to be posted ! (this is useful if you want to temporarily prevent a posting from ! being posted, without losing its information in the configuration ! file). Any other values are illegal. .TP .B parent The ID name of the parent article of this one. The parent must appear --- 265,293 ---- .B force Whether or not to force the posting of the FAQ, ignoring the interval. If unspecified, the default or command-line-specified value is used. ! If specified, it should be one of the following numbers: ! .RS ! .IP 0 ! Don't force -- post the FAQ if its interval says that it should be ! posted. ! .IP 1 ! Force the FAQ to be posted the next time ! .I post_faq.pl ! is run, and then ! switch the force field back to the default value. ! .IP 2 ! Always force the FAQ to be posted, without changing the force field ! when done. ! .IP 3 ! Force the FAQ to be posted the next time ! .I post_faq.pl ! is run, and then set ! the force field to -2. ! .IP "-1 or -2" ! Never post the FAQ. ! .PP ! Any other values are illegal. ! .RE .TP .B parent The ID name of the parent article of this one. The parent must appear *** post_faq.pl.base 1994/01/25 19:14:19 1.37 --- post_faq.pl.base 1994/02/23 21:25:55 *************** *** 1,6 **** #!#perl# # ! # $Id: post_faq.pl.base,v 1.37 1994/01/25 19:14:19 jik Exp $ # # Copyright (c) 1991 Jonathan I. Kamens. See the GNU Public License # (any version) for terms of distribution. --- 1,6 ---- #!#perl# # ! # $Id: post_faq.pl.base,v 1.41 1994/02/23 21:25:53 jik Exp $ # # Copyright (c) 1991 Jonathan I. Kamens. See the GNU Public License # (any version) for terms of distribution. *************** *** 9,14 **** --- 9,16 ---- require 'faqfile.pl'; + $SIG{'PIPE'} = 'sigpipe'; + # These variables can be overridden by command-line options. $server = '#server#'; # News server to which to connect, if NNTP *************** *** 42,51 **** $quiet = 0; $newstamp = time; ! $usage = "Usage: $0 -config file-name [ -interval days ! -inewscmd command -server nntp-server -idhost host-name ! -sigfile file-name -quiet number -omit id-list -only id-list -force ! -expire_search -debug ]"; # Parse command line arguments --- 44,53 ---- $quiet = 0; $newstamp = time; ! $usage = "Usage: $0 -config file-name [ -interval days ] ! [ -inewscmd command ] [ -server nntp-server ] [ -idhost host-name ] ! [ -sigfile file-name ] [ -quiet number ] [ -omit id-list ] ! [ -only id-list ] [ -force ] [ -expire_search ] [ -debug ]"; # Parse command line arguments *************** *** 181,187 **** goto nextone; } else { ! print "Posting $idname ($timeout).\n" if ($quiet < 1); $inews_pid = open(INEWS, "|$inews"); open(FAQ, $file) || (warn("Opening $file (for $idname): $!.\n"), goto nextone); --- 183,189 ---- goto nextone; } else { ! print "Posting $idname ($reason).\n" if ($quiet < 1); $inews_pid = open(INEWS, "|$inews"); open(FAQ, $file) || (warn("Opening $file (for $idname): $!.\n"), goto nextone); *************** *** 268,273 **** --- 270,280 ---- print "Force disabled on $idname.\n" if ($quiet < 2); } + elsif ($force == 3) { + &faqfile'set_force($idname, -2); + print "Force replaced with suspend on $idname.\n" + if ($quiet < 2); + } &faqfile'set_posted($idname); &faqfile'set_timestamp($idname, $newstamp); } *************** *** 294,297 **** --- 301,309 ---- local($idname, $time, $host) = @_; "<${idname}_${time}@${host}>"; + } + + sub sigpipe { + # Don't do anything; we'll notice it because $? will be non-zero + # when the file handle is closed. } *** faqfile.pl 1994/01/25 19:11:53 1.17 --- faqfile.pl 1994/02/22 01:39:58 *************** *** 1,4 **** ! # $Id: faqfile.pl,v 1.17 1994/01/25 19:11:53 jik Exp $ # # Copyright (c) 1992 Jonathan I. Kamens. See the GNU Public License # (any version) for terms of distribution. --- 1,4 ---- ! # $Id: faqfile.pl,v 1.20 1994/02/22 01:39:57 jik Exp $ # # Copyright (c) 1992 Jonathan I. Kamens. See the GNU Public License # (any version) for terms of distribution. *************** *** 72,80 **** # is a 1, then force the posting of this article just once, and # replace the 1 with an empty field ('.') when done doing so. # If it is a 2, then always force the posting of this article. ! # If it is a -1, then force the article NOT to be posted, no ! # matter what. Any other values are illegal. If not specified, ! # the hard-coded force parameter or the presence or absence of # "-force" on the command line is used to decide whether or not # to force. # parent -- The ID name of the parent article of this one, if any. --- 72,82 ---- # is a 1, then force the posting of this article just once, and # replace the 1 with an empty field ('.') when done doing so. # If it is a 2, then always force the posting of this article. ! # If it is a 3, then force the posting of this article just ! # once, and replace the 3 with -2 when done doing so. If it is ! # a -1 or -2, then force the article NOT to be posted, no matter ! # what. Any other values are illegal. If not specified, the ! # hard-coded force parameter or the presence or absence of # "-force" on the command line is used to decide whether or not # to force. # parent -- The ID name of the parent article of this one, if any. *************** *** 133,139 **** $timestamp = undef; } elsif ($timestamp !~ /^[0-9]+$/) { ! warn "Timestamp in FAQ specification \"$line\" is invalid. Ignoring FAQ.\n"; return undef; } --- 135,141 ---- $timestamp = undef; } elsif ($timestamp !~ /^[0-9]+$/) { ! warn "Timestamp \"$timestamp\" in FAQ specification \"$line\" is invalid. Ignoring FAQ.\n"; return undef; } *************** *** 143,149 **** } elsif ($interval !~ /^[0-9.]+$/) { if ($file_version < 2) { ! warn "Interval in FAQ specification \"$line\" is invalid. Ignoring FAQ.\n"; return undef; } } --- 145,151 ---- } elsif ($interval !~ /^[0-9.]+$/) { if ($file_version < 2) { ! warn "Interval \"$interval\" in FAQ specification \"$line\" is invalid. Ignoring FAQ.\n"; return undef; } } *************** *** 155,166 **** if ($force eq ".") { $force = undef; } ! else { ! $force += 0; # force it to be a number ! if ((int($force) != $force) || ($force < -1) || ($force > 2)) { ! warn "Force parameter in FAQ specification \"$line\" is invalid. Ignoring FAQ.\n"; ! return undef; ! } } local($parent) = shift @fields; --- 157,165 ---- if ($force eq ".") { $force = undef; } ! elsif (($force !~ /^(-|)[0-9]+$/) || ($force < -2) || ($force > 3)) { ! warn "Force parameter \"$force\" in FAQ specification \"$line\" is invalid. Ignoring FAQ.\n"; ! return undef; } local($parent) = shift @fields; *************** *** 168,174 **** $parent = undef; } elsif (! $faqs{$parent,"file"}) { ! warn "FAQ specification \"$line\" has unknown parent. Ignoring FAQ.\n"; return undef; } --- 167,173 ---- $parent = undef; } elsif (! $faqs{$parent,"file"}) { ! warn "FAQ specification \"$line\" has unknown parent \"$parent\". Ignoring FAQ.\n"; return undef; } *************** *** 300,308 **** s/[\'\"\\ \t]/$1/g; $line .= $_ . (shift @whitespace); } ! # This needs to be "return $line" rather than just "$line" because ! # it's local to this block. Not sure if this is a Perl bug or not; ! # I've reported it to comp.lang.perl just in case. return $line; } else { --- 299,309 ---- s/[\'\"\\ \t]/$1/g; $line .= $_ . (shift @whitespace); } ! # Catch any whitespace at the end of the line ! $line .= (shift @whitespace) if (@whitespace); ! # This needs to be "return $line" rather than just "$line", because ! # it's local to this block, because of a bug in Perl 4.036, which ! # Larry said he'll figure out how ti fix in Perl 5. return $line; } else { *************** *** 359,365 **** push(@whitespace, $1); push(@fields, $3); } ! elsif (/^\s*[^\'\"]/ && s/^(\s*)(([^\\ \t]|\\.)*)//) { push(@whitespace, $1); push(@fields, $2); } --- 360,366 ---- push(@whitespace, $1); push(@fields, $3); } ! elsif (/^\s*[^\'\"]/ && s/^(\s*)(([^\\ \t]|\\.)+)//) { push(@whitespace, $1); push(@fields, $2); } *** PATCHLEVEL 1994/01/25 19:48:50 1.8 --- PATCHLEVEL 1994/02/23 21:44:34 *************** *** 1 **** ! 8 --- 1 ---- ! 9