X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/471c09e4d21be85bda2b456a95947fcdf2f64d3d..59d64e0ba3e9b104bed3cb7c99e23066676be9d5:/verify-patches diff --git a/verify-patches b/verify-patches index 59f4ff5..807c584 100755 --- a/verify-patches +++ b/verify-patches @@ -3,8 +3,6 @@ use strict; use Getopt::Long; -$" = '|'; # NOTE: we auto-join arrays using '|' instead of space! - my @generated_files = qw( proto.h configure config.h.in rsync.1 rsyncd.conf.5 ); my($no_cvs, $failures_only, $minor_updates, $prepare_source); @@ -19,8 +17,10 @@ GetOptions( 'auto-cmd|a=s' => sub { push(@auto_cmds, $_[1]) }, ) or &usage; +$" = '|'; my $auto_regex = @auto_cmds ? qr/^(@auto_cmds)$/i : qr/^never$/; my $interesting_fuzz = $minor_updates ? '\d' : '[2-9]'; +$" = ' '; chdir('patches') if -d 'patches'; @@ -31,6 +31,7 @@ from inside the patches subdir. EOT } +$ENV{'LC_COLLATE'} = 'C'; $| = 1; my $CONF_OPTS = '-C'; @@ -85,7 +86,7 @@ foreach my $diff (@ARGV) { } if (!defined($conf_opts) && s#^\s+\./configure\s+##) { chomp($conf_opts = $_); - $conf_opts =~ s/\s+\(.*?\)//; + $conf_opts =~ s/\s*\(.*?\)//; } } close IN; @@ -120,7 +121,9 @@ foreach my $diff (@ARGV) { chomp $input; if ($input =~ s/^(-a|--auto-cmd=?)\s*//) { push(@auto_cmds, $input eq '' ? $default : $input); + $" = '|'; $auto_regex = qr/^(@auto_cmds)$/i; + $" = ' '; next; } $ans = $input if $input ne ''; @@ -196,7 +199,7 @@ sub apply_patch system "rsync -a --delete --exclude='*~' cvsdir/ workdir/"; print "\nApplying patch $diff...\n"; undef @rejects; - my($saw_failure, $saw_offset, $saw_fuzz); + my($saw_offset, $saw_fuzz); open(IN, "patch -d workdir -p1 --no-backup-if-mismatch <../$diff |") or die $!; while () { print $_; @@ -205,15 +208,13 @@ sub apply_patch push(@new, $_) unless -f "cvsdir/$_"; } elsif (s/.* saving rejects to file //) { push(@rejects, $_); - } elsif (/^Hunk #\d+ FAILED/) { - $saw_failure = 1; } elsif (/^Hunk #\d+ succeeded at \d+( with fuzz $interesting_fuzz)?/o) { $saw_fuzz ||= defined $1; $saw_offset = 1; } } close IN; - return 'F,D,E' if $saw_failure; + return 'F,D,E' if @rejects; return 'D,E' if $saw_fuzz && !$failures_only; return 'D,U,N' if $saw_offset && !$failures_only; 'N';