summaryrefslogtreecommitdiff
path: root/Build-tools/Bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'Build-tools/Bootstrap')
-rwxr-xr-xBuild-tools/Bootstrap38
1 files changed, 29 insertions, 9 deletions
diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap
index 33eca958ae0..94446d9880f 100755
--- a/Build-tools/Bootstrap
+++ b/Build-tools/Bootstrap
@@ -10,6 +10,7 @@
# written by Lenz Grimmer <lenz@mysql.com>
#
+use Cwd;
use Getopt::Long;
Getopt::Long::Configure ("bundling");
@@ -26,18 +27,19 @@ else
# Some predefined settings
$build_command= "BUILD/compile-pentium-max";
-chomp ($LOGFILE= `pwd`);
-$LOGFILE.= "/Bootstrap.log";
-chomp ($opt_directory= `pwd`);
-$opt_docdir= $opt_directory . "/mysqldoc";
+$PWD= cwd();
+$LOGFILE= $PWD . "/Bootstrap.log";
+$opt_docdir= $PWD . "/mysqldoc";
$opt_build_command= undef;
$opt_changelog= undef;
$opt_delete= undef;
+$opt_directory= $PWD;
$opt_dry_run= undef;
$opt_export_only= undef;
$opt_help= $opt_verbose= 0;
$opt_log= undef;
$opt_mail= "";
+$opt_pull= undef;
$opt_revision= undef;
$opt_suffix= "";
$opt_test= undef;
@@ -58,6 +60,7 @@ GetOptions(
"help|h",
"log|l:s",
"mail|m=s",
+ "pull|p",
"revision|r=s",
"skip-check|s",
"skip-manual",
@@ -80,8 +83,7 @@ if (defined $opt_log)
}
else
{
- chomp ($LOGFILE= `pwd`);
- $LOGFILE.= "/" . $opt_log;
+ $LOGFILE= $PWD . "/" . $opt_log;
}
}
}
@@ -103,7 +105,7 @@ defined($REPO=$ARGV[0]) || print_help("Please enter the BK repository to be used
system ("bk help > /dev/null") == 0 or &abort("Cannot execute BitKeeper binary!");
system ("bk root $REPO > /dev/null 2>&1") == 0 or &abort("$REPO does not seem to be a valid BK repository!");
-if (($opt_directory ne ".") && (!-d $opt_directory && !$opt_dry_run))
+if (($opt_directory ne $PWD) && (!-d $opt_directory && !$opt_dry_run))
{
&abort("Could not find target directory \"$opt_directory\"!");
}
@@ -111,6 +113,23 @@ if (($opt_directory ne ".") && (!-d $opt_directory && !$opt_dry_run))
&logger("Logging to $LOGFILE") if (defined $opt_log);
#
+# Pull recent changes first
+#
+if ($opt_pull)
+{
+ &logger("Updating BK tree $REPO to latest ChangeSet first");
+ $command= "cd $REPO; bk pull; cd ..";
+ &run_command($command, "Could not update $REPO!");
+
+ unless ($opt_skip_manual)
+ {
+ &logger("Updating manual tree in $opt_docdir");
+ $command= "cd $opt_docdir; bk pull; cd ..";
+ &run_command($command, "Could not update $opt_docdir!");
+ }
+}
+
+#
# Use a temporary name until we know the version number
#
$target_dir= $opt_directory . "/mysql-" . $$ . "-" . time() . ".tmp";
@@ -253,7 +272,7 @@ if (defined $opt_changelog)
#
# Add the latest manual from the mysqldoc tree
#
-if (!$opt_skip_manual)
+unless ($opt_skip_manual)
{
$msg= "Adding manual.texi";
&logger($msg);
@@ -310,7 +329,7 @@ $command= "make dist";
if ($opt_win_dist)
{
&logger ("Creating Windows source package");
- $command= "./scripts/make_win_src_distibution";
+ $command= "./scripts/make_win_src_distribution --tar --zip";
&run_command($command, "make_win_src_distribution failed!");
}
@@ -378,6 +397,7 @@ Options:
include a log file snippet, if logging is enabled)
Note that the \@-Sign needs to be quoted!
Example: --mail=user\\\@domain.com
+-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)
-s, --skip-check Skip checking the distribution with "make distcheck"