mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
Bootstrap enhancements:
- Changed the default log file name to Bootstrap-<repository>.log (e.g. Bootstrap-mysql-4.0.log) (thanks to Joerg for the hint) - added option "--archive-log" to automatically move the log file into the Log directory of the exported tree
This commit is contained in:
parent
f78ec279e9
commit
cc89f70dfa
1 changed files with 33 additions and 11 deletions
|
@ -28,8 +28,8 @@ else
|
||||||
# Some predefined settings
|
# Some predefined settings
|
||||||
$build_command= "BUILD/compile-pentium-max";
|
$build_command= "BUILD/compile-pentium-max";
|
||||||
$PWD= cwd();
|
$PWD= cwd();
|
||||||
$LOGFILE= $PWD . "/Bootstrap.log";
|
|
||||||
$opt_docdir= $PWD . "/mysqldoc";
|
$opt_docdir= $PWD . "/mysqldoc";
|
||||||
|
$opt_archive_log= undef;
|
||||||
$opt_build_command= undef;
|
$opt_build_command= undef;
|
||||||
$opt_changelog= undef;
|
$opt_changelog= undef;
|
||||||
$opt_delete= undef;
|
$opt_delete= undef;
|
||||||
|
@ -51,6 +51,7 @@ $version= "unknown";
|
||||||
$major=$minor=$release=0;
|
$major=$minor=$release=0;
|
||||||
|
|
||||||
GetOptions(
|
GetOptions(
|
||||||
|
"archive-log|a",
|
||||||
"build-command|b=s",
|
"build-command|b=s",
|
||||||
"changelog|c:s",
|
"changelog|c:s",
|
||||||
"directory|d=s",
|
"directory|d=s",
|
||||||
|
@ -72,6 +73,17 @@ GetOptions(
|
||||||
"quiet|q",
|
"quiet|q",
|
||||||
) || print_help("");
|
) || print_help("");
|
||||||
|
|
||||||
|
#
|
||||||
|
# Override predefined build command
|
||||||
|
#
|
||||||
|
if (defined $opt_build_command)
|
||||||
|
{
|
||||||
|
$build_command= $opt_build_command;
|
||||||
|
}
|
||||||
|
|
||||||
|
print_help("") if ($opt_help);
|
||||||
|
defined($REPO=$ARGV[0]) || print_help("Please enter the BK repository to be used!");
|
||||||
|
|
||||||
#
|
#
|
||||||
# Override predefined Log file name
|
# Override predefined Log file name
|
||||||
#
|
#
|
||||||
|
@ -89,18 +101,11 @@ if (defined $opt_log)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
#
|
|
||||||
# Override predefined build command
|
|
||||||
#
|
|
||||||
if (defined $opt_build_command)
|
|
||||||
{
|
{
|
||||||
$build_command= $opt_build_command;
|
$LOGFILE= $PWD . "/Bootstrap-" . $REPO . ".log";
|
||||||
}
|
}
|
||||||
|
|
||||||
print_help("") if ($opt_help);
|
|
||||||
defined($REPO=$ARGV[0]) || print_help("Please enter the BK repository to be used!");
|
|
||||||
|
|
||||||
&logger("Starting build");
|
&logger("Starting build");
|
||||||
&abort("The directory \"$REPO\" could not be found!") if (!-d $REPO);
|
&abort("The directory \"$REPO\" could not be found!") if (!-d $REPO);
|
||||||
&logger("Using $REPO as the BK parent repository");
|
&logger("Using $REPO as the BK parent repository");
|
||||||
|
@ -351,6 +356,21 @@ if (!$opt_skip_check)
|
||||||
# All done when we came down here
|
# All done when we came down here
|
||||||
#
|
#
|
||||||
&logger("SUCCESS: Build finished successfully.") if (!$opt_dry_run);
|
&logger("SUCCESS: Build finished successfully.") if (!$opt_dry_run);
|
||||||
|
|
||||||
|
#
|
||||||
|
# Move the log file into the Log dir of the target dir
|
||||||
|
#
|
||||||
|
if ($opt_archive_log)
|
||||||
|
{
|
||||||
|
my $logdir= $target_dir . "/Logs";
|
||||||
|
&logger("Moving $LOGFILE to $logdir");
|
||||||
|
mkdir "$logdir" if (! -d $logdir);
|
||||||
|
$command= "mv ";
|
||||||
|
$command.= "-v " if ($opt_verbose || defined $opt_log);
|
||||||
|
$command.= "$LOGFILE $logdir";
|
||||||
|
&run_command($command, "Could not move $LOGFILE to $logdir!");
|
||||||
|
}
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -378,6 +398,8 @@ distribution check can be run before the source archive is being created.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
|
-a, --archive-log Move the log file into the Logs directory of
|
||||||
|
the exported tree after a successful build
|
||||||
-b, --build-command=<cmd> Use <cmd> to compile the sources before packing
|
-b, --build-command=<cmd> Use <cmd> to compile the sources before packing
|
||||||
the distribution.
|
the distribution.
|
||||||
(default is "$build_command")
|
(default is "$build_command")
|
||||||
|
@ -398,7 +420,7 @@ Options:
|
||||||
do not build or test the source distribution
|
do not build or test the source distribution
|
||||||
-h, --help Print this help message
|
-h, --help Print this help message
|
||||||
-l, --log[=<filename>] Write a log file [to <filename>]
|
-l, --log[=<filename>] Write a log file [to <filename>]
|
||||||
(default is "$LOGFILE")
|
(default is "./Bootstrap-<bk repository>.log")
|
||||||
-m, --mail=<address> Mail a failure report to the given address (and
|
-m, --mail=<address> Mail a failure report to the given address (and
|
||||||
include a log file snippet, if logging is enabled)
|
include a log file snippet, if logging is enabled)
|
||||||
Note that the \@-Sign needs to be quoted!
|
Note that the \@-Sign needs to be quoted!
|
||||||
|
|
Loading…
Add table
Reference in a new issue