summaryrefslogtreecommitdiff
path: root/Build-tools
diff options
context:
space:
mode:
authorunknown <joerg@mysql.com>2005-03-30 20:39:37 +0200
committerunknown <joerg@mysql.com>2005-03-30 20:39:37 +0200
commitcc3cadb7f455862c5700806b5c845535191de7d2 (patch)
tree9c13c2b589b48b6978931f68b09939430a39a89d /Build-tools
parent890aa5b2587f75f572fe240b5bcd2967127d5d70 (diff)
downloadmariadb-git-cc3cadb7f455862c5700806b5c845535191de7d2.tar.gz
Fix 'Bootstrap' to bypass a problem with "bk changes" by changing the directory before calling the command.
Build-tools/Bootstrap: Bypass a BK problem with "bk changes": It stopped delivering changeset comments when 1) it encountered a single, unbroken line with about 1k characters AND 2) it was applied not to the current directory but to a named BK root directory. As 1) cannot be changed post-factum (and might happen again), the "bk changes" command is now preceded by a "cd $REPO". Do some renaming of variables used around the "bk changes" call to improve documentation.
Diffstat (limited to 'Build-tools')
-rwxr-xr-xBuild-tools/Bootstrap38
1 files changed, 25 insertions, 13 deletions
diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap
index f9bb2170156..32d371cc2c6 100755
--- a/Build-tools/Bootstrap
+++ b/Build-tools/Bootstrap
@@ -240,35 +240,47 @@ if (defined $opt_changelog)
# the last tagged ChangeSet (this relies heavily on our current tagging
# practice!)
#
- my $revision= "";
+ $opt_changelog=~ s/^=//; # Sometimes, a leading '=' was not stripped.
+ my $log_base= $opt_changelog;
+ my $changelogfile;
+ if ($target_dir =~ m:^/:) # we need an absolute path, as we change directory
+ {
+ $changelogfile= $target_dir. "/ChangeLog";
+ }
+ else
+ {
+ $changelogfile= cwd() . "/" . $target_dir . "/ChangeLog";
+ }
+
if ($opt_changelog eq "last")
{
if (!$opt_revision)
{
- $revision= `bk changes -t -d':REV:::TAG:' -n $REPO | grep mysql-$major.$minor | head -1 | cut -f1 -d ":"`;
+ $log_base= `bk changes -t -d':REV:::TAG:' -n $REPO | grep mysql-$major.$minor | head -1 | cut -f1 -d ":"`;
}
else
{
- $revision= `bk changes -r..$opt_revision -t -d':REV:' -n $REPO | head -2 | tail -1`;
+ $log_base= `bk changes -r..$opt_revision -t -d':REV:' -n $REPO | head -2 | tail -1`;
}
- chomp($revision);
- $opt_changelog= $revision;
+ chomp($log_base);
}
- $msg= "Adding $target_dir/ChangeLog";
- $msg.= " (down to revision $opt_changelog)" if $opt_changelog ne "";
+ $msg= "Adding $changelogfile";
+ $msg.= " (down to revision $log_base)" if $log_base ne "";
&logger($msg);
- $command= "bk changes -v";
- $command.= " -r" if ($opt_changelog ne "" || $opt_revision);
- $command.= $opt_changelog if $opt_changelog ne "";
- $command.= ".." if ($opt_changelog ne "" && !$opt_revision);
+ # Due to a BK error, "bk changes" must be run in $REPO !
+ $command= "cd $REPO ; ";
+ $command.= "bk changes -v";
+ $command.= " -r" if ($log_base ne "" || $opt_revision);
+ $command.= $log_base if $log_base ne "";
+ $command.= ".." if ($log_base ne "" && !$opt_revision);
$command.= ".." . $opt_revision if $opt_revision;
- $command.= " " . $REPO . " > $target_dir/ChangeLog";
+ $command.= " > $changelogfile";
&logger($command);
# We cannot use run_command here because of output redirection
unless ($opt_dry_run)
{
- system($command) == 0 or &abort("Could not create $target_dir/ChangeLog!");
+ system($command) == 0 or &abort("Could not create $changelogfile!");
}
}