1 |
#! /usr/local/bin/perl -w |
2 |
# |
3 |
# Giuseppe Vacanti (cosine science & computing) |
4 |
# $Date: 2002/03/18 17:19:22 $ |
5 |
# |
6 |
# It receives the mirror log for the current package on stdin. |
7 |
# |
8 |
require 5; |
9 |
use FileHandle; |
10 |
use Getopt::Std; |
11 |
use strict; |
12 |
|
13 |
my %opts; |
14 |
getopts('t:d', \%opts); # -t development|release|public |
15 |
# -d => @names (below) were deleted |
16 |
my @names = @ARGV; # the rest of the command line contains the names of the |
17 |
# CCF constituents |
18 |
|
19 |
die("Usage: -t development|release|public\n") if(not exists $opts{'t'}); |
20 |
|
21 |
my $update = $opts{'t'}; |
22 |
my @to; |
23 |
my $replyto; |
24 |
my $subject; |
25 |
my $delete; |
26 |
foreach($update){ |
27 |
|
28 |
/^development$/ && do { |
29 |
@to = qw/xmm-it sas-devel/; |
30 |
$subject = "Update of the $update CCF area"; |
31 |
$replyto = 'xmm-it@xmm.vilspa.esa.es'; |
32 |
$delete = $opts{'d'}; |
33 |
next; |
34 |
}; |
35 |
|
36 |
/^release$/ && do { |
37 |
@to = qw/xmm-it sas-devel/; |
38 |
$subject = "Update of the $update CCF area"; |
39 |
$replyto = 'xmm-it@xmm.vilspa.esa.es'; |
40 |
next; |
41 |
}; |
42 |
|
43 |
/^public$/ && do { |
44 |
@to = qw/ccf xmm-it sas-devel/; |
45 |
$subject = "XMM-Newton calibration update"; |
46 |
$replyto = 'xmmhelp@xmm.vilspa.esa.es'; |
47 |
next; |
48 |
}; |
49 |
|
50 |
die("Wrong -t option: $update\n"); |
51 |
} |
52 |
|
53 |
exit(0) if(not @names); |
54 |
|
55 |
|
56 |
foreach(@to){ |
57 |
my $fh = new FileHandle "|/usr/lib/sendmail -t" or die ("$!\n"); |
58 |
|
59 |
$fh->print("From: ccflib\@xmm.vilspa.esa.es |
60 |
Reply-To: $replyto |
61 |
To: $_\@xmm.vilspa.esa.es |
62 |
Subject: $subject |
63 |
"); |
64 |
|
65 |
if($delete){ |
66 |
$fh->print("\nThe following calibration constituents were deleted:\n\n"); |
67 |
} else { |
68 |
$fh->print("\nThe following new calibration constituents are available:\n\n"); |
69 |
} |
70 |
|
71 |
foreach(@names){ |
72 |
$fh->print("$_\n"); |
73 |
} |
74 |
|
75 |
if($update eq "public"){ |
76 |
$fh->print(' |
77 |
For details and download instructions please refer to: |
78 |
|
79 |
http://xmm.vilspa.esa.es/calibration/ |
80 |
http://xmm.vilspa.esa.es/calibration/releasenotes/ |
81 |
|
82 |
Best regards, |
83 |
|
84 |
The XMM-Newton Calibration Librarian |
85 |
xmmhelp@xmm.vilspa.esa.es |
86 |
|
87 |
'); |
88 |
|
89 |
undef $fh; |
90 |
|
91 |
} |
92 |
|
93 |
} |
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|