my $help = 0;
my $build_binary = 1;
+my $batch = 0;
GetOptions ("h|help" => \$help,
- "binary!" => \$build_binary);
+ "binary!" => \$build_binary,
+ "batch!" => \$batch);
usage () if $help;
# Select build number.
my $build_number = POSIX::strftime("%Y%m%d%H%M%S", localtime);
+print "$build_number\n" if $batch;
my $topdir = getcwd ();
sub start_step {
my ($msg) = @_;
print LOG "\f\n$msg\n";
- print "$msg\n";
+ print "$msg\n" unless $batch;
}
sub set_var {
print VAR "$value\n";
close VAR;
print LOG "$var=$value\n";
- print "\t$var=$value\n";
+ print "\t$var=$value\n" unless $batch;
}
sub save_result {
# Extract source.
start_step ("Extract branch into $builddir/pspp$build_number");
run ("git archive --format=tar --prefix=pspp$build_number/ buildtmp/$$/pspp | (cd $builddir && tar xf -)");
+ run ("git branch -D buildtmp/$$/pspp");
# Extract version number.
start_step ("Extract repository version number");
Options:
--help Print this usage message and exit
+ --no-binary Build source tarballs but no binaries.
+ --batch Do not print progress to stdout.
EOF
exit(0);
}
$progress .= sprintf ", ETA %d s", $left;
}
}
- print "\r$progress", " " x (79 - length ($progress)), "\r";
+ print "\r$progress", " " x (79 - length ($progress)), "\r"
+ unless $batch;
}
close (COMMAND);
- print "\r", " " x 79, "\r";
+ print "\r", " " x 79, "\r" unless $batch;
write_timing ($id, time () - $start) if defined ($id);
return 1 if !$?;
if ($? & 127) {
- printf "%s: child died with signal %d, %s coredump\n",
+ printf STDERR "%s: child died with signal %d, %s coredump\n",
$command, ($? & 127), ($? & 128) ? 'with' : 'without';
} else {
- printf "%s: child exited with value %d\n", $command, $? >> 8;
+ printf STDERR "%s: child exited with value %d\n", $command, $? >> 8;
}
return 0;
}