/[pdpsoft]/nl.nikhef.pdp.fetchcrl/trunk/fetch-crl3.pl.cin
ViewVC logotype

Diff of /nl.nikhef.pdp.fetchcrl/trunk/fetch-crl3.pl.cin

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

nl.nikhef.pdp.fetchcrl/trunk/fetch-crl3.pl revision 2305 by davidg, Sun Jun 12 20:59:58 2011 UTC nl.nikhef.pdp.fetchcrl/trunk/fetch-crl3.pl.cin revision 2646 by davidg, Tue Jul 2 18:50:08 2013 UTC
# Line 25  use Getopt::Long qw(:config no_ignore_ca Line 25  use Getopt::Long qw(:config no_ignore_ca
25  use POSIX;  use POSIX;
26  eval { require LWP or die; }; $@ and die "Please install libwww-perl (LWP)\n";  eval { require LWP or die; }; $@ and die "Please install libwww-perl (LWP)\n";
27    
28    my $sccsid = '$Id$';
29    
30  # import modules that are needed but still external  # import modules that are needed but still external
31  # (the installed version may have these packages embedded in-line)  # (the installed version may have these packages embedded in-line)
32  #  #
# Line 46  use vars qw/ $log $cnf /; Line 48  use vars qw/ $log $cnf /;
48  #  #
49  ($cnf,$log) = &init_configuration();  ($cnf,$log) = &init_configuration();
50    
51    # use Net::INET6Glue if so requested (is not a default module)
52    if ( $cnf->{_}->{inet6glue} ) {
53      eval { require Net::INET6Glue::INET_is_INET6 or die; };
54      $@ and die "Please install Net::INET6Glue before enabling inet6glue config\n";
55    }
56    
57  # verify local installation sanity for loaded modules  # verify local installation sanity for loaded modules
58  $::log->getverbose > 6 and ! $use_DataDumper and  $::log->getverbose > 6 and ! $use_DataDumper and
59    $::log->err("Cannot set verbosity higher than 6 without Data::Dumper") and    $::log->err("Cannot set verbosity higher than 6 without Data::Dumper") and
# Line 109  sub init_configuration() { Line 117  sub init_configuration() {
117    my $verbosity;    my $verbosity;
118    my $quiet=0;    my $quiet=0;
119    my $help=0;    my $help=0;
120      my $showversion=0;
121    my $debuglevel;    my $debuglevel;
122    my $parallelism=0;    my $parallelism=0;
123    my $randomwait;    my $randomwait;
124    my $nosymlinks;    my $nosymlinks;
125    my $cfgdir;    my $cfgdir;
126      my $inet6glue=0;
127    
128    $log = FCLog->new("qualified");    $log = FCLog->new("qualified");
129    
# Line 128  sub init_configuration() { Line 138  sub init_configuration() {
138      "format=s@" => \@formats,      "format=s@" => \@formats,
139      "v|verbose+" => \$verbosity,      "v|verbose+" => \$verbosity,
140      "h|help+" => \$help,      "h|help+" => \$help,
141        "V|version+" => \$showversion,
142      "q|quiet+" => \$quiet,      "q|quiet+" => \$quiet,
143      "d|debug+" => \$debuglevel,      "d|debug+" => \$debuglevel,
144      "p|parallelism=i" => \$parallelism,      "p|parallelism=i" => \$parallelism,
145      "nosymlinks+" => \$nosymlinks,      "nosymlinks+" => \$nosymlinks,
146      "a|agingtolerance=i" => \$agingtolerance,      "a|agingtolerance=i" => \$agingtolerance,
147      "r|randomwait=i" => \$randomwait,      "r|randomwait=i" => \$randomwait,
148        "inet6glue+" => \$inet6glue,
149      ) or &help and exit(1);      ) or &help and exit(1);
150    
151    $help and &help and exit(0);    $help and &help and exit(0);
152      $showversion and &showversion and exit(0);
153    
154    $configfile ||= ( -e "/etc/fetch-crl.conf" and "/etc/fetch-crl.conf" );    $configfile ||= ( -e "/etc/fetch-crl.conf" and "/etc/fetch-crl.conf" );
155    $configfile ||= ( -e "/etc/fetch-crl.cnf" and "/etc/fetch-crl.cnf" );    $configfile ||= ( -e "/etc/fetch-crl.cnf" and "/etc/fetch-crl.cnf" );
   ($quiet > 0) and $verbosity = -$quiet;  
156    
157    $cnf = ConfigTiny->new();    $cnf = ConfigTiny->new();
158    $configfile and    $configfile and
# Line 170  sub init_configuration() { Line 182  sub init_configuration() {
182    $cnf->{_}->{parallelism}    = $parallelism if $parallelism;    $cnf->{_}->{parallelism}    = $parallelism if $parallelism;
183    $cnf->{_}->{randomwait}     = $randomwait if defined $randomwait;    $cnf->{_}->{randomwait}     = $randomwait if defined $randomwait;
184    $cnf->{_}->{nosymlinks}     = $nosymlinks if defined $nosymlinks;    $cnf->{_}->{nosymlinks}     = $nosymlinks if defined $nosymlinks;
185      $cnf->{_}->{inet6glue}      = $inet6glue if $inet6glue;
186    
187      # deal with interaction of verbosity in logfile and quiet option
188      # since a noquiet config option can cancel it
189      if ( not defined $cnf->{_}->{noquiet} ) {
190        if ( $quiet == 1) { $cnf->{_}->{verbosity} = -1; }
191      } else {
192        if ( $quiet >= 2) { $cnf->{_}->{verbosity} = -1; }
193      }
194    
195    # key default values    # key default values
196    defined $cnf->{_}->{version}  or $cnf->{_}->{version}    = "3+";    defined $cnf->{_}->{version}  or $cnf->{_}->{version}    = "3+";
# Line 196  sub init_configuration() { Line 217  sub init_configuration() {
217    $cnf->{_}->{nosymlinks}     ||= 0;    $cnf->{_}->{nosymlinks}     ||= 0;
218    $cnf->{_}->{verbosity}      ||= 0;    $cnf->{_}->{verbosity}      ||= 0;
219    $cnf->{_}->{debuglevel}     ||= 0;    $cnf->{_}->{debuglevel}     ||= 0;
220      $cnf->{_}->{inet6glue}      ||= 0;
221    
222    $cnf->{_}->{stateless} and delete $cnf->{_}->{statedir};    $cnf->{_}->{stateless} and delete $cnf->{_}->{statedir};
223    
# Line 227  sub init_configuration() { Line 249  sub init_configuration() {
249  # ###########################################################################  # ###########################################################################
250  #  #
251  #  #
252    sub showversion() {
253      (my $name = $0) =~ s/.*\///;
254      print "$name version @VERSION@\n";
255      print 'Revision information: $Id$'."\n";
256      return 1;
257    }
258    
259  sub help() {  sub help() {
260    (my $name = $0) =~ s/.*\///;    (my $name = $0) =~ s/.*\///;
261  print <<EOHELP;  print <<EOHELP;
# Line 273  Options: Line 302  Options:
302   -h | --help   -h | --help
303          This help text          This help text
304    
305    Version: @VERSION@
306  EOHELP  EOHELP
307    
308    return 1;    return 1;
# Line 289  sub process_metafiles(@) { Line 319  sub process_metafiles(@) {
319        $cnf->{_}->{"infodir"} and $ta->setInfodir($cnf->{_}->{"infodir"});        $cnf->{_}->{"infodir"} and $ta->setInfodir($cnf->{_}->{"infodir"});
320        $ta->loadAnchor($f) or next;        $ta->loadAnchor($f) or next;
321        $ta->saveLogMode() and $ta->setLogMode();        $ta->saveLogMode() and $ta->setLogMode();
       $ta->loadCAfiles() or next;  
322        $ta->loadState() or next;        $ta->loadState() or next;
323        $ta->retrieve or next;  
324          # using the HASH in the CA filename templates requires the CRL
325          # is retrieved first to determinte the hash
326          if ( $cnf->{_}->{"catemplate"} =~ /\@HASH\@/ ) {
327            $ta->retrieve or next;
328            $ta->loadCAfiles() or next;
329          } else {
330            $ta->loadCAfiles() or next;
331            $ta->retrieve or next;
332          }
333    
334        $ta->verifyAndConvertCRLs or next;        $ta->verifyAndConvertCRLs or next;
335            
336        my $writer = CRLWriter->new($ta);        my $writer = CRLWriter->new($ta);

Legend:
Removed from v.2305  
changed lines
  Added in v.2646

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28