X-Git-Url: https://code.th-h.de/?p=usenet%2Fyapfaq.git;a=blobdiff_plain;f=yapfaq.pl;h=bac7fb8078690cad3f8e36ede0e9f3b3f3ac959e;hp=ac9764e296dfa14d954260ebdc00113afbdc5149;hb=6b42155376f8cabe3c2afaedfc7e0971af3d02d8;hpb=c2cafcca0009684fc16c87776cf5d62b74863ae5;ds=sidebyside diff --git a/yapfaq.pl b/yapfaq.pl index ac9764e..bac7fb8 100644 --- a/yapfaq.pl +++ b/yapfaq.pl @@ -12,7 +12,7 @@ # It can be redistributed and/or modified under the same terms under # which Perl itself is published. -my $Version = "0.6-unreleased"; +my $Version = "0.6.2"; my $NNTPServer = "localhost"; my $NNTPUser = ""; @@ -151,8 +151,7 @@ sub readconfig{ unless($$Config[$i]{'posting-frequency'} =~ /^\s*\d+\s*[dwmy]\s*$/) { $Error .= "E: The Posting-frequency for your project \"$$Config[$i]{'name'}\" is invalid.\n" } - unless($$Config[$i]{'expires'} =~ /^\s*\d+\s*[dwmy]\s*$/) { - $$Config[$i]{'expires'} = '3m'; # set default: 3 month + unless(!$$Config[$i]{'expires'} || $$Config[$i]{'expires'} =~ /^\s*\d+\s*[dwmy]\s*$/) { warn "$0: W: The Expires for your project \"$$Config[$i]{'name'}\" is invalid - set to 3 month.\n"; } $Error .= "-" x 25 . "\n" if $Error; @@ -223,7 +222,9 @@ sub postfaq { my $wday = ("Sun","Mon","Tue","Wed","Thu","Fri","Sat")[$time[6]]; my $year = (1900 + $time[5]); my $tz = $time[8] ? " +0200" : " +0100"; - + + $$Expire = '3m' if !$$Expire; # set default if unset: 3 month + my ($expY,$expM,$expD) = calcdelta ($year,$month,$day,$$Expire); my $expmonthN = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")[$expM-1]; @@ -266,6 +267,9 @@ sub postfaq { } post(\@Article); + # Test mode? + return if($Options{'t'}); + if($Options{'v'}) { print "$$ActName: Save status information.\n"; }