1
1

Updates so that it will work with older versions of perl

This commit was SVN r2306.
Этот коммит содержится в:
Jeff Squyres 2004-08-25 18:31:43 +00:00
родитель 3fd97e3c82
Коммит f578d8cf52

Просмотреть файл

@ -15,7 +15,7 @@ use Getopt::Long;
# Set this to true for additional output; typically only when # Set this to true for additional output; typically only when
# debugging # debugging
our $debug = 0; my $debug = 0;
# download "latest" filename # download "latest" filename
my $latest_name = "latest_snapshot.txt"; my $latest_name = "latest_snapshot.txt";
@ -38,6 +38,24 @@ my $max_snapshots = 3;
# Shouldn't need to change below this line # Shouldn't need to change below this line
############################################################################ ############################################################################
# Need to define some globals here -- can't use "our" because we have
# to run on machines with older versions of perl. #$%#@$%#...
my $version;
my $mail;
my @email_output;
my $tarball_name;
my $ret;
my $scratch_root_arg;
my $email_arg;
my $url_arg;
my $config_arg;
my $debug_arg;
my $file_arg;
my $leave_install_arg;
my $help_arg;
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# send a mail # send a mail
@ -47,9 +65,6 @@ sub send_mail {
shift; shift;
my $msg = \@_; my $msg = \@_;
our $mail;
our $version;
$subject =~ s/\@version\@/$version/; $subject =~ s/\@version\@/$version/;
open MAIL, "|$mail -s \"$subject\" \"$to\"" || open MAIL, "|$mail -s \"$subject\" \"$to\"" ||
@ -68,9 +83,6 @@ sub send_mail {
sub test_abort { sub test_abort {
my $msg = \@_; my $msg = \@_;
our @email_output;
our $email_arg;
push(@email_output, "Building the nightly tarball ended in error:\n\n"); push(@email_output, "Building the nightly tarball ended in error:\n\n");
push(@email_output, @$msg); push(@email_output, @$msg);
send_mail($fail_subject, $email_arg, @email_output); send_mail($fail_subject, $email_arg, @email_output);
@ -261,9 +273,6 @@ sub try_build {
$vpath_mode, $confargs) = @_; $vpath_mode, $confargs) = @_;
my $ret; my $ret;
my $startdir = `pwd`; my $startdir = `pwd`;
our $version;
our $scratch_root_arg;
our $leave_install_arg;
chomp($startdir); chomp($startdir);
@ -414,15 +423,6 @@ int main(int argc, char* argv[]) {
# #
# parse the command line # parse the command line
our $scratch_root_arg;
our $email_arg;
our $url_arg;
our $config_arg;
our $debug_arg;
our $file_arg;
our $leave_install_arg;
my $help_arg;
&Getopt::Long::Configure("bundling", "require_order"); &Getopt::Long::Configure("bundling", "require_order");
my $ok = Getopt::Long::GetOptions("url|u=s" => \$url_arg, my $ok = Getopt::Long::GetOptions("url|u=s" => \$url_arg,
"scratch|s=s" => \$scratch_root_arg, "scratch|s=s" => \$scratch_root_arg,
@ -484,23 +484,23 @@ if ($config_arg) {
$debug = 1 $debug = 1
if ($debug_arg); if ($debug_arg);
# global vars
our @email_output;
my $ret;
# prefix the e-mail # prefix the e-mail
my $unamen = `uname -n 2>/dev/null`; my $str = "Host: ";
my $unameo = `uname -o 2>/dev/null`; my $first = 1;
my $unamer = `uname -r 2>/dev/null`; foreach my $option (qw/n o r m/) {
my $unamem = `uname -m 2>/dev/null`; my $out = `uname -$option 2>/dev/null`;
chomp($unamen); chomp($out);
chomp($unameo); if ($out) {
chomp($unamer); $str .= " / "
chomp($unamem); if (! $first);
push(@email_output, "Host: $unamen / $unameo / $unamer / $unamem\n"); $str .= $out;
$first = 0;
}
}
push(@email_output, $str . "\n");
# Find a mail program # Find a mail program
our $mail = find_program(qw(Mail mailx mail)); $mail = find_program(qw(Mail mailx mail));
die "Could not find mail program; aborting in despair\n" die "Could not find mail program; aborting in despair\n"
if (!defined($mail)); if (!defined($mail));
@ -528,8 +528,6 @@ foreach my $dir (qw(downloads)) {
} }
# if we were given a URL base, get the latest snapshot version number # if we were given a URL base, get the latest snapshot version number
our $tarball_name;
our $version;
if ($url_arg) { if ($url_arg) {
chdir("downloads"); chdir("downloads");
unlink($latest_name); unlink($latest_name);