/[CCFs]/bin/ccfnotify
ViewVC logotype

Diff of /bin/ccfnotify

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

revision 1.1 by ccflib, Mon Mar 18 17:19:22 2002 UTC revision 1.13 by ccflib, Tue Jul 27 15:10:24 2021 UTC
# Line 1  Line 1 
1  #! /usr/local/bin/perl -w  #! /xdata/ccflib/perl5/perlbrew/perls/perl-5.18.4/bin/perl
2  #  #
3  # Giuseppe Vacanti (cosine science & computing)  # After several changes in mail gtwy at ESAC, the different mail addresses
4  # $Date: 2002/02/18 20:23:57 $  # have been changed.
5  #  #
6  # It receives the mirror log for the current package on stdin.  # Mailman mail distribution lists have now the form:
7    #
8    #       list@sciops.esa.int
9    #
10    # e.g. sas-devel@sciops.esa.int, ccf@sciops.esa.int
11    #
12    # $replyto : eduardo.ojero@sciops.esa.int
13    #
14    # $Id: ccfnotify,v 1.12 2018/08/28 13:07:26 ccflib Exp $
15  #  #
16  require 5;  require 5;
17  use FileHandle;  use FileHandle;
18  use Getopt::Std;  use Getopt::Std;
19  use strict;  use strict;
20    use warnings;
21    
22  my %opts;  my %opts;
23  getopts('t:', \%opts); # -t development|release|public  getopts('t:d', \%opts); # -t development|release|public
24  my @names = @ARGV; # the rest of the command line contains the names of the                          # -d => @names (see next line) were deleted
25                     # CCF constituents  my @names = @ARGV;      # the rest of the command line contains the names of the
26                            # CCF constituents
27    
28  die("Usage: -t development|release|public\n") if(not exists $opts{'t'});  die("Usage: -t development|release|public\n") if(not exists $opts{'t'});
29    
# Line 21  my $update = $opts{'t'}; Line 31  my $update = $opts{'t'};
31  my @to;  my @to;
32  my $replyto;  my $replyto;
33  my $subject;  my $subject;
34    my $delete = $opts{'d'};
35    
36  foreach($update){  foreach($update){
37        
38    /^development$/ && do {    /^development$/ && do {
39      @to = qw/xmm-it sas-devel/;      @to = qw/sas-devel\@sciops.esa.int/;
40      $subject = "Update of the $update CCF area";      $subject = "Update of the $update CCF area";
41      $replyto = 'xmm-it@xmm.vilspa.esa.es';      $replyto = 'eduardo.ojero@esa.int';
42      next;      next;
43    };    };
44        
45    /^release$/ && do {    /^release$/ && do {
46      @to = qw/xmm-it sas-devel/;      @to = qw/ccf\@sciops.esa.int sas-devel\@sciops.esa.int/;
47      $subject = "Update of the $update CCF area";      $subject = "Update of the $update CCF area";
48      $replyto = 'xmm-it@xmm.vilspa.esa.es';      $replyto = 'eduardo.ojero@esa.int';
49      next;      next;
50    };    };
51        
52    /^public$/ && do {    /^public$/ && do {
53      @to = qw/ccf xmm-it sas-devel/;      @to = qw/ccf\@sciops.esa.int sas-devel\@sciops.esa.int/;
54      $subject = "XMM-Newton calibration update";      $subject = "XMM-Newton calibration update";
55      $replyto = 'xmmhelp@xmm.vilspa.esa.es';      $replyto = 'eduardo.ojero@esa.int';
56      next;      next;
57    };    };
58            
# Line 49  foreach($update){ Line 61  foreach($update){
61    
62  exit(0) if(not @names);  exit(0) if(not @names);
63        
64    #
65    # notice that sendmail is in /usr/lib not in /usr/bin or /usr/sbin
66    
67  foreach(@to){  foreach(@to){
68    my $fh = new FileHandle "|/usr/lib/sendmail -t" or die ("$!\n");    my $fh = new FileHandle "|/usr/lib/sendmail -t" or die ("$!\n");
69        
70    $fh->print("From: ccflib\@xmm.vilspa.esa.es    $fh->print("From: ccflib\@isciops.esa.int
71  Reply-To: $replyto  Reply-To: $replyto
72  To: $_\@xmm.vilspa.esa.es  To: $_
73  Subject: $subject  Subject: $subject
74  ");  ");
75    
76      if($delete){
77        $fh->print("\nThe following calibration constituents were deleted or moved to another directory:\n\n");
78      } else {
79        $fh->print("\nThe following new calibration constituents are available:\n\n");
80      }
81    
   $fh->print("\nThe following new calibration constituents are available:\n\n");  
     
82    foreach(@names){    foreach(@names){
83      $fh->print("$_\n");      $fh->print("$_\n");
84    }    }
# Line 70  Subject: $subject Line 87  Subject: $subject
87      $fh->print('      $fh->print('
88  For details and download instructions please refer to:  For details and download instructions please refer to:
89    
90    http://xmm.vilspa.esa.es/calibration/    https://www.cosmos.esa.int/web/xmm-newton/calibration
91    http://xmm.vilspa.esa.es/ccf/releasenotes/    https://www.cosmos.esa.int/web/xmm-newton/ccf-release-notes
92    
93  Best regards,  Best regards,
94    
95  The XMM-Newton Calibration Librarian  The XMM-Newton Calibration Librarian
96  xmmhelp@xmm.vilspa.esa.es  ---------------------------------------------------------------
97    Please reply to: ');
98  ');      $fh->print(" $replyto\n");
99    
100  undef $fh;  undef $fh;
101    
102    }    }
103    
104  }  }
   
   
   
   
   

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.27