[Mailman-Users] external archiver second time

Jonas Meurer jonas at freesources.org
Tue Jun 17 13:58:35 CEST 2003


On 17/06/2003 Richard Barrett wrote:
> >i still have in my mm_cfg.py:
> >PUBLIC_EXTERNAL_ARCHIVER = 'lurker-index -l `lurker-list -c 
> >/etc/lurker/lurker.conf | grep -B2 "^%(listname)s$"| head -n1` -m'
> 
> From a quick glance at the documentation files accompanying the lurker 
> release 0.90 on sourceforge I would have thought that the following line 
> would do it:
> 
> PUBLIC_EXTERNAL_ARCHIVER = 'lurker-index -l %(listname}s -c 
> /etc/lurker/lurker.conf -m'
> 
> For example, with a MM list called fred-list this would lead to MM 
> executing the following command and piping the message text to STDIN for 
> the subprocess:
> 
>     'lurker-index -l fred-list -c /etc/lurker/lurker.conf -m'

ok, some explanation: i'm the debian maintainer of lurker and i wrote
a little wrapper for lurker-index that automaticly uses the config file.
so only 'lurker-index -l fred-list -m' is needed.

> It seems your trouble is with the fancy footwork you are trying to perform 
> with lurker-list, grep and head to translate a mailman-proper-listname to a 
> short-lurker-listname.

doesn't look so. when i set in mm_cfg.py:
PUBLIC_EXTERNAL_ARCHIVER = "echo foobar"
mailman still grumbles:
==> /var/log/mailman/error <==
Jun 17 13:26:59 2003 (1464) external archiver non-zero exit status: 1

so that seems not to be a problem of lurker.

> The efficiency of this seems to me to be fairly questionable, particularly 
> when you consider the use of the short 'list' names is supposed to be an 
> efficiency measure.
> 
> Personally, if I thought it was worth the effort to have these abbrieviated 
> list names I'd find a better method of doing that mapping than using grep.

mh, i don't like this workaround either. but it has to be: lurker
supports only 32 chars per listname, and max 16 is recommented. that is,
because lurker is using these names in urls, and long urls suck.
so, mailman itself has no listname limitation. how to get these two
paradoxes working together? only with an acronym of mailman listname for
lurker. so i create a (hopefully) unique acronym at creating lurker.conf
now every mail has to be imported to the list with it's acronym.
that's why i have to use this ugly workaround. a better solution would
be to add a function to lurker-list that gives the listname where title
= 'bla'. like
lurker-list -c /etc/lurker/lurker.conf -t fred-list -i

but that is not supported by lurker-list at the moment. don't know if
upstream would add this function.

still, the hole workaround is not the best solution. the lists i
maintain are all in the style 'part1-part2-part3-...'. some without any
-, some with many. so i split the list in the parts, n=number of parts.
then i do 16/n, and every part gets as many chars as the result gives.
now the first run of a loop fills the acronym until 1*(16/n), the second
until 2*(16/n). so there will always result an acronym without the - but
with at least 16/n chars per part, if the part is long enough. here is
the algoritm script:
actual_list_lc=`echo $actual_list | awk '{print tolower($0)}'`
actual_list_id=`echo $actual_list_lc | awk'{s="";n=split($0,a,/-/);c=16/n;for(i=1;i<=n;i++){s=s""substr(a[i],1,c*i-length(s))};print tolower(s)}'

if $actual_list has value "Argentina-Communicados" for example,
$actual_list_lc will be "argentina-communicados", and $actual_list_id
will have value "argentincommunic".

if anyone has a better solution for a workaround, please contact me. i'm
really unhappy with the stuff above.

> But if you insist on doing it the grep way, I think you may need to say:
> 
> PUBLIC_EXTERNAL_ARCHIVER = 'lurker-index -c /etc/lurker/lurker.conf -l 
> `lurker-list -c /etc/lurker/lurker.conf | grep -B2 "^%(listname)s$"| head 
> -n1` -m'
>
> that is assuming the output from lurker-list without any other parameters 
> consists of groups three lines, the first being the short-lurker-listname 
> and the third the mailman-proper-listname.

see above (the config is not needed as i use the wrapper).

> I'll now leave you to persuade the grepping and such to work.
> 
> This is definitely not a Mailman problem but feel free to add an entry to 
> the Mailman FAQ when you get it working.

once mailman runs without any problems with lurker as archiver, i'll
surely add an entry to the mailman faq ;)

bye
 mejo
 
-- 
Efficiency and progess is ours one more
Now that we have the Neutron bomb
It's nice and quick and clean and gets things done
Kill kill kill kill kill the poor tonight
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.python.org/pipermail/mailman-users/attachments/20030617/586f1e99/attachment.pgp 


More information about the Mailman-Users mailing list