"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tools/w2r.pl" between
tin-2.4.4.tar.xz and tin-2.4.5.tar.xz

About: TIN is a threaded NNTP and spool based UseNet newsreader.

w2r.pl  (tin-2.4.4.tar.xz):w2r.pl  (tin-2.4.5.tar.xz)
#! /usr/bin/perl -w #! /usr/bin/perl -w
# #
# reads a tin filter file with wildmat filters on STDIN, converts it to # reads a tin filter file with wildmat filters on STDIN, converts it to
# regexp filters and returns it on STDOUT # regexp filters and returns it on STDOUT
# #
# 2000-04-27 <urs@tin.org> # 2020-11-10 <urs@tin.org>
# #
# NOTE: don't use w2r.pl on regexp filters # NOTE: don't use w2r.pl on regexp filters
# #
# for case optimization of your regexp filters use opt-case.pl, i.e.: # for case optimization of your regexp filters use opt-case.pl, i.e.:
# w2r.pl < wildmat-filter-file | opt-case.pl > regexp-filter-file # w2r.pl < wildmat-filter-file | opt-case.pl > regexp-filter-file
# #
# for joining regexp filters with the same group= and score= use # for joining regexp filters with the same group= and score= use
# joinf.pl (not written yet) # joinf.pl (not written yet)
# perl 5 is needed for lookahead assertions and perl < 5.004 is know # perl 5 is needed for lookahead assertions and perl < 5.004 is know
# to be buggy # to be buggy
require 5.004; require 5.004;
# version Number # version Number
# $VERSION = "0.2.7"; # $VERSION = "0.2.8";
while (defined($line = <>)) { while (defined($line = <>)) {
chomp $line; chomp $line;
# ignore comments etc. # ignore comments etc.
if ($line =~ m/^(?:[#\s]|$)/o) { if ($line =~ m/^(?:[#\s]|$)/o) {
print "$line\n"; print "$line\n";
next; next;
} }
# skip 'empty' patterns, they are nonsense # skip 'empty' patterns, they are nonsense
next if ($line =~ m/^[^=]+=$/o); next if ($line =~ m/^[^=]+=$/o);
# lines which needs to be translated # lines which needs to be translated
if ($line =~ m/^(subj|from|msgid(?:|_last|_only)|refs_only|xref)=(.*)$/o) { if ($line =~ m/^(subj|from|msgid(?:|_last|_only)|refs_only|xref|path)=(.* )$/o) {
printf ("$1=%s\n", w2p($2)); printf ("$1=%s\n", w2p($2));
next; next;
} }
# other lines don't need to be translated # other lines don't need to be translated
print "$line\n"; print "$line\n";
} }
# turns a wildmat into a regexp # turns a wildmat into a regexp
sub w2p { sub w2p {
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)