summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-11-28 16:25:41 +0100
committerunknown <msvensson@neptunus.(none)>2006-11-28 16:25:41 +0100
commit530b583038fc42bdf1a66c6692930a32c9605d12 (patch)
treec4cb1b7f2385523e1b42eb74419b99143e8e2094
parentdf75d387ef982a1b24f957fc2f7fb55ce9d9253e (diff)
parent039f806afeb3d779695542787965bd720d3d6e49 (diff)
downloadmariadb-git-530b583038fc42bdf1a66c6692930a32c9605d12.tar.gz
Merge neptunus.(none):/home/msvensson/mysql/work/my41-work
into neptunus.(none):/home/msvensson/mysql/work/my50-work mysql-test/mysql-test-run.pl: Auto merged
-rwxr-xr-xmysql-test/mysql-test-run.pl19
1 files changed, 14 insertions, 5 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 88f662addc4..935776477f5 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -2003,20 +2003,25 @@ sub remove_stale_vardir () {
if ( -l $opt_vardir)
{
# 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
mtr_verbose("Removing " . readlink($opt_vardir));
rmtree(readlink($opt_vardir));
- # Remove the entire "var" dir
- mtr_verbose("Removing $opt_vardir/");
- rmtree("$opt_vardir/");
-
# Remove the "var" symlink
mtr_verbose("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
{
# Some users creates a soft link in mysql-test/var to another area
@@ -2024,6 +2029,10 @@ sub remove_stale_vardir () {
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;
foreach my $bin ( glob("$opt_vardir/*") )
{