[PATCH] variables for newsfeeds

Sven Paulus sven at tin.org
Tue Jul 25 19:11:59 UTC 2000


Hi!

I sent this patch some weeks ago to Russ, but it was too late to be included
to 2.3. Since the goal is that 2.4 won't have the newsfeeds file anymore, I
think I'll announce it here, maybe its useful for some of you. Maybe it's
something for 2.3.1 or 2.2.4 (I think continuing 2.2.x with some new
features might be worth a thought, since for those of use who want to keep
their traditional spools, INN-2.x (x>2) is no real solution ...).

One thing I've always missed when configuring peers in the newsfeeds file
was support for groups of newsgroups. This patch adds support for variables
to the newsfeeds file and use them in the feed definitions:

$GERMANGROUPS=de.*,fido.ger.*,z-netz.*,maus.*,free.de.*
$EXCLUSIONS=@local.*, at internal.*/!internal,!local
$BIG8=comp.*,humanities.*,misc.*,news.*,rec.*,\
   sci.*,soc.*,talk.*
$NOXFEED=my.de-peer,my.big8-peer,my.non-de-peer

my.de-peer:$GERMANGROUPS,$EXCLUSIONS:Tf,Wf:de-peer
my.non-de-peer:*,!$GERMANGROUPS,$EXCLUSIONS:Tf,Wf:non-de-peer
my.big8-peer:$BIG8,$EXCLUSIONS:Tf,Wf:big8-peer
my.onlylocal-peer/$NOXFEED:*:Tf,Tf:my.onlylocal-peer

As you can see, a variable is defined by using
$variablename=contents
The variable name can consist of [0-9a-zA-Z]. If the line contains spaces,
it is ignored. The contents are random, everything is possible, even line
continuations.

If you want to use a variable, use $variablename whereever you want. It will
be replaced by the variable's contents. There are two special cases:
!$variablename and @$variablename. In these cases, every single element
(where the elements are delimited by ',') within the variable contents is
preceeded by '!' or '@'. So @$GERMANYGROUPS is expanded to @de.*, at fido.*,\
@z-netz.*, at maus.*.

As far as I tested the patch, it seems to fit to INN-2.2 (may be even
earlier) too recent INN-CURRENT snapshots. I found it very useful when
managing a larger number of feeds without having to use external tools like
gup or m4.

You can download it from:
ftp.tin.org:/pub/news/servers/inn/unofficial-patches/diff-inn-2.x-newsfeeds-variables

Apply this the usual way: 
  cd ..../inn-2.xyz
  patch -p1 < diff-inn-2.x-newsfeeds-variables
  make

If you have any problems or questions, feel free to contact me.

Sven




More information about the inn-workers mailing list