- Ignore 1-line of fuzz unless --minor-updates was specified.
authorWayne Davison <wayned@samba.org>
Sat, 12 Feb 2005 20:01:28 +0000 (20:01 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 12 Feb 2005 20:01:28 +0000 (20:01 +0000)
- Added --failures-only (-f) option.

verify-patches

index 8d2e8bd463b700af89eace64a2cc5b8b6af7a271..799548b9a747885369fea2d513bba84d5dfeb0c6 100755 (executable)
@@ -3,14 +3,17 @@
 use strict;
 use Getopt::Long;
 
-my($no_cvs, $minor_updates);
+my($no_cvs, $failures_only, $minor_updates);
 
 &Getopt::Long::Configure('bundling');
 GetOptions(
     'no-cvs|n' => \$no_cvs,
+    'failures-only|f' => \$failures_only,
     'minor-updates|u' => \$minor_updates,
 ) or &usage;
 
+my $interesting_fuzz = $minor_updates ? '\d' : '[2-9]';
+
 chdir('patches') if -d 'patches';
 
 if (!-f 'verify-patches') {
@@ -207,15 +210,15 @@ sub apply_patch
            push(@rejects, $_);
        } elsif (/^Hunk #\d+ FAILED/) {
            $saw_failure = 1;
-       } elsif (/^Hunk #\d+ succeeded at \d+( with fuzz )?/) {
+       } 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 'D,E' if $saw_fuzz;
-    return 'D,U,N' if $saw_offset;
+    return 'D,E' if $saw_fuzz && !$failures_only;
+    return 'D,U,N' if $saw_offset && !$failures_only;
     'N';
 }