Added some code to peer into a data structure in Maemian/Schedule.pm. Also added the
[maemian] / nokia-lintian / lib / Tags / ColonSeparated.pm
1 # Tags::ColonSeparated -- Perl tags functions for lintian
2 # $Id: Tags.pm 489 2005-09-17 00:06:30Z djpig $
3
4 # Copyright (C) 2005 Frank Lichtenheld <frank@lichtenheld.de>
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, you can find it on the World Wide
18 # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
19 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20 # MA 02110-1301, USA.
21
22 package Tags::ColonSeparated;
23 use strict;
24 use warnings;
25
26 sub quote_char {
27     my ( $char, @items ) = @_;
28
29     foreach (@items) {
30         s/\\/\\\\/go;
31         s/\Q$char\E/\\$char/go;
32     }
33
34     return @items;
35 }
36
37 sub print_tag {
38     my ( $pkg_info, $tag_info, $information ) = @_;
39
40     my $extra = "@$information";
41
42     print join(':', quote_char( ':',
43                                 $tag_info->{severity},
44                                 $tag_info->{significance},
45                                 @{$tag_info->{overridden}}{'override',
46                                                            'severity',
47                                                            'significance'},
48                                 @{$pkg_info}{'pkg','version','arch','type'},
49                                 $tag_info->{tag},
50                                 $extra,
51                                 ))."\n";
52 }
53
54 1;
55