/[suikacvs]/messaging/suikawari/wari.pl
Suika

Diff of /messaging/suikawari/wari.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by wakaba, Tue Jun 25 09:35:34 2002 UTC revision 1.5 by wakaba, Wed Jul 24 12:14:48 2002 UTC
# Line 20  $Bunshin::DEBUG = 0; Line 20  $Bunshin::DEBUG = 0;
20  my $VERBOSE;  my $VERBOSE;
21  my $directory = './module/';  my $directory = './module/';
22  my $posted_log = '.posted';  my $posted_log = '.posted';
23    my $module_pattern = q([A-Za-z0-9_]+);
24  GetOptions (  GetOptions (
25          debug   => \$Bunshin::DEBUG,          debug   => \$Bunshin::DEBUG,
26          'module-dir=s'  => \$directory,          'module-dir=s'  => \$directory,
27            'module-name=s' => \$module_pattern,
28          'nntp-server=s' => \$NNTP_SERVER,          'nntp-server=s' => \$NNTP_SERVER,
29          'posted-log=s'  => \$posted_log,          'posted-log=s'  => \$posted_log,
30          verbose => \$VERBOSE,          verbose => \$VERBOSE,
# Line 34  sub vprint (@); Line 36  sub vprint (@);
36  binmode STDOUT;  binmode STDOUT;
37    
38  opendir DIR, $directory;  opendir DIR, $directory;
39    my @module = sort map {s/\.sb$//; $_} grep /^[A-Za-z0-9_]+\.sb$/, readdir DIR;    my @module = sort map {s/\.sb$//; $_} grep /^$module_pattern\.sb$/, readdir DIR;
40  close DIR;  close DIR;
41  die "$0: $directory: No suikawari definition" if @module == 0;  die "$0: $directory: No suikawari definition" if @module == 0;
42  push @main::INC, $directory;  push @main::INC, $directory;
# Line 52  open LOG, $posted_log; Line 54  open LOG, $posted_log;
54  close LOG;  close LOG;
55  }  }
56    
57    my $nntp;
58  for (@module) {  for (@module) {
59    vprint $_;    vprint $_;
60    my $module = "Suikawari::$_";    my $module = "Suikawari::$_";
# Line 70  for (@module) { Line 73  for (@module) {
73    $module->on_load_source ($b);    $module->on_load_source ($b);
74    $b->set_source ($module->source);    $b->set_source ($module->source);
75    $module->on_make ($b);    $module->on_make ($b);
76    my ($nntp, $time);    my ($time);
77    my $latest_time = $plog->field ($_, -new_item_unless_exist => 0);    my $latest_time = $plog->field ($_, -new_item_unless_exist => 0);
78    dprint 'Latest-Posted-Date: '.$latest_time;    dprint 'Latest-Posted-Date: '.$latest_time;
79    for ($b->make_msgs) {    for ($b->make_msgs) {
# Line 84  for (@module) { Line 87  for (@module) {
87      send_msg ($_ => $nntp);      send_msg ($_ => $nntp);
88      $time = $t if $t > $time || !$time;      $time = $t if $t > $time || !$time;
89    }    }
   close_nntp ($nntp);  
90    $plog->replace ($_ => $time) if $time > $latest_time;    $plog->replace ($_ => $time) if $time > $latest_time;
91  }  }
92    close_nntp ($nntp);
93    
94  open LOG, '> '.$posted_log or die "$0: $posted_log: $!";  open LOG, '> '.$posted_log or die "$0: $posted_log: $!";
95    binmode LOG;    binmode LOG;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24