---
name: "Lintian::CheckScript"
section: "3"
platform: "linux"
package: "lintian"
version: "2.15.0"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/Lintian::CheckScript"
---

# Lintian::CheckScript(3)

Check script meta data

## NAME

Lintian::CheckScript - Check script meta data

## SYNOPSIS

```
 use Lintian::CheckScript;

 my $cs = Lintian::CheckScript->new ("$ENV{'LINTIAN_ROOT'}/checks/",
                                     'files');
 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
 }
```

## DESCRIPTION

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

## CLASS METHODS

- Lintian::CheckScript-\>new($basedir, $checkname)

  Parses the `$file` as a check desc file.

- $cs-\>name

  Returns the "name" of the check script.  This is the value in the Check-Script field in the file.

- $cs-\>type

  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.

- $cs-\>abbrev

  Returns the value of the Abbrev field from the desc file.

- $cs-\>script\_path

  Returns the (expected) path to the script implementing this check.

- needs\_info

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

- $cs-\>tags

  Returns the list of tag names in the check.  The list nor its contents should be modified.

- $cs-\>load\_check

  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.

## AUTHOR

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

## SEE ALSO

[**lintian**(1)](/lintian/1.md), [**Lintian::Profile**(3)](/Lintian::Profile/3.md), [**Lintian::Tag::Info**(3)](/Lintian::Tag::Info/3.md)
