Lintian::CheckScript (3) - Linux Manuals

Lintian::CheckScript: Check script meta data


Lintian::CheckScript - Check script meta data


 use Lintian::CheckScript;
 my $cs = Lintian::CheckScript->new ("$ENV{'LINTIAN_ROOT'}/checks/",
 my $name = $cs->name;
 foreach my $tag ($cs->tags) {
    # $ti is an instance of Lintian::Tag::Info
    my $ti = $cs->get_tag ($tag);
    print "$tag is a part of the check $name\n";
    # Do something with $ti / $tag
 foreach my $needs ($cs->needs_info) {
    print "$name needs $needs\n";
 if ($cs->is_check_type ('binary') && $cs->is_check_type ('source')) {
    # Check applies to binary pkgs AND source pkgs


Instances of this class represents the data in the check ``.desc'' files. It allows access to the tags (as Lintian::Tag::Info) and the common meta data of the check (such as Needs-Info).


Lintian::CheckScript->new($basedir, $checkname)
Parses the $file as a check desc file.
Returns the ``name'' of the check script. This is the value in the Check-Script field in the file.
Returns the value stored in the ``Type'' field of the file. For the purpose of testing if the check applies to a given package type, the ``is_check_type'' method can be used instead.

Note in rare cases this may return undef. This is the case for the lintian.desc, where this field is simply not present.

Returns the value of the Abbrev field from the desc file.
Returns the (expected) path to the script implementing this check.
Returns a list of all items listed in the Needs-Info field. Neither the list nor its contents should be modified.
$cs->is_check_type ($type)
Returns a truth value if this check can be applied to a $type package.

Note if $cs->type return undef, this will return a truth value for all inputs.

$cs->get_tag ($tagname)
Return the tag or undef (if the tag is not in this check).
Returns the list of tag names in the check. The list nor its contents should be modified.
Attempts to load the check. On failure, the load error will be propagated to the caller. On success it returns normally.
$cs->run_check ($proc, $group)
Run the check on $proc, which is in the group $group. $proc should be a lab entry and must have the proper collections run on it prior to calling this method (See Lintian::Unpacker).

The method may error out if loading the check failed or if the check itself calls die/croak/fail/etc.

Returns normally on success; the return value has no semantic meaning and is currently "undef".

NB: load_check can be used to determine if the check itself is loadable.


Originally written by Niels Thykier <niels [at]> for Lintian.