1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

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''
This commit is contained in:
unknown
2008-02-20 14:55:30 +01:00
parent 6f26028287
commit 0d01221c17
7 changed files with 162 additions and 91 deletions

View File

@@ -56,35 +56,10 @@ use My::SafeProcess::Base;
use base 'My::SafeProcess::Base';
use My::Find;
use My::Platform;
my %running;
BEGIN {
if ($^O eq "MSWin32") {
eval 'sub IS_WIN32PERL () { 1 }';
}
else {
eval 'sub IS_WIN32PERL () { 0 }';
}
if ($^O eq "cygwin") {
eval 'sub IS_CYGWIN () { 1 }';
# Make sure cygpath works
if ((system("cygpath > /dev/null 2>&1") >> 8) != 1){
die "Could not execute 'cygpath': $!";
}
eval 'sub fixpath {
my ($path)= @_;
return unless defined $path;
$path= `cygpath -w $path`;
chomp $path;
return $path;
}';
}
else {
eval 'sub IS_CYGWIN () { 0 }';
}
}
END {
# Kill any children still running
for my $proc (values %running){
@@ -163,12 +138,10 @@ sub new {
# }
if (IS_CYGWIN){
# safe_procss is a windows program and need
# windows paths
$path= fixpath($path);
$input= fixpath($input);
$output= fixpath($output);
$error= fixpath($error);
$path= native_path($path);
$input= native_path($input);
$output= native_path($output);
$error= native_path($error);
}
my @safe_args;