summaryrefslogtreecommitdiff
path: root/Build-tools
diff options
context:
space:
mode:
Diffstat (limited to 'Build-tools')
-rwxr-xr-xBuild-tools/Bootstrap9
-rwxr-xr-xBuild-tools/Do-compile19
-rw-r--r--Build-tools/logger.pm15
-rwxr-xr-xBuild-tools/my_md5sum19
-rwxr-xr-xBuild-tools/mysql-copyright18
5 files changed, 69 insertions, 11 deletions
diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap
index a46d83ca91c..fa3c6344a05 100755
--- a/Build-tools/Bootstrap
+++ b/Build-tools/Bootstrap
@@ -46,6 +46,7 @@ $opt_test= undef;
$opt_skip_check= undef;
$opt_skip_manual= undef;
$opt_win_dist= undef;
+$opt_quiet= undef;
$version= "unknown";
$major=$minor=$release=0;
@@ -67,7 +68,8 @@ GetOptions(
"suffix=s",
"test|t",
"verbose|v",
- "win-dist|w"
+ "win-dist|w",
+ "quiet|q",
) || print_help("");
#
@@ -99,8 +101,6 @@ if (defined $opt_build_command)
print_help("") if ($opt_help);
defined($REPO=$ARGV[0]) || print_help("Please enter the BK repository to be used!");
-$subject= "Bootstrap of $REPO failed" if $opt_mail;
-
&logger("Starting build");
&abort("The directory \"$REPO\" could not be found!") if (!-d $REPO);
&logger("Using $REPO as the BK parent repository");
@@ -306,7 +306,7 @@ if (!$opt_dry_run)
#
# Now build the source distribution
#
-&logger("Compiling");
+&logger("Compiling...");
$command= $build_command;
&run_command($command, "Compilation failed!");
@@ -403,6 +403,7 @@ Options:
include a log file snippet, if logging is enabled)
Note that the \@-Sign needs to be quoted!
Example: --mail=user\\\@domain.com
+-q, --quiet Be quiet
-p, --pull Update the source BK trees before building
-r, --revision=<rev> Export the tree as of revision <rev>
(default is up to the latest revision)
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile
index cf466ef5848..f47ae794b00 100755
--- a/Build-tools/Do-compile
+++ b/Build-tools/Do-compile
@@ -204,6 +204,17 @@ if ($opt_stage == 0)
safe_cd($host);
if ($opt_stage == 0 && ! $opt_use_old_distribution)
{
+ $md5_result= safe_system("./my_md5sum -c ${opt_distribution}.md5");
+
+ if ($md5_result != 0)
+ {
+ abort("MD5 failed for $opt_distribution!");
+ }
+ else
+ {
+ info("SUCCESS: MD5 checks for $opt_distribution");
+ }
+
safe_system("gunzip < $opt_distribution | $tar xf -");
# Fix file times; This is needed because the time for files may be
@@ -331,6 +342,9 @@ if ($opt_stage <= 3)
$tar_file=<$pwd/$host/mysql*.t*gz>;
abort ("Could not find tarball!") unless ($tar_file);
+# Generate the MD5 for the binary distribution
+safe_system("./my_md5sum $tar_file > ${tar_file}.md5}");
+
#
# Unpack the binary distribution
#
@@ -660,7 +674,10 @@ sub safe_system
my($com,$res)=@_;
print LOG "$com\n";
print "$host: $com\n" if ($opt_debug);
- system("$com >> $log 2>&1") && abort("error: Couldn't execute command, error: " . ($? / 256));
+ my $result= system("$com >> $log 2>&1");
+ abort("error: Couldn't execute command, error: " . ($? / 256)) unless $result == 0;
+
+ return $result;
}
sub check_system
diff --git a/Build-tools/logger.pm b/Build-tools/logger.pm
index 835d8014aa0..d3fb4c9db2f 100644
--- a/Build-tools/logger.pm
+++ b/Build-tools/logger.pm
@@ -5,7 +5,10 @@
#
sub logger
{
- my $message=$_[0];
+ my $message= $_[0];
+ my $cmnd= $_[1];
+
+ print $message . "\n" if !$opt_quiet && !$opt_verbose && !$cmnd;
print timestamp() . " " . $message . "\n" if $opt_verbose;
if (defined $opt_log && !$opt_dry_run)
{
@@ -30,9 +33,12 @@ sub run_command
}
else
{
- &logger($command);
- $command.= " >> $LOGFILE 2>&1" if defined $opt_log;
- $command.= " > /dev/null" if (!$opt_verbose && !$opt_log);
+ &logger($command, 1);
+
+ $command.= ';' unless ($command =~ m/^.*;$/);
+
+ $command =~ s/;/ >> $LOGFILE 2>&1;/g if defined $opt_log;
+ $command =~ s/;/ > \/dev\/null;/g if (!$opt_verbose && !$opt_log);
system($command) == 0 or &abort("$errormsg\n");
}
}
@@ -47,6 +53,7 @@ sub abort
{
my $message= $_[0];
my $messagefile;
+ my $subject= "Bootstrap of $REPO failed" if $opt_mail;
$message= "ERROR: " . $message;
&logger($message);
diff --git a/Build-tools/my_md5sum b/Build-tools/my_md5sum
index 20742ee2ed0..f4ac2f7d674 100755
--- a/Build-tools/my_md5sum
+++ b/Build-tools/my_md5sum
@@ -10,10 +10,22 @@
# Written by Matt Wagner <matt@mysql.com>
#
use strict;
+
+#
+# Use local perl libraries first. 'unshift' adds to the front of @INC
+# The local perl library dir hidden is $HOME/.perllibs on each build host
+#
+BEGIN
+{
+ my $homedir= $ENV{HOME};
+ unshift (@INC, "$homedir/.perllibs");
+}
+
use Digest::MD5;
use Getopt::Long;
-my $VER= "1.1";
+my $VER= "1.3";
+my $EXIT= 0;
#
# Strip the leading path info off the program name ($0). We want 'my_md5sum'
@@ -67,6 +79,9 @@ if ($opt_check)
# Print an error message if they don't match, else print OK
print "$checkfile: FAILED\n" if $digest ne $checksum;
print "$checkfile: OK\n" if $digest eq $checksum;
+
+ # Set the exit() status to non-zero if FAILED
+ $EXIT= 1 if $digest ne $checksum;
}
}
# Else generate the MD5 digest to STDOUT
@@ -80,6 +95,8 @@ else
}
}
+exit($EXIT);
+
#
# This routine generates the MD5 digest of a file
diff --git a/Build-tools/mysql-copyright b/Build-tools/mysql-copyright
index f2da3cdf447..e1ee513e06d 100755
--- a/Build-tools/mysql-copyright
+++ b/Build-tools/mysql-copyright
@@ -162,7 +162,23 @@ sub trim_the_fat
undef $/;
my $configure= <CONFIGURE>;
close(CONFIGURE);
- $configure=~ s|${the_fat}/Makefile dnl\n?||g;
+
+ #
+ # If $the_fat Makefile line closes the parenthesis, then
+ # replace that line with just the closing parenthesis.
+ #
+ if ($configure=~ m|${the_fat}/Makefile\)\n?|)
+ {
+ $configure=~ s|${the_fat}/Makefile(\)\n?)|$1|;
+ }
+ #
+ # Else just delete the line
+ #
+ else
+ {
+ $configure=~ s|${the_fat}/Makefile dnl\n?||;
+ }
+
open(CONFIGURE,">configure.in") or die "Unable to open configure.in for write: $!\n";
print CONFIGURE $configure;
close(CONFIGURE);