=head1 SYNOPSIS
-gatekeeper.pl -B<s> I<style> [-B<d> I<debuglevel>] [-B<v>] [-B<h>]
+gatekeeper.pl -B<z> I<zone> [-B<d> I<debuglevel>]
-gatekeeper.pl --B<style> I<style> [--B<debug> I<debuglevel>]
+gatekeeper.pl --B<zone> I<zone> [--B<debug> I<debuglevel>]
gatekeeper.pl --B<version>
Show version information and exit.
-=item B<--style>
+=item B<--zone>
-Specify the style to use. The "style" selects a configuration subset for
+Specify the zone to process. The "zone" selects a configuration subset for
the role the tool should process on this run. Each role is for a different
collection of files to be managed.
-Currently, styles are hardwired in the tool:
+Currently, zones are hardwired in the tool:
=over
#
# These should be changed to constants eventually, since they should not
# change after the script is started.
- our $style = '';
+ our $zone = '';
our $help = '';
our $version = '';
# Set this to 1 or higher to get debug output in the log file.
GetOptions('help' => \$help,
'version' => \$version,
- 'style=s' => \$style,
+ 'zone|z|s=s' => \$zone,
'tstampcheck=i' => \$TSTAMPCHECK,
'nomail=i' => \$NOMAIL,
- 'debug=i' => \$DEBUG,
+ 'debug|d=i' => \$DEBUG,
'testing-this-script' => \$TestingMode,
);
}
}
-our $style;
+our $zone;
our $help;
our $version;
pod2usage(-verbose => 1, -exitval => 0) if ($help);
pod2usage(-message => 'ERROR: Required parameter not given or invalid.',
-verbose => 0, -exitval => 2)
- if (($style ne 'ftp') && ($style ne 'alpha') && ($style ne 'distros'));
+ if (($zone ne 'ftp') && ($zone ne 'alpha') && ($zone ne 'distros'));
-my $m_style = 'ftp';
-$m_style = 'alpha' if ($style eq 'alpha');
-$m_style = 'gnu+linux-distros' if ($style eq 'distros');
+my $zone_tag = 'ftp';
+$zone_tag = 'alpha' if ($zone eq 'alpha');
+$zone_tag = 'gnu+linux-distros' if ($zone eq 'distros');
# Settings to configure:
my $package_config_base = "/home/gatekpr/packages";
{
# where ftpd deposits the files for us to look at:
- our $Inbox_dir = "/home/upload/incoming/$m_style";
+ our $Inbox_dir = "/home/upload/incoming/$zone_tag";
# private dir on SAME FILESYSTEM as $Inbox_dir:
- our $Scratch_dir = "/var/tmp/$m_style-in";
+ our $Scratch_dir = "/var/tmp/$zone_tag-in";
# top-level public ftp dir for installing files:
- our $Public_dir = "/home/$m_style/gnu";
- $Public_dir = "/home/ftp/$m_style"
- if ($m_style eq 'gnu+linux-distros'); # The distros go here
+ our $Public_dir = "/home/$zone_tag/gnu";
+ $Public_dir = "/home/ftp/$zone_tag"
+ if ($zone_tag eq 'gnu+linux-distros'); # The distros go here
# private dir on SAME FILESYSTEM as $Public_dir:
- our $Archive_dir = "/home/gatekpr/$m_style-archived";
+ our $Archive_dir = "/home/gatekpr/$zone_tag-archived";
# private dir on SAME FILESYSTEM as $Public_dir:
- our $Stage_dir = "/var/tmp/$m_style-out";
+ our $Stage_dir = "/var/tmp/$zone_tag-out";
}
# We sometimes want to exclude e-mail addresses from being emailed.
# this, inside parentheses, to all messages logged.
if (IN_TEST_MODE) {
# override log message tag
- our $Log_Style = 'Test';
+ our $Log_Tag = 'Test';
} else {
- our $Log_Style = 'GNU';
- $Log_Style = 'Alpha' if ($style eq 'alpha');
- $Log_Style = 'Distros' if ($style eq 'distros');
+ our $Log_Tag = 'GNU';
+ $Log_Tag = 'Alpha' if ($zone eq 'alpha');
+ $Log_Tag = 'Distros' if ($zone eq 'distros');
}
# If this is set to a defined value, ftp_syslog will prepend it, inside
my $priority = shift;
my $message = shift;
- our $Log_Style; our $Phase;
+ our $Log_Tag; our $Phase;
# Remove a trailing newline
$message =~ s/[\r\n]+$//;
# Prepend the current phase, if set
$message = '['.$Phase.'] '.$message if defined $Phase;
- # Prepend the log style tag
- $message = '('.$Log_Style.') '.$message;
+ # Prepend the zone indicator log tag
+ $message = '('.$Log_Tag.') '.$message;
# The syslog function is pretty picky, and (sometimes) dies silently
# when using non-valid syslog priorities.
# return @_;
if ($subject ne '') {
- $subject = "[$m_style gnu-ftp-upload] $subject";
+ $subject = "[$zone_tag gnu-ftp-upload] $subject";
} elsif (defined $info{package}) {
- $subject = "[$m_style gnu-ftp-upload] $info{package}";
+ $subject = "[$zone_tag gnu-ftp-upload] $info{package}";
} else {
- $subject = "[$m_style gnu-ftp-upload] generic failure";
+ $subject = "[$zone_tag gnu-ftp-upload] generic failure";
}
# Wrap message at 78 characters, this is e-mail...
[[To => $maintainer_email],
[From => 'ftp-upload-script@gnu.org'],
[Date => strftime("%a, %e %b %Y %H:%M:%S %z", localtime)],
- [Subject => ("[$m_style gnu-ftp-debug] "
+ [Subject => ("[$zone_tag gnu-ftp-debug] "
."new upload processed: $package_name")],
['Reply-To' => 'ftp-upload@gnu.org'],
['Message-ID'=> Email::MessageID->new->in_brackets],