Lintian::Collect::Binary(3) | Debian Package Checker | Lintian::Collect::Binary(3) |
Lintian::Collect::Binary - Lintian interface to binary package data collection
my ($name, $type, $dir) = ('foobar', 'binary', '/path/to/lab-entry'); my $collect = Lintian::Collect->new ($name, $type, $dir); if ($collect->native) { print "Package is native\n"; }
Lintian::Collect::Binary provides an interface to package data for binary packages. It implements data collection methods specific to binary packages.
This module is in its infancy. Most of Lintian still reads all data from files in the laboratory whenever that data is needed and generates that data via collect scripts. The goal is to eventually access all data about binary packages via this module so that the module can cache data where appropriate and possibly retire collect scripts in favor of caching that data in memory.
In addition to the instance methods listed below, all instance methods documented in the Lintian::Collect and the Lintian::Collect::Package modules are also available.
If the version number is absent, this will return false (as native packages are a lot rarer than non-native ones).
Needs-Info requirements for using native: Same as field
Needs-Info requirements for using changelog: changelog-file
Returns the path to FILE in the control.tar.gz. FILE must be either a Lintian::Path object (>= 2.5.13~) or a string denoting the requested path. In the latter case, the path must be relative to the root of the control.tar.gz member and should be normalized.
It is not permitted for FILE to be "undef". If the "root" dir is desired either invoke this method without any arguments at all, pass it the correct Lintian::Path or the empty string.
To get a list of entries in the control.tar.gz or the file meta data of the entries (as path objects), see "sorted_control_index" and "control_index (FILE)".
The caveats of unpacked also apply to this method. However, as the control.tar.gz is not known to contain symlinks, a simple file type check is usually enough.
Needs-Info requirements for using control: bin-pkg-control
To get a list of entries in the control.tar.gz, see "sorted_control_index". To actually access the underlying file (e.g. the contents), use "control ([FILE])".
Note that the "root directory" (denoted by the empty string) will always be present, even if the underlying tarball omits it.
Needs-Info requirements for using control_index: bin-pkg-control
The array will not contain the entry for the "root" of the control.tar.gz.
Needs-Info requirements for using sorted_control_index: Same as control_index
The resolution is done using resolve_path.
Needs-Info requirements for using control_index_resolved_path: Same as control_index
Caller is responsible for closing the handle either way.
Needs-Info requirements for using strings: strings
The value for a given FILE consists of a table with the following keys (and associated value):
NB: Some template files have "#!" lines like "#!@PERL@" or "#!perl". In this case, this value will be @PERL@ or perl (respectively).
Needs-Info requirements for using scripts: scripts
Needs-Info requirements for using objdump_info: objdump-info
NB: This is generally only useful for checks/binaries to emit the hardening-no-* tags.
Needs-Info requirements for using hardening_info: hardening-info
if (exists $info->java_info->{$file}{'manifest'}) { my $cp = $info->java_info->{$file}{'manifest'}{'Class-Path'}; # ... }
NB: Not all jar files have a manifest. For those without, this will value will not be available. Use exists (rather than defined) to check for it.
Needs-Info requirements for using java_info: java-info
If FIELD isn't present in the package, the returned Lintian::Relation object will be empty (always satisfied and implies nothing).
Needs-Info requirements for using relation: Same as field
Guessed from package description.
A transitional package will also match this.
Guessed from package description, section or package name.
Guessed from the package name.
Guessed from the "Auto-Built-Package" field.
Needs-Info requirements for using is_pkg_class: Same as field
Note that FILE should be the filename relative to the package root (even though the control file uses absolute paths). If the control file does relative paths, they are assumed to be relative to the package root as well (and used without warning).
Needs-Info requirements for using is_conffile: Same as control_index_resolved_path
Originally written by Frank Lichtenheld <djpig@debian.org> for Lintian.
lintian(1), Lintian::Collect, Lintian::Relation
2019-05-26 | Lintian v2.15.0 |