/[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

trunk/fetchcrl/fetch-crl3.pl revision 1878 by davidg, Tue Aug 10 07:03:43 2010 UTC nl.nikhef.pdp.fetchcrl/trunk/fetch-crl3.pl revision 2305 by davidg, Sun Jun 12 20:59:58 2011 UTC
# Line 80  $::cnf->{_}->{"infodir"} and do { Line 80  $::cnf->{_}->{"infodir"} and do {
80      ) {      ) {
81      next if $::cnf->{_}->{nosymlinks} and -l $fn;      next if $::cnf->{_}->{nosymlinks} and -l $fn;
82      $fn =~ /.*\/([^\/]+)(\.crl_url|\.info)$/;      $fn =~ /.*\/([^\/]+)(\.crl_url|\.info)$/;
83      push @metafiles, $1 unless grep /$1/,@metafiles or not defined $1;      push @metafiles, $1 unless grep /^$1$/,@metafiles or not defined $1;
84    }    }
85  };  };
86    
# Line 113  sub init_configuration() { Line 113  sub init_configuration() {
113    my $parallelism=0;    my $parallelism=0;
114    my $randomwait;    my $randomwait;
115    my $nosymlinks;    my $nosymlinks;
116      my $cfgdir;
117    
118    $log = FCLog->new("qualified");    $log = FCLog->new("qualified");
119    
# Line 121  sub init_configuration() { Line 122  sub init_configuration() {
122      "l|infodir=s" => \$infodir,      "l|infodir=s" => \$infodir,
123      "cadir=s" => \$cadir,      "cadir=s" => \$cadir,
124      "s|statedir=s" => \$statedir,      "s|statedir=s" => \$statedir,
125        "cfgdir=s" => \$cfgdir,
126      "T|httptimeout=i" => \$httptimeout,      "T|httptimeout=i" => \$httptimeout,
127      "o|output=s" => \$output,      "o|output=s" => \$output,
128      "format=s@" => \@formats,      "format=s@" => \@formats,
# Line 145  sub init_configuration() { Line 147  sub init_configuration() {
147      $cnf->read($configfile) || die "Invalid config file $configfile:\n  " .      $cnf->read($configfile) || die "Invalid config file $configfile:\n  " .
148                                     $cnf->errstr . "\n";                                     $cnf->errstr . "\n";
149    
150      ( defined $cnf->{_}->{cfgdir} and $cfgdir = $cnf->{_}->{cfgdir} )
151        unless defined $cfgdir;
152      $cfgdir ||= "/etc/fetch-crl.d";
153      if ( defined $cfgdir and -d $cfgdir and opendir(my $dh,$cfgdir) ) {
154        while ( my $fn = readdir $dh ) {
155          -f "$cfgdir/$fn" and -r "$cfgdir/$fn" and $cnf->read("$cfgdir/$fn");
156        }
157        close $dh;
158      }
159    
160    # command-line option overrides    # command-line option overrides
161    $cnf->{_}->{agingtolerance} = $agingtolerance if defined $agingtolerance;    $cnf->{_}->{agingtolerance} = $agingtolerance if defined $agingtolerance;
162    $cnf->{_}->{infodir}        = $infodir if defined $infodir;    $cnf->{_}->{infodir}        = $infodir if defined $infodir;
# Line 154  sub init_configuration() { Line 166  sub init_configuration() {
166    $cnf->{_}->{verbosity}      = $verbosity if defined $verbosity;    $cnf->{_}->{verbosity}      = $verbosity if defined $verbosity;
167    $cnf->{_}->{debuglevel}     = $debuglevel if defined $debuglevel;    $cnf->{_}->{debuglevel}     = $debuglevel if defined $debuglevel;
168    $cnf->{_}->{output}         = $output if defined $output;    $cnf->{_}->{output}         = $output if defined $output;
169    $cnf->{_}->{formats}        = join "&",@formats if @formats;    $cnf->{_}->{formats}        = join "\001",@formats if @formats;
170    $cnf->{_}->{parallelism}    = $parallelism if $parallelism;    $cnf->{_}->{parallelism}    = $parallelism if $parallelism;
171    $cnf->{_}->{randomwait}     = $randomwait if defined $randomwait;    $cnf->{_}->{randomwait}     = $randomwait if defined $randomwait;
172    $cnf->{_}->{nosymlinks}     = $nosymlinks if defined $nosymlinks;    $cnf->{_}->{nosymlinks}     = $nosymlinks if defined $nosymlinks;
# Line 176  sub init_configuration() { Line 188  sub init_configuration() {
188    defined $cnf->{_}->{nametemplate_pem} or    defined $cnf->{_}->{nametemplate_pem} or
189      $cnf->{_}->{nametemplate_pem} = "\@ANCHORNAME\@.\@R\@.crl.pem";      $cnf->{_}->{nametemplate_pem} = "\@ANCHORNAME\@.\@R\@.crl.pem";
190    defined $cnf->{_}->{catemplate} or    defined $cnf->{_}->{catemplate} or
191      $cnf->{_}->{catemplate} = "\@ALIAS\@.pem&".      $cnf->{_}->{catemplate} = "\@ALIAS\@.pem\001".
192                                "\@ALIAS\@.\@R\@&\@ANCHORNAME\@.\@R\@";                                "\@ALIAS\@.\@R\@\001\@ANCHORNAME\@.\@R\@";
193    
194    $cnf->{_}->{nonssverify}    ||= 0;    $cnf->{_}->{nonssverify}    ||= 0;
195    $cnf->{_}->{nocache}        ||= 0;    $cnf->{_}->{nocache}        ||= 0;
# Line 189  sub init_configuration() { Line 201  sub init_configuration() {
201    
202    # expand array keys in config    # expand array keys in config
203    defined $cnf->{_}->{formats} and    defined $cnf->{_}->{formats} and
204      @{$cnf->{_}->{formats_}} = split(/[&;,\s]+/,$cnf->{_}->{formats});      @{$cnf->{_}->{formats_}} = split(/[\001;,\s]+/,$cnf->{_}->{formats});
205    
206    # sanity check on configuration    # sanity check on configuration
207    $cnf->{_}->{statedir} and ! -d $cnf->{_}->{statedir} and    $cnf->{_}->{statedir} and ! -d $cnf->{_}->{statedir} and
# Line 200  sub init_configuration() { Line 212  sub init_configuration() {
212    # initialize logging    # initialize logging
213    $log->flush;    $log->flush;
214    $cnf->{_}->{logmode} and $log->destremove("qualified") and do {    $cnf->{_}->{logmode} and $log->destremove("qualified") and do {
215      foreach ( split(/[,&]+/,$cnf->{_}->{logmode}) ) {      foreach ( split(/[,\001]+/,$cnf->{_}->{logmode}) ) {
216        if ( /^syslog$/ ) { $log->destadd($_,$cnf->{_}->{syslogfacility}); }        if ( /^syslog$/ ) { $log->destadd($_,$cnf->{_}->{syslogfacility}); }
217        elsif ( /^(direct|qualified|cache)$/ ) { $log->destadd($_); }        elsif ( /^(direct|qualified|cache)$/ ) { $log->destadd($_); }
218        else { die "Invalid log destination $_, exiting.\n"; }        else { die "Invalid log destination $_, exiting.\n"; }

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

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