home *** CD-ROM | disk | FTP | other *** search
- Path: xanth!mcnc!rutgers!mailrus!husc6!linus!necntc!ncoast!allbery
- From: vix@ubvax.UB.Com (Paul Vixie)
- Newsgroups: comp.sources.misc
- Subject: v04i078: A bilge pump for the ALT hierarchy
- Message-ID: <11937@ubvax.UB.Com>
- Date: 19 Sep 88 01:42:59 GMT
- Sender: allbery@ncoast.UUCP
- Reply-To: vix@ubvax.UB.Com (Paul Vixie)
- Organization: none in particular
- Lines: 214
- Approved: allbery@ncoast.UUCP
-
- Posting-number: Volume 4, Issue 78
- Submitted-by: "Paul Vixie" <vix@ubvax.UB.Com>
- Archive-name: alt-clean
-
- Though I'm no longer a contractor, I still maintain NetNews for Ubvax as a
- service to the sites they feed news to (i.e., I don't get paid for this).
-
- Alt is a sewer and this is my way of dealing with it. Have fun, everybody.
-
- #! /bin/sh
- ## This is a shell archive. Remove anything before this line, then unpack
- ## it by saving it into a file and typing "sh file". To overwrite existing
- ## files, type "sh file -c". You can also feed this as standard input via
- ## unshar, or by typing "sh <file". If this archive is complete, you will
- ## see the following message at the end:
- # "End of shell archive."
- # Contents: README-sys.m4 Makefile sys.m4
- # Wrapped by vix@ubvax.ub.com on Sat Sep 3 13:40:35 1988
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f README-sys.m4 -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"README-sys.m4\"
- else
- echo shar: Extracting \"README-sys.m4\" \(3894 characters\)
- sed "s/^X//" >README-sys.m4 <<'END_OF_README-sys.m4'
- XPaul Vixie
- X3-Sept-88
- Xsys.m4
- X
- XRATIONALE
- X
- XAs of a few months ago, the "alt" hierarchy has become the dung heap of
- XUsenet. Because there are no rules on group creation, "trash" groups
- Xare added and deleted constantly.
- X
- XMy usual policy in Usenet site administration is to carry all the groups
- XI can get my hands on, even if I only read a very small fraction of them.
- XI.e., the fact that many "alt" groups are not interesting to me is not
- Xmy reason for calling them "trash".
- X
- XIn the main categories of Usenet (comp, news, misc, talk, and so on), I
- Xhave been able to safely carry all groups in the various hierarchies since
- Xthe "trash" contingent was kept to a minimum. I run my B News software
- Xwith the option that automatically accepts incoming "newgroup" control
- Xmessages.
- X
- XAlt, however, cannot be so "trusted". I have no reason to expect that a
- Xnew "alt" group will be anything but trash, and my /usr/lib/news/sys file
- Xhas become very messy as a result: rather than allowing all of "alt" and
- Xthen disallowing the groups I do not favor, as in
- X
- X site:alt,!alt.weemba,!alt.california,...:
- X
- X...I have taken to disallowing all of alt and then allowing the groups I
- X_do_ favor, as in:
- X
- X site:alt,!alt.all,alt.gourmand,alt.individualism,...:
- X
- XPutting these restrictions on my own "sys" line is of limited effectiveness,
- Xsince the articles seem to land in "junk" and in fact are sometimes sent on
- Xto my neighbors. Putting these restrictions on every neighbor's sys line
- Xmakes a disasterous mess of my "sys" file. Asking my neighbors to only
- Xforward the groups I approve of is a big pain for them and for me.
- X
- XEnter "sys.m4". M4 is a macro preprocessor, somewhat more general than the
- XC preprocessor although more arcane in its directives. What I've done is to
- Xdefine my feelings about the "alt" hierarchy and then include them in every
- Xline of my "sys.m4" file. When M4 processes the sys.m4 file and creates the
- X"sys" file, the list of approved groups appears everywhere, in all its
- Xglorious ugliness. But this doesn't get in my face, since I don't ever
- Xedit the "sys" file - I edit "sys.m4" and rerun M4.
- X
- XINSTALLATION
- X
- XIf you aren't familiar with M4, go read the man page. If you can find the
- Xpaper on M4 in your "supplementary documents", read that too. You will not
- Xneed to be an M4 wizard, but you will have to understand what it is and what
- Xit does.
- X
- XThis package consists of these files:
- X
- X README-sys.m4 you're reading it
- X Makefile runs M4 on "sys.m4", creates "sys".
- X sys.m4 my sys.m4 file, you can use it as a prototype
- X
- XInstallation is simple but _not_ automatic. First you should check to
- Xsee that these file names aren't already in use in your /usr/lib/news;
- Xif they are, you'll have to be creative and good luck. If not, move
- Xthe files into /usr/lib/news. Make a backup copy of your "sys" file,
- Xcalled "sys.backup" or "sys.save" or whatever you call such things.
- XThen edit "sys.m4" and examine carefully until you understand what's
- Xgoing on. Delete all the inapplicable stuff, append your "sys.save"
- Xfile, and edit the result until you are using the new features of M4.
- X
- XNote that the next step will destroy your "sys" file, which is why we
- Xbacked it up above. If you misunderstood the details of "M4" or of
- Xmy use of its features, you will have to recover your "sys" file from
- Xthe backup.
- X
- XSo with that in mind, get to /usr/lib/news and say "make sys". Examine
- Xthe resultant "sys" file to see if it's what you wanted. If not, go
- Xback and edit "sys.m4" and try again. Repeat until you get what you
- Xwant or until you have to give up and restore your old "sys" file.
- X
- XCONCLUSION
- X
- XI hope C News and News 3.0 make this easier to do. I think "inews" has
- Xto read and parse the whole "sys" file for every article you receive in
- XB News 2.11, so this hack slows things down a lot. But if I can pump
- Xbilge out of my system at the expense of some extra CPU cycles, it's
- Xworth it.
- END_OF_README-sys.m4
- if test 3894 -ne `wc -c <README-sys.m4`; then
- echo shar: \"README-sys.m4\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f Makefile -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"Makefile\"
- else
- echo shar: Extracting \"Makefile\" \(191 characters\)
- sed "s/^X//" >Makefile <<'END_OF_Makefile'
- X# Makefile for /usr/lib/news/sys, created from sys.m4
- X# vix 03sep88 [written]
- X
- XSYS= sys
- X
- Xall:; @-echo "make what? try 'make sys' if that's what you mean."
- X
- X$(SYS): sys.m4
- X m4 sys.m4 > $(SYS)
- END_OF_Makefile
- if test 191 -ne `wc -c <Makefile`; then
- echo shar: \"Makefile\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f sys.m4 -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"sys.m4\"
- else
- echo shar: Extracting \"sys.m4\" \(2692 characters\)
- sed "s/^X//" >sys.m4 <<'END_OF_sys.m4'
- X# the source for this is /usr/lib/news/sys.m4. Do not edit this file, edit
- X# the M4 version and then while in /usr/lib/news say "make sys". Note that
- X# in order for this text to appear in the "sys" file, you will see it when
- X# you edit the "sys.m4" file as well. Paul Vixie, 3-Sept-88
- X#
- X# Notes for M4 novices: strings are quoted `like this', and quotes are
- X# very much needed around the arguments to `define', see man page for
- X# details. The `dnl' is also helpful. Putting a single newsgroup on
- X# the last line of the `ALT' define makes the output look nicer, you'll see.
- X
- Xundefine(`unix')dnl
- Xdefine(`ALT',`alt,!alt.all,alt.config,alt.test,\
- X alt.gourmand,alt.sources,alt.sources.amiga,\
- X alt.hypertext,alt.aquaria,\
- X alt.individualism,alt.recovery,\
- X alt.sex,alt.drugs,alt.rock-n-roll,\
- X alt.sca,alt.emusic,alt.cult-movies,\
- X alt.cyberpunk')dnl
- X
- X#
- X# localhost
- X#
- Xubvax:world,comp,news,sci,rec,misc,soc,talk,na,ba,ca,usa,su,to,ub,\
- X ALT,biz,pubnet,inet,bionet,unix-pc,usrgroup,gnu::
- Xmaps:world,comp.mail.maps:F:/usr/spool/uucpmap/comp.mail.maps/Batch
- X#
- X# partial feeds to decrease propagation delay
- X#
- Xuunet:world,ALT,comp,news,sci,rec,misc,soc,talk,inet,gnu,ba,ca,to.uunet:L1F:
- Xcae780:world,ALT,comp,news,sci,rec,misc,soc,talk,inet,ba,ca,to.cae780:L1F:
- Xweitek:world,ALT,comp,news,sci,rec,misc,soc,talk,inet,ba,ca,to.weitek:L1F:
- Xlll-winken:biz,pubnet,usrgroup,bionet,unix-pc,inet,ALT,gnu,\
- X world,comp,news,sci,rec,misc,soc,talk,na,ba,ca,usa,to.lll-winken:L2F:
- Xamdahl:ba,ca,gnu,ALT,to.amdahl:F:
- X#
- X# full feeds
- Xvsi1/ames:inet,ALT,world,comp,news,sci,rec,misc,soc,talk,na,ba,ca,usa,gnu,\
- X to.vsi1,bionet,unix-pc,usrgroup,biz:F:
- Xardent:inet,ALT,world,comp,news,sci,rec,misc,soc,na,ba,ca,usa,gnu,\
- X to.ardent,bionet,unix-pc,usrgroup:F:
- Xmrspoc:inet,ALT,world,comp,news,sci,rec,misc,soc,talk,na,ba,ca,usa,gnu,\
- X to.mrspoc,bionet,unix-pc,usrgroup,biz:F:
- Xpyramid/ames:ALT,world,comp,news,sci,rec,misc,soc,talk,na,ba,ca,usa,su,to.pyramid:IF:
- Xames/vsi1:inet,world,comp,news,sci,rec,misc,soc,talk,na,ba,ca,usa,su,gnu,\
- X alt,!alt.all,alt.config,alt.test,alt.sources,alt.gourmand,\
- X to.ames,bionet,unix-pc,usrgroup:F:
- X#
- X# dalek is Seth Bradley's machine in Sunnyvale
- X#
- Xdalek:ba,ca,na,usa,world,news,ALT,misc,rec,!rec.music,!rec.aviation,\
- X!rec.ham-radio,sci.electronics,sci.math,sci.med,sci.physics,news,comp.dcom,\
- Xcomp.mail,comp.org,comp.periphs,comp.sources,comp.sys.atari.8bit,comp.doc,\
- Xcomp.sys.dec,comp.sys.ibm.pc,comp.binaries.ibm,comp.newprod,talk.origins,\
- Xcomp.lang,comp.text,comp.unix,to.dalek:F:/usr/spool/batch/dalek
- X#
- X# vixie is Paul's home machine
- X#
- Xvixie:world,na,ba,ca,!ba.all,!ca.all,alt,!alt.all,alt.sex,\
- X comp.windows.x,alt.individualism,talk.politics.theory,all.philosophy:F:
- X#
- END_OF_sys.m4
- if test 2692 -ne `wc -c <sys.m4`; then
- echo shar: \"sys.m4\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- echo shar: End of shell archive.
- exit 0
- --
- Paul Vixie
- Consultant Work: 408-562-7798 vix@ub.com vix%ubvax@uunet.uu.net
- Ungermann-Bass Home: 415-647-7023 {amdahl,ptsfa,pyramid,uunet}!ubvax!vix
- Santa Clara, CA <<I do not speak for Ungermann-Bass>>
-