<<

NAME

Lintian::Profile - Profile parser for Lintian

SYNOPSIS

 # Load the debian profile (if available)
 my $profile = Lintian::Profile->new ('debian');
 # Load the debian profile using an explicit search path
 $profile = Lintian::Profile->new ('debian',
    ['/path/to/alt/root', $ENV{'LINTIAN_ROOT'}]);
 # Load the "default" profile for the current vendor
 $profile = Lintian::Profile->new;
 foreach my $tag ($profile->tags) {
     print "Enabled tag: $tag\n";
 }
 # ...

DESCRIPTION

Lintian::Profile handles finding, parsing and implementation of Lintian Profiles as well as loading the relevant Lintian checks.

INSTANCE METHODS

$prof->aliases()

Returns a hash with old names that have new names.

$prof->profile_list

Returns a list ref of the (normalized) names of the profile and its parents. The last element of the list is the name of the profile itself, the second last is its parent and so on.

Note: This list reference and its contents should not be modified.

show_experimental(BOOL)

If BOOL is true, configure experimental tags to be shown. If BOOL is false, configure experimental tags to not be shown.

$prof->name

Returns the name of the profile, which may differ from the name used to create this instance of the profile (e.g. due to symlinks).

load ([$profname[, $ipath[, $extra]]])

Loads a new profile. $profname is the name of the profile and $ipath is a list reference containing the path to one (or more) Lintian "roots".

If $profname is undef, the default vendor will be loaded based on Dpkg::Vendor::get_current_vendor.

If $ipath is not given, a default one will be used.

$prof->tags([$known])

Returns the list of tags in this profile. If $known is given and it is a truth value, the list of known tags is returned. Otherwise only the enabled tags will be returned.

Note: The contents of this list should not be modified.

$prof->scripts ([$known])

Returns the list of Check-Scripts in this profile. If $known is given and it is a truth value, the list of known Check-Scripts is returned. Otherwise only checks with an enabled tag will be enabled.

$prof->is_overridable ($tag)

Returns a false value if the tag has been marked as "non-overridable". Otherwise it returns a truth value.

$prof->get_tag ($tag[, $known])

Returns the Lintian::Tag::Info for $tag if it is enabled for the profile (or just a "known tag" if $known is given and a truth value). Otherwise it returns undef.

$prof->get_script ($script[, $known])

Returns the Lintian::CheckScript for $script if it is enabled for the profile (or just a "known script" if $known is given and a truth value). Otherwise it returns undef.

Note: A script is enabled as long as at least one of the tags it provides are enabled.

$prof->enable_tags (@tags)

Enables all tags named in @tags. Croaks if an unknown tag is found.

$prof->disable_tags (@tags)

Disable all tags named in @tags. Croaks if an unknown tag is found.

$prof->include_path ([$path])

Returns an array of paths to the (partial) Lintian roots, which are used by this profile. The paths are ordered from "highest" to "lowest" priority (i.e. items in the earlier paths should shadow those in later ones).

If $path is given, the array will contain the paths to the path in these roots denoted by $path.

Paths returned are not guaranteed to exists.

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 object to display tags from any source. Tag sources are the names of references from the Ref metadata for the tags.

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.

suppressed(TAG)

Returns true if the given tag would be suppressed given the current configuration, false otherwise. This is different than displayed() 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 profile().

display(OPERATION, RELATION, SEVERITY, CERTAINTY)

Configure which tags are displayed by severity and certainty. OPERATION is + to display the indicated tags, - to not display the indicated tags, or = to not display any tags except the indicated ones. RELATION is one of <, <=, =, >=, or >. The OPERATION will be applied to all pairs of severity and certainty that match the given RELATION on the SEVERITY and CERTAINTY arguments. If either of those arguments are undefined, the action applies to any value for that variable. For example:

    $tags->display('=', '>=', 'important');

turns off display of all tags and then enables display of any tag (with any certainty) of severity important or higher.

    $tags->display('+', '>', 'normal', 'possible');

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).

    $tags->display('-', '=', 'minor', 'possible');

turns off display of tags of severity minor and certainty possible.

This method throws an exception on errors, such as an unknown severity or certainty or an impossible constraint (like > serious).

AUTHOR

Originally written by Niels Thykier <niels@thykier.net> for Lintian.

SEE ALSO

lintian(1)

<<