Skip to content

Commit 38bcfd1

Browse files
nwc10demerphq
authored andcommitted
bisect-runner.pl shouldn't generate undef warnings from internal patches
The regex wasn't handling context diffs, and two of the unified diffs were generated with differing filenames and trailing timestamp text that it wasn't robust against.
1 parent 2de68b5 commit 38bcfd1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Porting/bisect-runner.pl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,9 @@ sub apply_patch {
15051505
my ($patch, $what, $files) = @_;
15061506
$what = 'patch' unless defined $what;
15071507
unless (defined $files) {
1508-
$patch =~ m!^--- [ab]/(\S+)\n\+\+\+ [ba]/\1!sm;
1508+
# Handle context diffs (*** ---) and unified diffs (+++ ---)
1509+
# and ignore trailing "garbage" after the filenames
1510+
$patch =~ m!^[-*]{3} [ab]/(\S+)[^\n]*\n[-+]{3} [ba]/\1!sm;
15091511
$files = " $1";
15101512
}
15111513
my $patch_to_use = placate_patch_prog($patch);
@@ -4411,7 +4413,7 @@ sub patch_ext {
44114413
checkout_file('ext/DynaLoader/dl_dyld.xs', 'f556e5b971932902');
44124414
apply_patch(<<'EOPATCH');
44134415
diff -u a/ext/DynaLoader/dl_dyld.xs~ a/ext/DynaLoader/dl_dyld.xs
4414-
--- a/ext/DynaLoader/dl_dyld.xs~ 2011-10-11 21:41:27.000000000 +0100
4416+
--- a/ext/DynaLoader/dl_dyld.xs 2011-10-11 21:41:27.000000000 +0100
44154417
+++ b/ext/DynaLoader/dl_dyld.xs 2011-10-11 21:42:20.000000000 +0100
44164418
@@ -41,6 +41,35 @@
44174419
#include "perl.h"
@@ -4462,7 +4464,7 @@ sub patch_ext {
44624464
if ($major < 4 && !extract_from_file('util.c', qr/^form/m)) {
44634465
apply_patch(<<'EOPATCH');
44644466
diff -u a/ext/DynaLoader/dl_dyld.xs~ a/ext/DynaLoader/dl_dyld.xs
4465-
--- a/ext/DynaLoader/dl_dyld.xs~ 2011-10-11 21:56:25.000000000 +0100
4467+
--- a/ext/DynaLoader/dl_dyld.xs 2011-10-11 21:56:25.000000000 +0100
44664468
+++ b/ext/DynaLoader/dl_dyld.xs 2011-10-11 22:00:00.000000000 +0100
44674469
@@ -60,6 +60,18 @@
44684470
# define get_av perl_get_av

0 commit comments

Comments
 (0)