Scroll to navigation

Lintian::Collect::Source(3) Debian Package Checker Lintian::Collect::Source(3)

NAME

Lintian::Collect::Source - Lintian interface to source package data collection

SYNOPSIS

    my ($name, $type, $dir) = ('foobar', 'source', '/path/to/lab-entry');
    my $collect = Lintian::Collect::Source->new($name);
    if ($collect->native) {
        print "Package is native\n";
    }

DESCRIPTION

Lintian::Collect::Source provides an interface to package data for source packages. It implements data collection methods specific to source 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 source 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.

INSTANCE METHODS

"saved_changelog_version"
Returns true if the source package is native and false otherwise. This is generally determined from the source format, though in the 1.0 case the nativeness is determined by looking for the diff.gz (using the name of the source package and its version).

If the source format is 1.0 and the version number is absent, this will return false (as native packages are a lot rarer than non-native ones).

Note if the source format is missing, it is assumed to be a 1.0 package.

Needs-Info requirements for using native: Same as field

Returns a fully parsed Lintian::Inspect::Changelog::Version for the source package's version string.

Needs-Info requirements for using changelog_version: Same as field

Returns true if the source package has been "repacked" and false otherwise. This is determined from the version name containing "dfsg" or similar.

Needs-Info requirements for using repacked: Same as field

Returns a list of the binary and udeb packages listed in the debian/control. Package names appear the same order in the returned list as they do in the control file.

Note: Package names that are not valid are silently ignored.

Needs-Info requirements for using binaries: Same as binary_package_type

Returns package type based on value of the Package-Type (or if absent, X-Package-Type) field. If the field is omitted, the default value "deb" is used.

If the BINARY is not a binary listed in the source packages debian/control file, this method return "undef".

Needs-Info requirements for using binary_package_type: Same as binary_field

Returns the content of the field FIELD from source package paragraph of the debian/control file, or DEFAULT (defaulting to "undef") if the field is not present. Only the literal value of the field is returned.

If FIELD is not given, return a hashref mapping field names to their values (in this case DEFAULT is ignored). This hashref should not be modified.

NB: If a field from the "dsc" file itself is desired, please use field instead.

Returns the content of the field FIELD for the binary package PACKAGE in the debian/control file, or DEFAULT (defaulting to "undef") if the field is not present. Inheritance of field values from the source section of the control file is not implemented. Only the literal value of the field is returned.

If FIELD is not given, return a hashref mapping field names to their values (in this case, DEFAULT is ignored). This hashref should not be modified.

If PACKAGE is not a binary built from this source, this returns DEFAULT.

Returns a Lintian::Relation object for the specified FIELD in the binary package PACKAGE in the debian/control file. FIELD should be one of the possible relationship fields of a Debian package or one of the following special values:
The concatenation of Pre-Depends, Depends, Recommends, and Suggests.
The concatenation of Pre-Depends and Depends.
The concatenation of Recommends and Suggests.

If FIELD isn't present in the package, the returned Lintian::Relation object will be empty (always satisfied and implies nothing).

Any substvars in debian/control will be represented in the returned relation as packages named after the substvar.

Needs-Info requirements for using binary_relation: Same as binary_field

Returns a Lintian::Relation object for the given build relationship field FIELD. In addition to the normal build relationship fields, the following special field names are supported:
The concatenation of Build-Depends, Build-Depends-Arch and Build-Depends-Indep.
The concatenation of Build-Conflicts, Build-Conflicts-Arch and Build-Conflicts-Indep.

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

The same as "relation (FIELD)", but ignores architecture restrictions and build profile restrictions in the FIELD field.

Needs-Info requirements for using relation_noarch: Same as relation

Returns a truth value if the package appears to be non-free (based on the section field; "non-free/*" and "restricted/*")

Needs-Info requirements for using is_non_free: "source_field ([FIELD[, DEFAULT]])"

AUTHOR

Originally written by Russ Allbery <rra@debian.org> for Lintian.

SEE ALSO

lintian(1), Lintian::Collect(3), Lintian::Relation(3)

2020-02-23 Lintian v2.55.0