OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-re Date: 06-Jun-2003 12:02:18
Branch: HEAD Handle: 2003060611021700
Modified files:
openpkg-re speclint.pl
Log:
detect if the same source or patch header is given multiple times
Summary:
Revision Changes Path
1.25 +11 -0 openpkg-re/speclint.pl
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-re/speclint.pl
============================================================================
$ cvs diff -u -r1.24 -r1.25 speclint.pl
--- openpkg-re/speclint.pl 14 May 2003 18:57:21 -0000 1.24
+++ openpkg-re/speclint.pl 6 Jun 2003 10:02:17 -0000 1.25
@@ -346,8 +346,12 @@
Group:^Unknown$
License:^DoePL$
));
+ my @headers_mult = (qw(
+ BuildPreReq PreReq Provides Conflicts
+ ));
my @seen = ();
+ my %count = ();
my $done = ''; my $this = ''; my $todo = $spec;
while ($todo =~ m/^(\S+):([ \t]*)(.*?)$/m) {
$done .= $`; $this = $&; $todo = $';
@@ -387,6 +391,7 @@
}
}
push(@seen, $header);
+ $count{$header}++;
$done .= $this;
}
@@ -405,6 +410,12 @@
}
}
+ # check for multiple occurrence headers
+ foreach my $seen (@seen) {
+ if ($count{$seen} > 1 and not (grep { $_ eq $seen } @headers_mult)) {
+ &lint_error($file, undef, undef, "RPM header \"$seen\" occurs multiple
times (expected just once)");
+ }
+ }
}
## _________________________________________________________________
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]