X-Git-Url: http://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=bin%2Fcheckspecpatch;h=e883f6c32268386975ad68953706d06c76bc90ed;hp=7f89ae9269a8063b2bb3dc052922cac9f3baeb00;hb=f15d3d19ea40312737e009b52e7359f57c123f8f;hpb=1ecb5c8be9ca35d953cd0ad09a1c2e6bc792a626 diff --git a/bin/checkspecpatch b/bin/checkspecpatch index 7f89ae9..e883f6c 100755 --- a/bin/checkspecpatch +++ b/bin/checkspecpatch @@ -19,22 +19,29 @@ 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)||""; - next if $source eq $apply; - if ($source ne "" && $apply < $source) { - unshift @source,$source; + my $source=$source[0]; + $source=999999 if !defined $source; + my $apply =$apply[0]; + $apply=999999 if !defined $apply; + if ($source eq $apply) { + shift @apply; + shift @source; + } elsif ($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; } } }