Commit a4571e29 authored by msvensson@neptunus.(none)'s avatar msvensson@neptunus.(none)

Merge neptunus.(none):/home/msvensson/mysql/work/my41-work

into  neptunus.(none):/home/msvensson/mysql/work/my50-work
parents 0e58c1ab e5ff9ebc
...@@ -2003,20 +2003,25 @@ sub remove_stale_vardir () { ...@@ -2003,20 +2003,25 @@ sub remove_stale_vardir () {
if ( -l $opt_vardir) if ( -l $opt_vardir)
{ {
# var is a symlink # var is a symlink
if ( readlink($opt_vardir) eq $opt_mem )
if ( $opt_mem and readlink($opt_vardir) eq $opt_mem )
{ {
# Remove the directory which the link points at # Remove the directory which the link points at
mtr_verbose("Removing " . readlink($opt_vardir)); mtr_verbose("Removing " . readlink($opt_vardir));
rmtree(readlink($opt_vardir)); rmtree(readlink($opt_vardir));
# Remove the entire "var" dir
mtr_verbose("Removing $opt_vardir/");
rmtree("$opt_vardir/");
# Remove the "var" symlink # Remove the "var" symlink
mtr_verbose("unlink($opt_vardir)"); mtr_verbose("unlink($opt_vardir)");
unlink($opt_vardir); unlink($opt_vardir);
} }
elsif ( $opt_mem )
{
# Just remove the "var" symlink
mtr_report("WARNING: Removing '$opt_vardir' symlink it's wrong");
mtr_verbose("unlink($opt_vardir)");
unlink($opt_vardir);
}
else else
{ {
# Some users creates a soft link in mysql-test/var to another area # Some users creates a soft link in mysql-test/var to another area
...@@ -2024,6 +2029,10 @@ sub remove_stale_vardir () { ...@@ -2024,6 +2029,10 @@ sub remove_stale_vardir () {
mtr_report("WARNING: Using the 'mysql-test/var' symlink"); mtr_report("WARNING: Using the 'mysql-test/var' symlink");
# Make sure the directory where it points exist
mtr_error("The destination for symlink $opt_vardir does not exist")
if ! -d readlink($opt_vardir);
my $dir= shift; my $dir= shift;
foreach my $bin ( glob("$opt_vardir/*") ) foreach my $bin ( glob("$opt_vardir/*") )
{ {
......
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