MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:November 17 2009 11:15am
Subject:bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2856) Bug#48806
View as plain text  
#At file:///home/bm136801/my/helpsrc-51/ based on revid:bjorn.munch@stripped

 2856 Bjorn Munch	2009-11-17
      Bug #48806 mysql-test-run.pl --help should work even in the absence of binaries
      Searches for my_safe_process binary too early
      Put this into a sub() and call it after examining options (incl. --help)

    modified:
      mysql-test/lib/My/SafeProcess.pm
      mysql-test/mysql-test-run.pl
=== modified file 'mysql-test/lib/My/SafeProcess.pm'
--- a/mysql-test/lib/My/SafeProcess.pm	2009-11-04 12:42:22 +0000
+++ b/mysql-test/lib/My/SafeProcess.pm	2009-11-17 11:13:22 +0000
@@ -81,24 +81,28 @@ sub is_child {
 }
 
 
-# Find the safe process binary or script
 my @safe_process_cmd;
 my $safe_kill;
-if (IS_WIN32PERL or IS_CYGWIN){
-  # Use my_safe_process.exe
-  my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"],
-		       "my_safe_process");
-  push(@safe_process_cmd, $exe);
-
-  # Use my_safe_kill.exe
-  $safe_kill= my_find_bin(".", "lib/My/SafeProcess", "my_safe_kill");
-}
-else
-{
-  # Use my_safe_process
-  my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"],
-		       "my_safe_process");
-  push(@safe_process_cmd, $exe);
+
+# Find the safe process binary or script
+sub find_bin {
+  if (IS_WIN32PERL or IS_CYGWIN)
+  {
+    # Use my_safe_process.exe
+    my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"],
+			 "my_safe_process");
+    push(@safe_process_cmd, $exe);
+
+    # Use my_safe_kill.exe
+    $safe_kill= my_find_bin(".", "lib/My/SafeProcess", "my_safe_kill");
+  }
+  else
+  {
+    # Use my_safe_process
+    my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"],
+			 "my_safe_process");
+    push(@safe_process_cmd, $exe);
+  }
 }
 
 

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2009-11-16 10:18:16 +0000
+++ b/mysql-test/mysql-test-run.pl	2009-11-17 11:13:22 +0000
@@ -266,6 +266,9 @@ sub main {
 
   command_line_setup();
 
+  # --help will not reach here, so now it's safe to assume we have binaries
+  My::SafeProcess::find_bin();
+
   if ( $opt_gcov ) {
     gcov_prepare($basedir);
   }


Attachment: [text/bzr-bundle] bzr/bjorn.munch@sun.com-20091117111322-0x19ne4hglt9th8f.bundle
Thread
bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2856) Bug#48806Bjorn Munch17 Nov