summaryrefslogtreecommitdiff
path: root/Porting/bisect-runner.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-10-28 12:35:29 +0200
committerNicholas Clark <nick@ccl4.org>2011-10-28 12:41:14 +0200
commit91ad6f8a480914b8ed0201e68ec4a4a8034f2fa6 (patch)
tree94f4b0832c9e5b82393f5131041527cac1582fef /Porting/bisect-runner.pl
parent4e540a4e11a98886ace263d39ab6949f77267f91 (diff)
downloadperl-91ad6f8a480914b8ed0201e68ec4a4a8034f2fa6.tar.gz
In bisect-runner.pl, refactor the code to extract previous versions of files.
All code to execute variants of git show is now abstracted into subroutines.
Diffstat (limited to 'Porting/bisect-runner.pl')
-rwxr-xr-xPorting/bisect-runner.pl21
1 files changed, 12 insertions, 9 deletions
diff --git a/Porting/bisect-runner.pl b/Porting/bisect-runner.pl
index cebb320363..92e6e2dba5 100755
--- a/Porting/bisect-runner.pl
+++ b/Porting/bisect-runner.pl
@@ -471,6 +471,13 @@ sub revert_commit {
die "Can't apply revert $commit";
}
+sub checkout_file {
+ my ($file, $commit) = @_;
+ $commit ||= 'blead';
+ system "git show $commit:$file > $file </dev/null"
+ and die "Could not extract $file at revision $commit";
+}
+
sub clean {
if ($options{clean}) {
# Needed, because files that are build products in this checked out
@@ -991,7 +998,7 @@ if ($major == 7) {
# There was a bug in makedepend.SH which was fixed in version 96a8704c.
# Symptom was './makedepend: 1: Syntax error: Unterminated quoted string'
# Remove this if you're actually bisecting a problem related to makedepend.SH
-system 'git show blead:makedepend.SH > makedepend.SH </dev/null' and die;
+checkout_file('makedepend.SH');
if ($^O eq 'freebsd') {
# There are rather too many version-specific FreeBSD hints fixes to patch
@@ -1001,8 +1008,7 @@ if ($^O eq 'freebsd') {
# instead of treating previous versions' behaviour explicitly and changing
# the default to cater for the current behaviour. (As strangely, future
# versions inherit the current behaviour.)
- system 'git show blead:hints/freebsd.sh > hints/freebsd.sh </dev/null'
- and die;
+ checkout_file('hints/freebsd.sh');
} elsif ($^O eq 'darwin') {
if ($major < 8) {
my $faking_it;
@@ -1016,8 +1022,7 @@ if ($^O eq 'freebsd') {
# f556e5b971932902 - before it, hints bugs would be "fixed", after
# it they'd resurface. This way, we should give the illusion of
# monotonic bug fixing.
- system "git show f556e5b971932902:$_ >$_"
- and die "while attempting to extract $_";
+ checkout_file($_, 'f556e5b971932902');
}
if ($faking_it) {
apply_patch(<<'EOPATCH');
@@ -1177,10 +1182,8 @@ EOPATCH
}
}
} elsif ($^O eq 'openbsd') {
- if (!-f 'hints/openbsd.sh') {
- system 'git show 43051805d53a3e4c:hints/openbsd.sh > hints/openbsd.sh'
- and die;
- }
+ checkout_file('hints/openbsd.sh', '43051805d53a3e4c')
+ unless -f 'hints/openbsd.sh';
if ($major < 8) {
my $which = extract_from_file('hints/openbsd.sh',