Lintian::Data - Online Linux Manual PageSection : 3
Updated : 2020-11-27
Source : Lintian v2.104.0
Note : Debian Package Checker
NAMELintian::Data − Lintian interface to query lists of keywords
SYNOPSIS my $keyword;
my $list = Lintian::Data−>new('type');
if ($list−>known($keyword)) {
# do something ...
}
my $hash = Lintian::Data−>new('another−type', qr{\s++});
if ($hash−>value($keyword) > 1) {
# do something ...
}
if ($list−>value($keyword) > 1) {
# do something ...
}
my @keywords = $list−>all;
if ($list−>matches_any($keyword)) {
# do something ...
}
DESCRIPTIONLintian::Data provides a way of loading a list of keywords or key/value pairs from a file in the Lintian root and then querying that list. The lists are stored in the data directory of the Lintian root and consist of one keyword or key/value pair per line. Blank lines and lines beginning with # are ignored. Leading and trailing whitespace is stripped. If requested, the lines are split into key/value pairs with a given separator regular expression. Otherwise, keywords are taken verbatim as they are listed in the file and may include spaces. This module allows lists such as menu sections, doc-base sections, obsolete packages, package fields, and so forth to be stored in simple, easily editable files. NB: By default Lintian::Data is lazy and defers loading of the data file until it is actually needed.
Interface for the CODE argumentThis section describes the interface between for the CODE argument for the class method new. The sub will be called once for each key/pair with three arguments, KEY, VALUE and CURVALUE. The first two are the key/value pair parsed from the data file and CURVALUE is current value associated with the key. CURVALUE will be undef the first time the sub is called with that KEY argument. The sub can then modify VALUE in some way and return the new value for that KEY. If CURVALUE is not undef, the sub may return undef to indicate that the current value should still be used. It is not permissible for the sub to return undef if CURVALUE is undef. Where Perl semantics allow it, the sub can modify CURVALUE and the changes will be reflected in the result. As an example, if CURVALUE is a hashref, new keys can be inserted etc.
CLASS METHODSnew(TYPE [,SEPARATOR[, CODE]]) Creates a new Lintian::Data object for the given TYPE. TYPE is a partial path relative to the data directory and should correspond to a file in that directory. The contents of that file will be loaded into memory and returned as part of the newly created object. On error, new() throws an exception. If SEPARATOR is given, it will be used as a regular expression for splitting the lines into key/value pairs. If CODE is also given, it is assumed to be a sub that will pre-process the key/value pairs. See the ‟Interface for the CODE argument” above. A given file will only be loaded once. If new() is called again with the same TYPE argument, the data previously loaded will be reused, avoiding multiple file reads. set_vendor(PROFILE) Specifies vendor profile. It must be set before the first data file is loaded.
INSTANCE METHODSall() Returns all keywords listed in the data file as a list in original order. In a scalar context, returns the number of keywords. matches_any(KEYWORD[, MODIFIERS]) Returns true if KEYWORD matches any regular expression listed in the data file. The optional MODIFIERS serve as modifiers on all regexes. known(KEYWORD) Returns true if KEYWORD was listed in the data file represented by this Lintian::Data instance and false otherwise. value(KEYWORD) Returns the value attached to KEYWORD if it was listed in the data file represented by this Lintian::Data instance and the undefined value otherwise. If SEPARATOR was not given, the value will '1'.
DIAGNOSTICSno data type specified new() was called without a TYPE argument. unknown data type %s The TYPE argument to new() did not correspond to a file in the data directory of the Lintian root. undefined value for %s (type: %s) The CODE argument return undef for the KEY and no previous value for that KEY was available.
FILESLINTIAN_INCLUDE_DIR/data The files loaded by this module must be located in this directory. Relative paths containing a / are permitted, so files may be organized in subdirectories in this directory. Note that lintian supports multiple LINTIAN_INCLUDE_DIRs.
AUTHOROriginally written by Russ Allbery <rra@debian.org> for Lintian.
SEE ALSOlintian (1), <https://lintian.debian.org/manual/section−2.6.html> 0
Johanes Gumabo
Data Size : 15,734 byte
man-Lintian::Data.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 200,878
Visitor ID : :
Visitor IP : 3.137.177.204 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (parse_manual_page_|249|Lintian::Data.3|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\|
) (htmlprn|149|Lintian::Data.3|36/37|.el══─{─══. ds -- — |.el══─{─══. ds -- \|\(em\|
) (parse_manual_page_|249|Lintian::Data.3|43|br══─}─══|'br══─}─══
) (htmlprn|149|Lintian::Data.3|43|'br══─}─══ |'br══─}─══
)