bisect-runner.pl needs to probe DB_File.xs before running Configure
authorNicholas Clark <nick@ccl4.org>
Wed, 4 Jul 2012 12:52:19 +0000 (13:52 +0100)
committerNicholas Clark <nick@ccl4.org>
Tue, 28 May 2013 07:19:29 +0000 (09:19 +0200)
Commit f2f0a0ff7250e0ba (in Nov 2011), consolidated all the code that
patches extensions. As a side effect, it moved all extension patching
after Configure is run. Unfortunately this introduced a bug, because one
test of DB_File.xs was to change the arguments to Configure to skip building
DB_File at all if it's too old. Return this logic to before when Configure
is run, so that bisect-runner.pl can once again build 5.005 and earlier on
machines with the Berkley DB headers installed, by forcibly skipping the
build of DB_File there.

Porting/bisect-runner.pl

index 9627826..a22798a 100755 (executable)
@@ -1033,6 +1033,21 @@ my $major
                        qr/^#define\s+(?:PERL_VERSION|PATCHLEVEL)\s+(\d+)\s/,
                        0);
 
+my $unfixable_db_file;
+
+if ($major < 10
+    && !extract_from_file('ext/DB_File/DB_File.xs',
+                          qr!^#else /\* Berkeley DB Version > 2 \*/$!)) {
+    # This DB_File.xs is really too old to patch up.
+    # Skip DB_File, unless we're invoked with an explicit -Unoextensions
+    if (!exists $defines{noextensions}) {
+        $defines{noextensions} = 'DB_File';
+    } elsif (defined $defines{noextensions}) {
+        $defines{noextensions} .= ' DB_File';
+    }
+    ++$unfixable_db_file;
+}
+
 patch_Configure();
 patch_hints();
 if ($options{'all-fixups'}) {
@@ -3161,15 +3176,8 @@ EOPATCH
     }
 
     if ($major < 10) {
-        if (!extract_from_file('ext/DB_File/DB_File.xs',
-                               qr!^#else /\* Berkeley DB Version > 2 \*/$!)) {
-            # This DB_File.xs is really too old to patch up.
-            # Skip DB_File, unless we're invoked with an explicit -Unoextensions
-            if (!exists $defines{noextensions}) {
-                $defines{noextensions} = 'DB_File';
-            } elsif (defined $defines{noextensions}) {
-                $defines{noextensions} .= ' DB_File';
-            }
+        if ($unfixable_db_file) {
+            # Nothing we can do.
         } elsif (!extract_from_file('ext/DB_File/DB_File.xs',
                                     qr/^#ifdef AT_LEAST_DB_4_1$/)) {
             # This line is changed by commit 3245f0580c13b3ab