}
BEGIN {
- my $ZONE = '';
+ my $Zone = '';
my $want_help = '';
my $want_version = '';
GetOptions('help' => \$want_help,
'version' => \$want_version,
'configfile|config|conf|c=s' => \$ConfigFile,
- 'zone|z=s' => \$ZONE,
+ 'zone|z=s' => \$Zone,
'with-gpgv=s' => \$GPGV_Bin,
'with-lsof=s' => \$LSOF_Bin,
'tstampcheck=i' => \$TSTAMPCHECK,
'check-config-parse' => \$CheckConfigurationParse,
) or pod2usage(-verbose => 0, -exitval => 2);
- constant->import(ZONE => $ZONE);
constant->import(DEBUG => $DEBUG);
constant->import(NOMAIL => $NOMAIL);
constant->import(TSTAMPCHECK => $TSTAMPCHECK);
open my $config, '<', $ConfigFile
or die "gatekeeper: read config $ConfigFile: $!\n";
- my $interesting = $ZONE ? undef : \%ZoneConfig;
+ my $interesting = $Zone ? undef : \%ZoneConfig;
while (<$config>) {
chomp;
next if m/^$/ || m/^\s*#/; # skip blank lines and comments
if (m/^\[([-_.[:alnum:]]*)\]/) {
# begin section
if ($1 eq 'email') { $interesting = \%EmailConfig }
- elsif ($1 eq 'zone.'.$ZONE) { $interesting = \%ZoneConfig }
+ elsif ($1 eq 'zone.'.$Zone) { $interesting = \%ZoneConfig }
else { $interesting = undef }
} elsif (not defined $interesting) {
next
close $config;
# Check if zones are configured and/or --zone given.
- if (@zonelist and $ZONE eq '') {
+ if (@zonelist and $Zone eq '') {
die "gatekeeper: zones configured but --zone parameter not given\n"
.join(' ', 'gatekeeper: known zones:', @zonelist)."\n";
- } elsif ($ZONE and not grep $_ eq $ZONE, @zonelist) {
- die "gatekeeper: requested zone '$ZONE' not configured\n"
+ } elsif ($Zone and not grep $_ eq $Zone, @zonelist) {
+ die "gatekeeper: requested zone '$Zone' not configured\n"
.join(' ', 'gatekeeper: known zones:', @zonelist)."\n";
}
our $Public_Upload_Archive_Inbox = $EmailConfig{archivebox};
our $Internal_Report_Inbox = $EmailConfig{internalbox};
- our $zone_tag = $ZoneConfig{tag} || $ZONE || 'upload';
- our $Log_Tag = $ZoneConfig{logtag} || ucfirst $ZONE || 'Upload';
+ our $zone_tag = $ZoneConfig{tag} || $Zone || 'upload';
+ our $Log_Tag = $ZoneConfig{logtag} || ucfirst $Zone || 'Upload';
our $package_config_base = $ZoneConfig{pkgconfdir};
our $package_state_base = $ZoneConfig{pkgstatedir};
our $Inbox_dir; our $Scratch_dir;
our $Stage_dir; our $Public_dir; our $Archive_dir;
- if ($ZONE) {
- print "# gatekeeper configuration as parsed for zone $ZONE:\n\n";
+ if ($Zone) {
+ print "# gatekeeper configuration as parsed for zone $Zone:\n\n";
} else {
print "# gatekeeper configuration as parsed:\n\n";
}
- print "[zone.$ZONE]\n" if $ZONE;
+ print "[zone.$Zone]\n" if $Zone;
foreach my $item ([tag => $zone_tag], [logtag => $Log_Tag],
[pkgconfdir => $package_config_base],
[pkgstatedir => $package_state_base],