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