projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
improve talk logging to show orig or dest node.
[spider.git]
/
perl
/
importwwv.pl
diff --git
a/perl/importwwv.pl
b/perl/importwwv.pl
index bca63688e28751f68dd1817f42524787f8bd126d..8de9a271151bb98d258da74da804ff68ab6a57b8 100755
(executable)
--- a/
perl/importwwv.pl
+++ b/
perl/importwwv.pl
@@
-37,7
+37,7
@@
my $msg = Mail::Internet->new(\*STDIN) or die "Mail::Internet $!";
my $head = $msg->head->header_hashref;
if ($head) {
my $head = $msg->head->header_hashref;
if ($head) {
- if ($head->{
From}->[0] =~ /wwv/i || $head->{'From '
}->[0] =~ /wwv/i) {
+ if ($head->{
Subject
}->[0] =~ /wwv/i) {
process_wwv($msg);
} elsif ($head->{From}->[0] =~ /rwc\.boulder/i || $head->{'From '}->[0] =~ /rwc\.boulder/i) {
process_solar($msg);
process_wwv($msg);
} elsif ($head->{From}->[0] =~ /rwc\.boulder/i || $head->{'From '}->[0] =~ /rwc\.boulder/i) {
process_solar($msg);
@@
-62,6
+62,7
@@
sub process_wwv
}
if ($state) {
my $l = $_;
}
if ($state) {
my $l = $_;
+ next if /\bSec\b/i;
$l =~ s/\s*\.?\r?\n$//;
push @out, $l;
}
$l =~ s/\s*\.?\r?\n$//;
push @out, $l;
}
@@
-87,6
+88,7
@@
sub process_solar
}
if ($state > 1) {
my $l = $_;
}
if ($state > 1) {
my $l = $_;
+ next if /\bSec\b/i;
$l =~ s/\r?\n$//;
push @out, $l;
}
$l =~ s/\r?\n$//;
push @out, $l;
}
@@
-99,8
+101,13
@@
sub out
my $fn = "solar.txt.$$";
open OUT, ">$tmp/$fn" or die "import $tmp/$fn $!";
my $fn = "solar.txt.$$";
open OUT, ">$tmp/$fn" or die "import $tmp/$fn $!";
+ chmod 0666, "$tmp/$fn";
print OUT map { "$_\n" } @_;
close OUT;
print OUT map { "$_\n" } @_;
close OUT;
+
+ # Note we do this this way to make the appearance of
+ # the file in /spider/chat_import atomic. Otherwise there
+ # exists the possiblity of race conditions and other nasties
link "$tmp/$fn", "$import/$fn";
unlink "$tmp/$fn";
}
link "$tmp/$fn", "$import/$fn";
unlink "$tmp/$fn";
}