mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Find ndb binaries
Verbose SafeProcess.pm mysql-test/mysql-test-run.pl: Cleanup how script find ndb binaries and paths Remove "executable_setup_failed" code, i.e either we have ndb support or we don't Remove ndb_extra_test, not used by any test. If there is a need for that, just create a new suite mysql-test/lib/My/Find.pm: Add possibility to use my_find_bin for a binary that is not required mysql-test/lib/My/SafeProcess.pm: Add verbose printous that can be turned on Wait on process also if start_kill failed Turn verbose on for windows mysql-test/lib/My/SafeProcess/safe_kill_win.cc: Extend sleep from 0 to 100 mysql-test/lib/mtr_cases.pm: Remove ndb_extra mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test: Extra checks should be for Last_IO_Errno
This commit is contained in:
@@ -26,12 +26,15 @@ use Carp;
|
||||
use My::Platform;
|
||||
|
||||
use base qw(Exporter);
|
||||
our @EXPORT= qw(my_find_bin my_find_dir);
|
||||
our @EXPORT= qw(my_find_bin my_find_dir NOT_REQUIRED);
|
||||
|
||||
our $vs_config_dir;
|
||||
|
||||
my $bin_extension= ".exe" if IS_WINDOWS;
|
||||
|
||||
# Helper function to be used for fourth parameter to find functions
|
||||
sub NOT_REQUIRED { return 0; }
|
||||
|
||||
#
|
||||
# my_find_bin - find an executable with "name_1...name_n" in
|
||||
# paths "path_1...path_n" and return the full path
|
||||
@@ -44,13 +47,21 @@ my $bin_extension= ".exe" if IS_WINDOWS;
|
||||
# ["client", "bin"],
|
||||
# "mysql");
|
||||
#
|
||||
#
|
||||
# To check if something exists, use the required parameter
|
||||
# set to 0, the function will return an empty string if the
|
||||
# binary is not found
|
||||
# my $mysql_exe= my_find_bin($basedir,
|
||||
# ["client", "bin"],
|
||||
# "mysql", 0);
|
||||
#
|
||||
# NOTE: The function honours MTR_VS_CONFIG environment variable
|
||||
#
|
||||
#
|
||||
sub my_find_bin {
|
||||
my ($base, $paths, $names)= @_;
|
||||
croak "usage: my_find_bin(<base>, <paths>, <names>)"
|
||||
unless @_ == 3;
|
||||
my ($base, $paths, $names, $required)= @_;
|
||||
croak "usage: my_find_bin(<base>, <paths>, <names>, [<required>])"
|
||||
unless @_ == 4 or @_ == 3;
|
||||
|
||||
# -------------------------------------------------------
|
||||
# Find and return the first executable
|
||||
@@ -58,6 +69,10 @@ sub my_find_bin {
|
||||
foreach my $path (my_find_paths($base, $paths, $names, $bin_extension)) {
|
||||
return $path if ( -x $path or (IS_WINDOWS and -f $path) );
|
||||
}
|
||||
if (defined $required and $required == NOT_REQUIRED){
|
||||
# Return empty string to indicate not found
|
||||
return "";
|
||||
}
|
||||
find_error($base, $paths, $names);
|
||||
}
|
||||
|
||||
@@ -79,7 +94,7 @@ sub my_find_bin {
|
||||
#
|
||||
#
|
||||
sub my_find_dir {
|
||||
my ($base, $paths, $dirs)= @_;
|
||||
my ($base, $paths, $dirs, $required)= @_;
|
||||
croak "usage: my_find_dir(<base>, <paths>[, <dirs>])"
|
||||
unless (@_ == 3 or @_ == 2);
|
||||
|
||||
|
Reference in New Issue
Block a user