DOKK / manpages / debian 10 / lintian / Lintian::Lab.3.en
Lintian::Lab(3) Debian Package Checker Lintian::Lab(3)

Lintian::Lab -- Interface to the Lintian Lab

 use Lintian::Lab;
 
 my $lab = Lintian::Lab->new;
 if (!$lab->exists) {
     $lab->create;
 }
 $lab->open;
 $lab->close;

This module provides an abstraction from "How and where" packages are placed. It handles creation and deletion of the Lintian Lab itself as well as providing access to the entries.

Creates a new Lab instance. The lab will be temporary and will point to a temporary directory.

Returns a truth value if this lab is open.

Note: If the lab is open, it also exists. However, if the lab is closed then the lab may or may not exist (see "exists").

Returns a truth value if the instance points to an existing lab.

Note: This never implies that the lab is open. Though it may imply the lab is closed (see "is_open").

Fetches an existing package from the lab.

The first argument must be a processable.

Creates a basic empty lab. Will also set up the temporary dir for the lab.

The lab will not be opened by this method. This should be done afterwards by invoking the "open" method.

OPTS (if present) is a hashref containing options. The following options are accepted:

If "keep-lab" points to a truth value the temporary directory will not be removed by closing the lab (nor exiting the application). However, explicitly calling "remove" will remove the lab.
If present, this will be used as mode for creating directories. Will default to 0777 if not specified. It is passed to mkdir and is thus subject to umask settings.

Note: This does nothing if the lab appears to already exists.

Opens the lab and reads the contents into caches. If the lab does not exist, this method will call create to initialize it.

This will croak if the lab is already open. It may also croak for the same reasons as "create".

Note: It is not possible to pass options to the creation of the lab. If special options are required, please use "create" directly.

Close the lab - the lab can no longer be used. All references to entries in the lab should be considered invalid.

Note: The lab will be deleted unless it was created with "keep-lab" (see "create").

Removes the lab and everything in it. Any reference to an entry returned from this lab will immediately become invalid.

The lab root dir will be removed as well on success.

On success, this will return a truth value. The directory path will be set to the empty string.

On error, this method will croak.

If the lab has already been removed (or does not exist), this will return a truth value.

Niels Thykier <niels@thykier.net>

Based on the work of various others.

2019-05-26 Lintian v2.15.0