bisect-runner.pl should patch $trnl into makedepend.SH if needed.
authorNicholas Clark <nick@ccl4.org>
Fri, 14 Oct 2011 11:21:28 +0000 (12:21 +0100)
committerNicholas Clark <nick@ccl4.org>
Fri, 14 Oct 2011 11:21:28 +0000 (12:21 +0100)
4b081584932d92f8 provided Configure with a value for trnl, to enable blead's
makedepend.SH to work on Perls prior to 5.003. However, af7c500f1fae390f
effectively broke this, by migrating the expansion of makedepend.SH from
Configure time to later, because "unknown" values passed to Configure on the
command line are never written to config.sh. Hence bisect-runner.pl should
patch makedepend.SH (blead's version) with the correct value for trnl, as
this is less invasive than adding to config.sh

"effectively broke", because bisect-runner.pl runs all commands with STDIN
redirected from /dev/null, so makedepend's attempts to read from STDIN in
its confusion immediately failed without anything hanging.

Porting/bisect-runner.pl

index 8aedf19..1991130 100755 (executable)
@@ -922,11 +922,6 @@ unless (extract_from_file('Configure', 'ignore_versioned_solibs')) {
     $defines{libs} = \@libs unless exists $defines{libs};
 }
 
-# This seems to be necessary to avoid makedepend becoming confused, and hanging
-# on stdin. Seems that the code after make shlist || ...here... is never run.
-$defines{trnl} = q{'\n'}
-    if $major < 4 && !exists $defines{trnl};
-
 $defines{usenm} = undef
     if $major < 2 && !exists $defines{usenm};
 
@@ -1004,6 +999,17 @@ if (-f 'config.sh') {
                       return join "\n", @lines;
                   });
     }
+    if ($major < 4 && !extract_from_file('config.sh', qr/^trnl=/)) {
+        # This seems to be necessary to avoid makedepend becoming confused,
+        # and hanging on stdin. Seems that the code after
+        # make shlist || ...here... is never run.
+        edit_file('makedepend.SH', sub {
+                      my $code = shift;
+                      $code =~ s/^trnl='\$trnl'$/trnl='\\n'/m;
+                      return $code;
+                  });
+    }
+
     system './Configure -S </dev/null' and die;
 }