In bisect-runner.pl, clarify the variables relating to the make target.
authorNicholas Clark <nick@ccl4.org>
Fri, 16 Dec 2011 17:50:56 +0000 (18:50 +0100)
committerNicholas Clark <nick@ccl4.org>
Sat, 17 Dec 2011 08:18:44 +0000 (09:18 +0100)
The 4 things in play are
* the (standard) target name used on the command line
* the actual target we ask make to build
* the file we expect it to generate as a result
* whether that file was generated correctly

The previous variable names were not that clear about this.

Porting/bisect-runner.pl

index 6a0a11b..9ec566c 100755 (executable)
@@ -944,10 +944,12 @@ patch_ext();
 # Parallel build for miniperl is safe
 system "$options{make} $j miniperl </dev/null";
 
-my $expected = $target =~ /^test/ ? 't/perl'
+# This is the file we expect make to create
+my $expected_file = $target =~ /^test/ ? 't/perl'
     : $target eq 'Fcntl' ? "lib/auto/Fcntl/Fcntl.$Config{so}"
     : $target;
-my $real_target = $target eq 'Fcntl' ? $expected : $target;
+# This is the target we tell make to build in order to get $expected_file
+my $real_target = $target eq 'Fcntl' ? $expected_file : $target;
 
 if ($target ne 'miniperl') {
     # Nearly all parallel build issues fixed by 5.10.0. Untrustworthy before that.
@@ -967,12 +969,13 @@ if ($target ne 'miniperl') {
     system "$options{make} $j $real_target </dev/null";
 }
 
-my $missing_target = $expected =~ /perl$/ ? !-x $expected : !-r $expected;
+my $expected_file_found = $expected_file =~ /perl$/
+    ? -x $expected_file : -r $expected_file;
 
 if ($options{'test-build'}) {
-    report_and_exit($missing_target, 'could build', 'could not build',
+    report_and_exit(!$expected_file_found, 'could build', 'could not build',
                     $real_target);
-} elsif ($missing_target) {
+} elsif (!$expected_file_found) {
     skip("could not build $real_target");
 }