Fixed excessive patches reporting.
authorlace <>
Wed, 15 Nov 2006 23:57:33 +0000 (23:57 +0000)
committerlace <>
Wed, 15 Nov 2006 23:57:33 +0000 (23:57 +0000)
bin/checkspecpatch

index 7f89ae9..994d058 100755 (executable)
@@ -19,22 +19,27 @@ for $ARGV (@ARGV) {
        my @applyno=sort { $a<=>$b; } ($file=~/^#+\s*%patch(\d+)\b/mig);
        my %applyno=map(($_=>1),@applyno);
        while (@source || @apply) {
-               my $source=(shift @source)||"";
-               my $apply =(shift @apply)||"";
+               my $source=(shift @source);
+               $source=999999 if !defined $source;
+               my $apply =(shift @apply);
+               $apply=999999 if !defined $apply;
                next if $source eq $apply;
-               if ($source ne "" && $apply  < $source) {
-                       unshift @source,$source;
+               if ($apply < $source) {
+                       shift @apply;
                        warn "$ARGV: excessive: ".'%'."patch$apply\n";
                        $rc=1;
-               }       
-               if ($apply  ne "" && $source < $apply) {
-                       unshift @apply,$apply;
+               } elsif ($source < $apply) {
+                       shift @source;
                        if (!$applyno{$source}) {
                                warn "$ARGV: excessive: Patch$source\n";
                                $rc=1;
                        } else {
                                warn "$ARGV: (commented ".'%'."patch$source: Patch$source)\n";
                        }
+               } else {
+                       die if $apply ne $source;
+                       shift @apply;
+                       shift @source;
                }
        }
 }