Commit 5e2c0f82 authored by Joerg Bruehe's avatar Joerg Bruehe

Fight a problem in internal test builds:

When a RPM test build in a non-release branch is done,
the $MYSQL_BINDIR variable ends in "/usr"
(rather than in "/usr/lib" as in a RPM release build),
this made test "file_contents" fail.

A branch for this case is added to the test.
The test result is unchanged.



mysql-test/t/file_contents.test:
  Fight a problem in internal test builds:
  
  When a RPM test build in a non-release branch is done,
  the $MYSQL_BINDIR variable ends in "/usr"
  (rather than in "/usr/lib" as in a RPM release build),
  this made test "file_contents" fail.
  
  Because of this, the old logic did not recognize
  that a RPM build is done (trailing '/' missing!)
  and took the tar.gz branch.
  Just removing the trailing '/' from the "/usr" is
  not enough, as the logic for RPMs used to replace
  "/lib" which is not present at all; rather, a new
  branch was added.
  
  To help in case of future problems, the error messages
  for a failing "open()" now also report "$MYSQL_BINDIR".
parent c57be2cd
...@@ -10,9 +10,10 @@ ...@@ -10,9 +10,10 @@
--perl --perl
print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n"; print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n";
$dir_docs = $ENV{'MYSQL_BINDIR'}; $dir_bin = $ENV{'MYSQL_BINDIR'};
if($dir_docs =~ m|/usr/|) { if ($dir_bin =~ m|/usr/|) {
# RPM package # RPM package
$dir_docs = $dir_bin;
$dir_docs =~ s|/lib|/share/doc|; $dir_docs =~ s|/lib|/share/doc|;
if(-d "$dir_docs/packages/MySQL-server") { if(-d "$dir_docs/packages/MySQL-server") {
# SuSE # SuSE
...@@ -21,8 +22,19 @@ if($dir_docs =~ m|/usr/|) { ...@@ -21,8 +22,19 @@ if($dir_docs =~ m|/usr/|) {
# RedHat: version number in directory name # RedHat: version number in directory name
$dir_docs = glob "$dir_docs/MySQL-server*"; $dir_docs = glob "$dir_docs/MySQL-server*";
} }
} elsif ($dir_bin =~ m|/usr$|) {
# RPM build during development
$dir_docs = "$dir_bin/share/doc";
if(-d "$dir_docs/packages/MySQL-server") {
# SuSE
$dir_docs = "$dir_docs/packages/MySQL-server";
} else {
# RedHat: version number in directory name
$dir_docs = glob "$dir_docs/MySQL-server*";
}
} else { } else {
# tar.gz package, Windows, or developer work (in BZR) # tar.gz package, Windows, or developer work (in BZR)
$dir_docs = $dir_bin;
$dir_docs =~ s|/lib||; $dir_docs =~ s|/lib||;
if(-d "$dir_docs/docs") { if(-d "$dir_docs/docs") {
$dir_docs = "$dir_docs/docs"; # package $dir_docs = "$dir_docs/docs"; # package
...@@ -32,7 +44,7 @@ if($dir_docs =~ m|/usr/|) { ...@@ -32,7 +44,7 @@ if($dir_docs =~ m|/usr/|) {
} }
$found_version = "No line 'MySQL source #.#.#'"; $found_version = "No line 'MySQL source #.#.#'";
$found_revision = "No line 'revision-id: .....'"; $found_revision = "No line 'revision-id: .....'";
open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs'\n"; open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs' (starting from bindir '$dir_bin')\n";
while(defined ($line = <I_SRC>)) { while(defined ($line = <I_SRC>)) {
if ($line =~ m|^MySQL source \d\.\d\.\d+|) {$found_version = "Found MySQL version number";} if ($line =~ m|^MySQL source \d\.\d\.\d+|) {$found_version = "Found MySQL version number";}
if ($line =~ m|^revision-id: .*@.*-2\d{13}-\w+$|) {$found_revision = "Found BZR revision id";} if ($line =~ m|^revision-id: .*@.*-2\d{13}-\w+$|) {$found_revision = "Found BZR revision id";}
...@@ -41,7 +53,7 @@ close I_SRC; ...@@ -41,7 +53,7 @@ close I_SRC;
print "INFO_SRC: $found_version / $found_revision\n"; print "INFO_SRC: $found_version / $found_revision\n";
$found_compiler = "No line about compiler information"; $found_compiler = "No line about compiler information";
$found_features = "No line 'Feature flags'"; $found_features = "No line 'Feature flags'";
open(I_BIN,"<","$dir_docs/INFO_BIN") or print "Cannot open 'INFO_BIN' in '$dir_docs'\n"; open(I_BIN,"<","$dir_docs/INFO_BIN") or print "Cannot open 'INFO_BIN' in '$dir_docs' (starting from bindir '$dir_bin')\n";
while(defined ($line = <I_BIN>)) { while(defined ($line = <I_BIN>)) {
# "generator" on Windows, "flags" on Unix: # "generator" on Windows, "flags" on Unix:
if (($line =~ m| Compiler / generator used: |) || if (($line =~ m| Compiler / generator used: |) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment