A simple checking script
# [ c o p y r i g h t s t u f f ]
2
package L i n t i a n : : c o n t r o l _ f i l e ;
use U t i l ; use Tags ;
4
sub run {
6
my $pkg = s h i f t ;
my $type = s h i f t ;
8
# Check t h a t each f i e l d
i s o n l y used once :
my $ s e e n _ f i e l d s = { } ;
10
open (CONTROL, " d e b f i l e s / c o n t r o l " ) o r f a i l " Couldn ' t read c o n t r o l : $ ! " ;
while ( <CONTROL>) {
12
#Reset s e e n _ f i e l d s
i f we e n t e r a new s e c t i o n :
$ s e e n _ f i e l d s = { }
i f / ^ $ / ;
14
i f
( / ^ ( \ S + ) : / ) {
my $ f i e l d = l c ( $1 ) ;
16
i f ( $ s e e n _ f i e l d s
-
>{ $ f i e l d } ) {
t a g " debian
-
c o n t r o l
-
w i t h
-
d u p l i c a t e
-
f i e l d s " ,
18
" $ f i e l d : $ $ s e e n _ f i e l d s { $ f i e l d } , $ . " ;
}
20
$ s e e n _ f i e l d s
-
>{ $ f i e l d } = $ . ;
}
22
}
1 ;
Frank Lichtenheld <djpig@debian.org> (Debian)
Debian QA Meeting 2005
13 / 39