diff options
author | unknown <msvensson@pilot.mysql.com> | 2008-02-20 14:55:30 +0100 |
---|---|---|
committer | unknown <msvensson@pilot.mysql.com> | 2008-02-20 14:55:30 +0100 |
commit | 0d01221c176da491ec96b803c3981e9432a2cfde (patch) | |
tree | abea8679a6fbc88f4b168a528803167c9af64b31 /mysql-test/lib/mtr_misc.pl | |
parent | 6f26028287968970f911adf3a47cf644d80b1002 (diff) | |
download | mariadb-git-0d01221c176da491ec96b803c3981e9432a2cfde.tar.gz |
Use My::Platform
Put all path conversions in one file
Convert the --tmpdir passed to "mysqld --verbose --help"
mysql-test/lib/My/Find.pm:
Use My::Platform
mysql-test/lib/My/SafeProcess.pm:
use My::Platform
mysql-test/lib/mtr_cases.pm:
Use My::Platform
mysql-test/lib/mtr_misc.pl:
Move 'mtr_native_path' to My::Platform
mysql-test/lib/My/Platform.pm:
New BitKeeper file ``mysql-test/lib/My/Platform.pm''
mysql-test/lib/t/Platform.t:
New BitKeeper file ``mysql-test/lib/t/Platform.t''
Diffstat (limited to 'mysql-test/lib/mtr_misc.pl')
-rw-r--r-- | mysql-test/lib/mtr_misc.pl | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index 759ad6da3bc..658eb270535 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -20,7 +20,8 @@ use strict; -sub mtr_native_path($); +use My::Platform; + sub mtr_init_args ($); sub mtr_add_arg ($$@); sub mtr_args2str($@); @@ -30,27 +31,6 @@ sub mtr_file_exists(@); sub mtr_exe_exists(@); sub mtr_exe_maybe_exists(@); -############################################################################## -# -# Misc -# -############################################################################## - -# Convert path to OS native format -sub mtr_native_path($) -{ - my $path= shift; - - # MySQL version before 5.0 still use cygwin, no need - # to convert path - return $path - if ($::mysql_version_id < 50000); - - $path=~ s/\//\\/g - if ($::is_win32); - return $path; -} - ############################################################################## # @@ -70,14 +50,14 @@ sub mtr_add_arg ($$@) { # Quote args if args contain space $format= "\"$format\"" - if ($::is_win32 and grep(/\s/, @fargs)); + if (IS_WINDOWS and grep(/\s/, @fargs)); push(@$args, sprintf($format, @fargs)); } sub mtr_args2str($@) { my $exe= shift or die; - return join(" ", mtr_native_path($exe), @_); + return join(" ", native_path($exe), @_); } ############################################################################## @@ -109,7 +89,7 @@ sub mtr_path_exists (@) { sub mtr_script_exists (@) { foreach my $path ( @_ ) { - if($::is_win32) + if(IS_WINDOWS) { return $path if -f $path; } @@ -149,10 +129,10 @@ sub mtr_file_exists (@) { sub mtr_exe_maybe_exists (@) { my @path= @_; - map {$_.= ".exe"} @path if $::is_win32; + map {$_.= ".exe"} @path if IS_WINDOWS; foreach my $path ( @path ) { - if($::is_win32) + if(IS_WINDOWS) { return $path if -f $path; } |