1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 801-implement-check-tag.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Implement --{,dont-}check-tag tag1,tag2,...
8 diff -urNad lintian-1.23.8~/frontend/lintian lintian-1.23.8/frontend/lintian
9 --- lintian-1.23.8~/frontend/lintian 2006-09-13 14:55:10.000000000 +0300
10 +++ lintian-1.23.8/frontend/lintian 2006-09-13 14:55:11.000000000 +0300
21 -c, --check check packages (default action)
22 -C X, --check-part X check only certain aspects
23 -X X, --dont-check-part X don\'t check certain aspects
24 + -T X, --check-tag X report only certain properties
25 + -Y X, --dont-check-tag X don\'t report certain properties
26 -u, --unpack only unpack packages in the lab
27 -r, --remove remove package from the lab
30 # Record action requested
31 # Options: -S, -R, -c, -u, -r
34 + if ($action && $action ne $_[0]) {
35 die("too many actions specified: $_[0]");
39 # Record Parts requested for checking
40 # Options: -C|--check-part
41 sub record_check_part {
42 - if (defined $action and $action eq 'check' and $checks) {
43 - die("multiple -C or --check-part options not allowed");
46 die("both -C or --check-part and -X or --dont-check-part options not allowed");
49 + if ($action && $action ne 'check') {
50 die("too many actions specified: $_[0]");
54 + $checks .= "$_[1],";
57 # Record Parts requested not to check
58 # Options: -X|--dont-check-part X
59 sub record_dont_check_part {
60 - if (defined $action and $action eq 'check' and $dont_check) {
61 - die("multiple -x or --dont-check-part options not allowed");
64 die("both -C or --check-part and -X or --dont-check-part options not allowed");
67 + if ($action && $action ne 'check') {
68 die("too many actions specified: $_[0]");
71 - $dont_check = "$_[1]";
72 + $dont_check .= "$_[1],";
75 +# Record tags requested for checking
76 +# Options: -T|--check-tag
77 +sub record_check_tag {
78 + if ($dont_check_tags) {
79 + die("both -T or --check-tag and -Y or --dont-check-tag options not allowed");
81 + if ($action && $action ne 'check') {
82 + die("too many actions specified: $_[0]");
85 + $check_tags .= "$_[1],";
88 +# Record Parts requested not to check
89 +# Options: -Y|--dont-check-tag X
90 +sub record_dont_check_tag {
92 + die("both -T or --check-tag and -Y or --dont-check-tag options not allowed");
94 + if ($action && $action ne 'check') {
95 + die("too many actions specified: $_[0]");
98 + $dont_check_tags .= "$_[1],";
101 # Process for -U|--unpack-info flag
102 sub record_unpack_info {
104 "check|c" => \&record_action,
105 "check-part|C=s" => \&record_check_part,
106 "dont-check-part|X=s" => \&record_dont_check_part,
107 + "check-tag|T=s" => \&record_check_tag,
108 + "dont-check-tag|Y=s" => \&record_dont_check_tag,
109 "unpack|u" => \&record_action,
110 "remove|r" => \&record_action,
117 + my $re = pattern_list_to_re($check_tags);
118 + Tags::add_tag_override({ tag => qr/^(?!$re$).*/os, significance => -1 });
120 +elsif ($dont_check_tags) {
121 + my $re = pattern_list_to_re($dont_check_tags);
122 + Tags::add_tag_override({ tag => qr/^$re$/os, significance => -1 });
125 my @l_secs = read_dpkg_control("$LINTIAN_ROOT/checks/lintian.desc");
127 map Tags::add_tag($_), @l_secs;
128 @@ -1691,6 +1725,25 @@
129 sub by_collection_order {
130 $collection_info{$a}->{'order'} <=> $collection_info{$b}->{'order'};
133 +sub pattern_list_to_re {
137 + s@([*]+)|([?])|([[]([!^]?)([]]?(?:[[]([=:.]).*?\6[]]|[^]])*)[]])|[\\]?(.)@
138 + if ( defined $1 ) { '.*' }
139 + elsif ( defined $2 ) { '.' }
140 + elsif ( defined $3 ) {
141 + my $cl = '[' . ( $4 ? '^' : '' ) . $5 . ']';
142 + eval { qr/$cl/ } ? $cl : quotemeta $3
144 + else { quotemeta $7 }
154 diff -urNad lintian-1.23.8~/man/lintian.1 lintian-1.23.8/man/lintian.1
155 --- lintian-1.23.8~/man/lintian.1 2004-08-18 11:00:40.000000000 +0300
156 +++ lintian-1.23.8/man/lintian.1 2006-09-13 14:55:43.000000000 +0300
158 This is the default action.
161 +.BR \-u ", " \-\-unpack
162 +Unpack the specified packages up to the current unpack level.
163 +The default unpack level is 1 for this option. See the UNPACK
164 +LEVELS section below.
167 +.BR \-r ", " \-\-remove
168 +Clean up the lintian directory of the specified packages up to
169 +the current unpack level. The default unpack level is 0 for
173 +Check options (these options imply \fB\-\-check\fP):
176 .BR \-C " chk1,chk2,..., " \-\-check\-part " chk1,chk2,..."
177 Run only the specified checks. You can either specify the
178 name of the check script or the abbreviation.
180 For details, see the CHECKS section below.
183 -.BR \-u ", " \-\-unpack
184 -Unpack the specified packages up to the current unpack level.
185 -The default unpack level is 1 for this option. See the UNPACK
186 -LEVELS section below.
187 +.BR \-T " tag1,tag2,..., " \-\-check\-tag " tag1,tag2,..."
188 +Report only the specified check tags.
189 +You can either specify the tag name or give a glob pattern.
192 -.BR \-r ", " \-\-remove
193 -Clean up the lintian directory of the specified packages up to
194 -the current unpack level. The default unpack level is 0 for
196 +.BR \-Y " tag1,tag2,..., " \-\-dont\-check\-part " tag1,tag2,..."
197 +Report all but the specified check tags.
198 +You can either specify the tag name or give a glob pattern.