This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
bisect-runner.pl needs to patch ext/IPC/SysV/SysV.xs for "newer" Linux.
authorNicholas Clark <nick@ccl4.org>
Mon, 3 Oct 2011 19:11:34 +0000 (21:11 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 3 Oct 2011 19:11:34 +0000 (21:11 +0200)
(dromedary is built from a sufficiently "special biologist word"
distribution that it doesn't need this)

Porting/bisect-runner.pl

index a27f44c..6d649b0 100755 (executable)
@@ -407,7 +407,7 @@ sub apply_patch {
     my $patch = shift;
 
     my ($file) = $patch =~ qr!^diff.*a/(\S+) b/\1!;
-    open my $fh, '|-', 'patch' or die "Can't run patch: $!";
+    open my $fh, '|-', 'patch', '-p1' or die "Can't run patch: $!";
     print $fh $patch;
     close $fh or die "Can't patch $file: $?, $!";
 }
@@ -717,6 +717,25 @@ if ($target ne 'miniperl') {
         }
     }
 
+    if ($major < 10
+       and -f 'ext/IPC/SysV/SysV.xs',
+       and my ($line) = extract_from_file('ext/IPC/SysV/SysV.xs',
+                                          qr!^(# *include <asm/page.h>)$!)) {
+       apply_patch(<<"EOPATCH");
+diff --git a/ext/IPC/SysV/SysV.xs b/ext/IPC/SysV/SysV.xs
+index 35a8fde..62a7965 100644
+--- a/ext/IPC/SysV/SysV.xs
++++ b/ext/IPC/SysV/SysV.xs
+\@\@ -4,7 +4,6 \@\@
+ #include <sys/types.h>
+ #ifdef __linux__
+-$line
+ #endif
+ #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
+ #ifndef HAS_SEM
+EOPATCH
+    }
     system "make $j $target";
 }