.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Lintian::Tags 3" .TH Lintian::Tags 3 "2016-09-25" "Lintian v2.5.50~bpo8+1" "Debian Package Checker" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Lintian::Tags \- Manipulate and output Lintian tags .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 12 \& my $tags = Lintian::Tags\->new; \& my $proc = Lintian::Processable::Package\->new (\*(Aq/path/to/file\*(Aq); \& $tags\->file_start ($proc); \& $tags\->file_overrides (\*(Aq/path/to/an/overrides\-file\*(Aq); \& $tags\->tag (\*(Aqlintian\-tag\*(Aq, \*(Aqextra tag information\*(Aq); \& tag (\*(Aqother\-lintian\-tag\*(Aq, \*(Aqwith some extra data\*(Aq); \& tag (\*(Aqthird\-lintian\-tag\*(Aq); # with no extra). \& my %overrides = $tags\->overrides ($proc); \& my %stats = $tags\->statistics; \& if ($tags\->displayed (\*(Aqlintian\-tag\*(Aq)) { \& # do something if that tag would be displayed... \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module stores metadata about Lintian tags, stores configuration about which tags should be displayed, handles displaying tags if appropriate, and stores cumulative statistics about what tags have been seen. It also accepts override information and determines whether a tag has been overridden, keeping override statistics. Finally, it supports answering metadata questions about Lintian tags, such as what references Lintian has for that tag. .PP Each Lintian::Tags object has its own tag list, file list, and associated statistics. Separate Lintian::Tags objects can be maintained and used independently. However, as a convenience for Lintian's most typical use case and for backward compatibility, the first created Lintian::Tags object is maintained as a global default. The \fItag()\fR method can be called as a global function instead of a method, in which case it will act on that global default Lintian::Tags object. .SH "CLASS METHODS" .IX Header "CLASS METHODS" .IP "\fInew()\fR" 4 .IX Item "new()" Creates a new Lintian::Tags object, initializes all of its internal statistics and configuration to the defaults, and returns the newly created object. .IP "tag(\s-1TAG,\s0 [\s-1EXTRA, ...\s0])" 4 .IX Item "tag(TAG, [EXTRA, ...])" Issue the Lintian tag \s-1TAG,\s0 possibly suppressing it or not displaying it based on configuration. \s-1EXTRA,\s0 if present, is additional information to display with the tag. It can be given as a list of strings, in which case they're joined by a single space before display. .Sp This method can be called either as a class method (which is exported by the Lintian::Tags module) or as an instance method. If called as a class method, it uses the first-constructed Lintian::Tags object as its underlying object. .Sp This method throws an exception if it is called without \fIfile_start()\fR being called first or if an attempt is made to issue an unknown tag. .SH "INSTANCE METHODS" .IX Header "INSTANCE METHODS" .SS "Configuration" .IX Subsection "Configuration" .IP "display(\s-1OPERATION, RELATION, SEVERITY, CERTAINTY\s0)" 4 .IX Item "display(OPERATION, RELATION, SEVERITY, CERTAINTY)" Configure which tags are displayed by severity and certainty. \s-1OPERATION\s0 is \f(CW\*(C`+\*(C'\fR to display the indicated tags, \f(CW\*(C`\-\*(C'\fR to not display the indicated tags, or \f(CW\*(C`=\*(C'\fR to not display any tags except the indicated ones. \s-1RELATION\s0 is one of \f(CW\*(C`<\*(C'\fR, \f(CW\*(C`<=\*(C'\fR, \f(CW\*(C`=\*(C'\fR, \f(CW\*(C`>=\*(C'\fR, or \f(CW\*(C`>\*(C'\fR. The \&\s-1OPERATION\s0 will be applied to all pairs of severity and certainty that match the given \s-1RELATION\s0 on the \s-1SEVERITY\s0 and \s-1CERTAINTY\s0 arguments. If either of those arguments are undefined, the action applies to any value for that variable. For example: .Sp .Vb 1 \& $tags\->display(\*(Aq=\*(Aq, \*(Aq>=\*(Aq, \*(Aqimportant\*(Aq); .Ve .Sp turns off display of all tags and then enables display of any tag (with any certainty) of severity important or higher. .Sp .Vb 1 \& $tags\->display(\*(Aq+\*(Aq, \*(Aq>\*(Aq, \*(Aqnormal\*(Aq, \*(Aqpossible\*(Aq); .Ve .Sp adds to the current configuration display of all tags with a severity higher than normal and a certainty higher than possible (so important/certain and serious/certain). .Sp .Vb 1 \& $tags\->display(\*(Aq\-\*(Aq, \*(Aq=\*(Aq, \*(Aqminor\*(Aq, \*(Aqpossible\*(Aq); .Ve .Sp turns off display of tags of severity minor and certainty possible. .Sp This method throws an exception on errors, such as an unknown severity or certainty or an impossible constraint (like \f(CW\*(C`> serious\*(C'\fR). .IP "show_experimental(\s-1BOOL\s0)" 4 .IX Item "show_experimental(BOOL)" If \s-1BOOL\s0 is true, configure experimental tags to be shown. If \s-1BOOL\s0 is false, configure experimental tags to not be shown. .IP "show_overrides(\s-1BOOL\s0)" 4 .IX Item "show_overrides(BOOL)" If \s-1BOOL\s0 is true, configure overridden tags to be shown. If \s-1BOOL\s0 is false, configure overridden tags to not be shown. .IP "sources([\s-1SOURCE\s0 [, ...]])" 4 .IX Item "sources([SOURCE [, ...]])" Limits the displayed tags to only those from the listed sources. One or more sources may be given. If no sources are given, resets the Lintian::Tags object to display tags from any source. Tag sources are the names of references from the Ref metadata for the tags. .IP "profile(\s-1PROFILE\s0)" 4 .IX Item "profile(PROFILE)" Use the \s-1PROFILE \s0(Lintian::Profile) to determine which tags are suppressed, the severity of the tags and which tags are non-overridable. .SS "File Metadata" .IX Subsection "File Metadata" .IP "file_start(\s-1PROC\s0)" 4 .IX Item "file_start(PROC)" Adds a new file from a processable, initializes the data structures used for statistics and overrides, and makes it the default file for which tags will be issued. Also call \fILintian::Output::print_end_pkg()\fR to end the previous file, if any, and \fILintian::Output::print_start_pkg()\fR to start the new file. .Sp This method throws an exception if the file being added was already added earlier. .IP "file_overrides(\s-1OVERRIDE\-FILE\s0)" 4 .IX Item "file_overrides(OVERRIDE-FILE)" Read OVERRIDE-FILE and add the overrides found there which match the metadata of the current file (package and type). The overrides are added to the overrides hash in the info hash entry for the current file. .Sp \&\fIfile_start()\fR must be called before this method. This method throws an exception if there is no current file and calls \fIfail()\fR if the override file cannot be opened. .IP "load_overrides" 4 .IX Item "load_overrides" Loads overrides for the current file. This is basically a short-hand for finding the overrides file in the lab and calling files_overrides on it if it is present. .IP "\fIfile_end()\fR" 4 .IX Item "file_end()" Ends processing of a file. .Sp This does two things. First it emits \*(L"unused-override\*(R" tags for all unused overrides. Secondly, it calls Lintian::Output::print_end_pkg to mark the end of the package. .Sp Note that this method is called by file_start if it detects another entry is already active. .SS "Statistics" .IX Subsection "Statistics" .IP "overrides(\s-1PROC\s0)" 4 .IX Item "overrides(PROC)" Returns a reference to the overrides hash for the given processable. The keys of this hash are the tags for which are overrides. The value for each key is another hash, whose keys are the extra data matched by that override and whose values are the counts of tags that matched that override. Overrides matching any tag by that name are stored with the empty string as metadata, so: .Sp .Vb 2 \& my $overrides = $tags\->overrides(\*(Aq/some/file\*(Aq); \& print "$overrides\->{\*(Aqsome\-tag\*(Aq}{\*(Aq\*(Aq}\en"; .Ve .Sp will print out the number of tags that matched a general override for the tag some-tag, regardless of what extra data was associated with it. .IP "statistics([\s-1PROC\s0])" 4 .IX Item "statistics([PROC])" Returns a reference to the statistics hash for the given processable or, if \s-1PROC\s0 is omitted, a reference to the full statistics hash for all files. In the latter case, the returned hash reference has as keys the file names and as values the per-file statistics. .Sp The per-file statistics has a set of hashes of keys to times seen in tags: tag names (the \f(CW\*(C`tags\*(C'\fR key), severities (the \f(CW\*(C`severity\*(C'\fR key), certainties (the \f(CW\*(C`certainty\*(C'\fR key), and tag codes (the \f(CW\*(C`types\*(C'\fR key). It also has an \&\f(CW\*(C`overrides\*(C'\fR key which has as its value another hash with those same four keys, which keeps statistics on overridden tags (not included in the regular counts). .SS "Tag Reporting" .IX Subsection "Tag Reporting" .IP "displayed(\s-1TAG\s0)" 4 .IX Item "displayed(TAG)" Returns true if the given tag would be displayed given the current configuration, false otherwise. This does not check overrides, only whether the tag severity, certainty, and source warrants display given the configuration. .IP "suppressed(\s-1TAG\s0)" 4 .IX Item "suppressed(TAG)" Returns true if the given tag would be suppressed given the current configuration, false otherwise. This is different than \fIdisplayed()\fR in that a tag is only suppressed if Lintian treats the tag as if it's never been seen, doesn't update statistics, and doesn't change its exit status. Tags are suppressed via \fIprofile()\fR. .IP "\fIignored_overrides()\fR" 4 .IX Item "ignored_overrides()" Returns a hash of tags, for which overrides have been ignored. The keys are tag names and the value is the number of overrides that has been ignored. .SH "AUTHOR" .IX Header "AUTHOR" Originally written by Russ Allbery for Lintian. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIlintian\fR\|(1), \fILintian::Output\fR\|(3), \fILintian::Tag::Info\fR\|(3)