[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.10-168-ge078d2c



The following commit has been merged in the master branch:
commit e078d2cc26b57889fb68f1a509ba490939a91c7c
Author: Niels Thykier <niels@thykier.net>
Date:   Mon Jul 30 01:09:32 2012 +0200

    L::Collect::*: Interleave POD and Perl code
    
    Interleave the POD API documentation with code, so the POD for a given
    method appears just before the method itself.  At the same time add
    POD to methods without documentation and update or clarify existing
    POD where needed.
    
    In the strings method, consistently handle "open" failures by invoking
    fail.  Other than that "code changes" are caused by the POD moving and
    are not actual changes.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/lib/Lintian/Collect.pm b/lib/Lintian/Collect.pm
index f24ce98..d0d8d6b 100644
--- a/lib/Lintian/Collect.pm
+++ b/lib/Lintian/Collect.pm
@@ -23,9 +23,57 @@ use warnings;
 use Lintian::Util qw(get_dsc_info get_deb_info);
 use Carp qw(croak);
 
-# Take the package name and type, initialize an appropriate collect object
-# based on the package type, and return it.  fail with unknown types,
-# since we do not check in other packes if this returns a value.
+=head1 NAME
+
+Lintian::Collect - Lintian interface to package data collection
+
+=head1 SYNOPSIS
+
+    my ($name, $type, $dir) = ('foobar', 'udeb', '/some/abs/path');
+    my $collect = Lintian::Collect->new ($name, $type, $dir);
+    $name = $collect->name;
+    $type = $collect->type;
+
+=head1 DESCRIPTION
+
+Lintian::Collect provides the shared interface to package data used by
+source, binary and udeb packages and .changes files.  It creates an
+object of the appropriate type and provides common functions used by the
+collection interface to all types of package.
+
+Usually instances should not be created directly (exceptions include
+collections), but instead be requested via the
+L<info|Lintian::Lab::Entry/info> method in Lintian::Lab::Entry.
+
+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 via
+this module and its subclasses so that the module can cache data where
+appropriate and possibly retire collect scripts in favor of caching that
+data in memory.
+
+=head1 CLASS METHODS
+
+=over 4
+
+=item new (PACKAGE, TYPE, BASEDIR[, FIELDS]))
+
+Creates a new object appropriate to the package type.  TYPE can be
+retrieved later with the L</type> method.  Croaks if given an unknown
+TYPE.
+
+PACKAGE is the name of the package and is stored in the collect object.
+It can be retrieved with the L</name> method.
+
+BASEDIR is the base directory for the data and should be absolute.
+
+If FIELDS is given it is assumed to be the fields from the underlying
+control file.  This is only used to avoid an unnecessary read
+operation (possibly incl. an ar | gzip pipeline) when the fields are
+already known.
+
+=cut
+
 sub new {
     my ($class, $pkg, $type, $base_dir, $fields) = @_;
     my $object;
@@ -48,29 +96,61 @@ sub new {
     return $object;
 }
 
-# Return the package name.
+=back
+
+=head1 INSTANCE METHODS
+
+In addition to the instance methods documented here, see the documentation
+of L<Lintian::Collect::Source>, L<Lintian::Collect::Binary> and
+L<Lintian::Collect::Changes> for instance methods specific to source and
+binary / udeb packages and .changes files.
+
+=over 4
+
+=item name
+
+Returns the name of the package.
+
+=cut
+
 # sub name Needs-Info <>
 sub name {
     my ($self) = @_;
     return $self->{name};
 }
 
-# Return the package type.
+=item type
+
+Returns the type of the package.
+
+=cut
+
 # sub type Needs-Info <>
 sub type {
     my ($self) = @_;
     return $self->{type};
 }
 
-# Return the base dir of the package's lab.
+=item base_dir
+
+Returns the base_dir where all the package information is stored.
+
+=cut
+
 # sub base_dir Needs-Info <>
 sub base_dir {
     my ($self) = @_;
     return $self->{base_dir};
 }
 
-# Return the path to a file (or dir) in the lab
-# - convenience around base_dir
+=item lab_data_path ([ENTRY])
+
+Return the path to the ENTRY in the lab.  This is a convenience method
+around base_dir.  If ENTRY is not given, this method behaves like
+base_dir.
+
+=cut
+
 # sub lab_data_path Needs-Info <>
 sub lab_data_path {
     my ($self, $entry) = @_;
@@ -79,11 +159,29 @@ sub lab_data_path {
     return $base;
 }
 
-# Return the value of the specified control field of the package, or undef if
-# that field wasn't present in the control file for the package.  For source
-# packages, this is the *.dsc file; for binary packages, this is the control
-# file in the control section of the package.  For .changes files, the 
-# information will be retrieved from the file itself.
+=item field ([FIELD[, DEFAULT]])
+
+If FIELD is given, this method returns the value of the control field
+FIELD in the control file for the package.  For a source package, this
+is the *.dsc file; for a binary package, this is the control file in
+the control section of the package.
+
+If FIELD is passed but not present, then this method will return
+DEFAULT (if given) or undef.
+
+Otherwise this will return a hash of fields, where the key is the field
+name (in all lowercase).
+
+Note: For binary and udeb packages, this method will create the
+"source"-field if it does not exist (using the value of the
+"package"-field as described in §5.6.1 of the Debian Policy Manual).
+
+Some checks rely on the presence "source"-field to whitelist some
+packages, so removing this behaviour may cause regressions (see
+bug 640186 for an example).
+
+=cut
+
 # sub field Needs-Info <>
 sub field {
     my ($self, $field, $def) = @_;
@@ -126,97 +224,6 @@ sub _get_field {
     return $fields;
 }
 
-=head1 NAME
-
-Lintian::Collect - Lintian interface to package data collection
-
-=head1 SYNOPSIS
-
-    my ($name, $type, $dir) = ('foobar', 'udeb', '/some/abs/path');
-    my $collect = Lintian::Collect->new ($name, $type, $dir);
-    $name = $collect->name;
-    $type = $collect->type;
-
-=head1 DESCRIPTION
-
-Lintian::Collect provides the shared interface to package data used by
-source, binary and udeb packages and .changes files.  It creates an 
-object of the appropriate type and provides common functions used by the 
-collection interface to all types of package.
-
-Usually instances should not be created directly (exceptions include
-collections), but instead be requested via the
-L<info|Lintian::Lab::Entry/info> method in Lintian::Lab::Entry.
-
-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 via
-this module and its subclasses so that the module can cache data where
-appropriate and possibly retire collect scripts in favor of caching that
-data in memory.
-
-=head1 CLASS METHODS
-
-=over 4
-
-=item new(PACKAGE, TYPE, BASEDIR[, FIELDS])
-
-Creates a new object appropriate to the package type.  TYPE can be
-retrieved later with the type() method.  Croaks if given an unknown
-TYPE.
-
-PACKAGE is the name of the package and is stored in the collect object.
-It can be retrieved with the name() method.
-
-BASEDIR is the base directory for the data and should be absolute.
-
-If FIELDS is given it is assumed to be the fields from the underlying
-control file.  This is only used to avoid an unnecessary read
-operation (possibly incl. an ar | gzip pipeline) when the fields are
-already known.
-
-=back
-
-=head1 INSTANCE METHODS
-
-In addition to the instance methods documented here, see the documentation
-of Lintian::Collect::Source, Lintian::Collect::Binary and 
-Lintian::Collect::Changes for instance methods specific to source and 
-binary / udeb packages and .changes files.
-
-=over 4
-
-=item field([FIELD[, DEFAULT]])
-
-If FIELD is given, this method returns the value of the control field
-FIELD in the control file for the package.  For a source package, this
-is the *.dsc file; for a binary package, this is the control file in
-the control section of the package.
-
-If FIELD is passed but not present, then this method will return
-DEFAULT (if given) or undef.
-
-Otherwise this will return a hash of fields, where the key is the field
-name (in all lowercase).
-
-=item name()
-
-Returns the name of the package.
-
-=item type()
-
-Returns the type of the package.
-
-=item base_dir()
-
-Returns the base_dir where all the package information is stored.
-
-=item lab_data_path ([ENTRY])
-
-Return the path to the ENTRY in the lab.  This is a convenience method
-around base_dir.  If ENTRY is not given, this method behaves like
-base_dir.
-
 =back
 
 =head1 AUTHOR
@@ -225,8 +232,8 @@ Originally written by Russ Allbery <rra@debian.org> for Lintian.
 
 =head1 SEE ALSO
 
-lintian(1), Lintian::Collect::Binary(3), Lintian::Collect::Changes(3),
-Lintian::Collect::Source(3)
+lintian(1), L<Lintian::Collect::Binary>, L<Lintian::Collect::Changes>,
+L<Lintian::Collect::Source>
 
 =cut
 
diff --git a/lib/Lintian/Collect/Binary.pm b/lib/Lintian/Collect/Binary.pm
index 3beae81..6331d83 100644
--- a/lib/Lintian/Collect/Binary.pm
+++ b/lib/Lintian/Collect/Binary.pm
@@ -30,8 +30,43 @@ use Parse::DebianChangelog;
 
 use Lintian::Util qw(fail open_gz parse_dpkg_control);
 
-# Initialize a new binary package collect object.  Takes the package name,
-# which is currently unused.
+=head1 NAME
+
+Lintian::Collect::Binary - Lintian interface to binary package data collection
+
+=head1 SYNOPSIS
+
+    my ($name, $type) = ('foobar', 'binary');
+    my $collect = Lintian::Collect->new($name, $type);
+    if ($collect->native) {
+        print "Package is native\n";
+    }
+
+=head1 DESCRIPTION
+
+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.
+
+=head1 CLASS METHODS
+
+=over 4
+
+=item new (PACKAGE)
+
+Creates a new Lintian::Collect::Binary object.  Currently, PACKAGE is
+ignored.  Normally, this method should not be called directly, only via
+the L<Lintian::Collect> constructor.
+
+=cut
+
 sub new {
     my ($class, $pkg) = @_;
     my $self = {};
@@ -39,8 +74,26 @@ sub new {
     return $self;
 }
 
-# Returns whether the package is a native package according to
-# its version number
+=back
+
+=head1 INSTANCE METHODS
+
+In addition to the instance methods listed below, all instance methods
+documented in the L<Lintian::Collect> and the
+L<Lintian::Collect::Package> modules are also available.
+
+=over 4
+
+=item native
+
+Returns true if the binary package is native and false otherwise.
+Nativeness will be judged by its version number.
+
+If the version number is absent, this will return false (as
+native packages are a lot rarer than non-native ones).
+
+=cut
+
 # sub native Needs-Info :field
 sub native {
     my ($self) = @_;
@@ -56,8 +109,15 @@ sub native {
     return $self->{native};
 }
 
-# Get the changelog file of a binary package as a Parse::DebianChangelog
-# object.  Returns undef if the changelog file couldn't be found.
+=item changelog
+
+Returns the changelog of the binary package as a Parse::DebianChangelog
+object, or undef if the changelog doesn't exist.  The changelog-file
+collection script must have been run to create the changelog file, which
+this method expects to find in F<changelog>.
+
+=cut
+
 sub changelog {
     my ($self) = @_;
     return $self->{changelog} if exists $self->{changelog};
@@ -72,18 +132,42 @@ sub changelog {
     return $self->{changelog};
 }
 
-# Like unpacked except this returns the contents of the control.tar.gz
-# in an unpacked directory.
-#
+=item control ([FILE])
+
+Returns the path to FILE in the control.tar.gz.  FILE must be relative
+to the root of the control.tar.gz and should be without leading slash
+(and and without "./").  If FILE is not in the control.tar.gz, it
+returns the path to a non-existent file entry.
+
+To get a list of entries in the control.tar.gz or the file meta data
+of the entries (as L<path objects|Lintian::Path>), see
+L</sorted_control_index> and L</control_index (FILE)>.
+
+The caveats of L<unpacked|Lintian::Collect::Package/unpacked ([FILE])>
+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.
+
+=cut
+
 # sub control Needs-Info bin-pkg-control
 sub control {
     my ($self, $file) = @_;
     return $self->_fetch_extracted_dir('control', 'control', $file);
 }
 
-# Like index except it returns the index for the control/metadata of
-# binary package.
-#
+=item control_index (FILE)
+
+Returns a L<path object|Lintian::Path> to FILE in the control.tar.gz.
+FILE must be relative to the root of the control.tar.gz and must be
+without leading slash (or "./").  If FILE is not in the
+control.tar.gz, it returns C<undef>.
+
+To get a list of entries in the control.tar.gz, see
+L</sorted_control_index>.  To actually access the underlying file
+(e.g. the contents), use L</control ([FILE])>.
+
+=cut
+
 # sub control_index Needs-Info bin-pkg-control
 sub control_index {
     my ($self, $file) = @_;
@@ -91,9 +175,17 @@ sub control_index {
                                      undef, $file);
 }
 
-# Like sorted_index except it returns the index for the control/metadata of
-# binary package.
-#
+=item sorted_control_index
+
+Returns a sorted array of file names listed in the control.tar.gz.
+The names will not have a leading slash (or "./") and can be passed
+to L</control ([FILE])> or L</control_index (FILE)> as is.
+
+The array will not contain the entry for the "root" of the
+control.tar.gz.
+
+=cut
+
 # sub sorted_control_index Needs-Info :control_index
 sub sorted_control_index {
     my ($self) = @_;
@@ -103,22 +195,36 @@ sub sorted_control_index {
     return @{ $self->{'sorted_control-index'} };
 }
 
-# Returns a handle with the strings in a given binary file (as computed
-# by coll/strings)
-#
+=item strings (FILE)
+
+Returns an open handle, which will read the data from coll/strings for
+FILE.  If coll/strings did not collect any strings about FILE, this
+returns an open read handle with no content.
+
+Caller is responsible for closing the handle either way.
+
+=cut
+
 # sub strings Needs-Info strings
 sub strings {
     my ($self, $file) = @_;
     my $real = $self->_fetch_extracted_dir ('strings', 'strings', $file);
     if ( not -f "${real}.gz" ) {
-        open my $fd, '<', '/dev/null';
+        open my $fd, '<', '/dev/null' or fail "open /dev/null: $!";
         return $fd;
     }
     my $fd = open_gz ("$real.gz") or fail "open ${file}.gz: $!";
     return $fd;
 }
 
-# Returns the md5sums as calculated by the md5sums collection
+=item md5sums
+
+Returns a hashref mapping a FILE to its md5sum.  The md5sum is
+computed by Lintian during extraction and is not guaranteed to match
+the md5sum in the "md5sums" control file.
+
+=cut
+
 #  sub md5sums Needs-Info md5sums
 sub md5sums {
     my ($self) = @_;
@@ -144,6 +250,41 @@ sub md5sums {
     return $result;
 }
 
+=item scripts
+
+Returns a hashref mapping a FILE to its script/interpreter information
+(if FILE is a script).  If FILE is not a script, it is not in the hash
+(and callers should use exists to test membership to ensure this
+invariant holds).
+
+The value for a given FILE consists of a table with the following keys
+(and associated value):
+
+=over 4
+
+=item calls_env
+
+Returns a truth value if the script uses env (/usr/bin/env or
+/bin/env) in the "#!".  Otherwise it is C<undef>.
+
+=item interpreter
+
+This is the interpreter used.  If calls_env is true, this will be the
+first argument to env.  Otherwise it will be the command listed after
+the "#!".
+
+NB: Some template files have "#!" lines like "#!@PERL@" or "#!perl".
+In this case, this value will be @PERL@ or perl (respectively).
+
+=item name
+
+Return the file name of the script.  This will be identical to key to
+look up this table.
+
+=back
+
+=cut
+
 sub scripts {
     my ($self) = @_;
     return $self->{scripts} if exists $self->{scripts};
@@ -172,6 +313,13 @@ sub scripts {
     return $self->{scripts};
 }
 
+=item objdump_info
+
+Returns a hashref mapping a FILE to the data collected by objdump-info
+or C<undef> if no data is available for that FILE.  Data is generally
+only collected for ELF files.
+
+=cut
 
 # Returns the information from collect/objdump-info
 sub objdump_info {
@@ -242,8 +390,15 @@ sub objdump_info {
     return $self->{objdump_info};
 }
 
+=item hardening_info
+
+Returns a hashref mapping a FILE to its hardening issues.
+
+NB: This is generally only useful for checks/binaries to emit the
+hardening-no-* tags.
+
+=cut
 
-# Returns the information from collect/hardening-info
 # sub hardening_info Needs-Info hardening-info
 sub hardening_info {
     my ($self) = @_;
@@ -268,8 +423,37 @@ sub hardening_info {
     return $self->{hardening_info};
 }
 
+=item java_info
+
+Returns a hashref containing information about JAR files found in
+binary packages, in the form I<file name> -> I<info>, where I<info> is
+a hash containing the following keys:
+
+=over 4
+
+=item manifest
+
+A hash containing the contents of the JAR file manifest. For instance,
+to find the classpath of I<$file>, you could use:
+
+ 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.
+
+=item files
+
+A table of the files in the JAR.  Each key is a file name and its value
+is its "Major class version" for Java or "-" if it is not a class file.
+
+=back
+
+=cut
 
-# Returns the information from collect/objdump-info
 # sub java_info Needs-Info java-info
 sub java_info {
     my ($self) = @_;
@@ -319,11 +503,33 @@ sub java_info {
     return $self->{java_info};
 }
 
-# Return a Lintian::Relation object for the given relationship field.  In
-# addition to all the normal relationship fields, the following special
-# field names are supported: all (pre-depends, depends, recommends, and
-# suggests), strong (pre-depends and depends), and weak (recommends and
-# suggests).
+=item relation (FIELD)
+
+Returns a Lintian::Relation object for the specified FIELD, which should
+be one of the possible relationship fields of a Debian package or one of
+the following special values:
+
+=over 4
+
+=item all
+
+The concatenation of Pre-Depends, Depends, Recommends, and Suggests.
+
+=item strong
+
+The concatenation of Pre-Depends and Depends.
+
+=item weak
+
+The concatenation of Recommends and Suggests.
+
+=back
+
+If FIELD isn't present in the package, the returned Lintian::Relation
+object will be empty (always satisfied and implies nothing).
+
+=cut
+
 # sub relation Needs-Info :field
 sub relation {
     my ($self, $field) = @_;
@@ -350,8 +556,15 @@ sub relation {
     return $self->{relation}->{$field};
 }
 
-# Returns a truth value if the package appears to be transitional package.
-# - this is based on the package description.
+=item is_transitional
+
+Returns a truth value if the package appears to be a transitional
+package.
+
+This is based on the package's description.
+
+=cut
+
 # sub is_transitional Needs-Info :field
 sub is_transitional {
     my ($self) = @_;
@@ -359,8 +572,19 @@ sub is_transitional {
     return $desc =~ m/transitional package/;
 }
 
-# Returns a truth value if the file is listed in the conffiles file
-# - Note files should be passed relative to the package root.
+=item is_conffile (FILE)
+
+Returns a truth value if FILE is listed in the conffiles control file.
+If the control file is not present or FILE is not listed in it, it
+returns C<undef>.
+
+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).
+
+=cut
+
 # sub is_conffile Needs-Info :control
 sub is_conffile {
     my ($self, $file) = @_;
@@ -389,190 +613,6 @@ sub is_conffile {
     return;
 }
 
-=head1 NAME
-
-Lintian::Collect::Binary - Lintian interface to binary package data collection
-
-=head1 SYNOPSIS
-
-    my ($name, $type) = ('foobar', 'binary');
-    my $collect = Lintian::Collect->new($name, $type);
-    if ($collect->native) {
-        print "Package is native\n";
-    }
-
-=head1 DESCRIPTION
-
-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.
-
-=head1 CLASS METHODS
-
-=over 4
-
-=item new(PACKAGE)
-
-Creates a new Lintian::Collect::Binary object.  Currently, PACKAGE is
-ignored.  Normally, this method should not be called directly, only via
-the Lintian::Collect constructor.
-
-=back
-
-=head1 INSTANCE METHODS
-
-In addition to the instance methods listed below, all instance methods
-documented in the Lintian::Collect module are also available.
-
-=over 4
-
-=item changelog()
-
-Returns the changelog of the binary package as a Parse::DebianChangelog
-object, or undef if the changelog doesn't exist.  The changelog-file
-collection script must have been run to create the changelog file, which
-this method expects to find in F<changelog>.
-
-=item java_info()
-
-Returns a hash containing information about JAR files found in binary
-packages, in the form I<file name> -> I<info>, where I<info> is a hash
-containing the following keys:
-
-=over 4
-
-=item manifest
-
-A hash containing the contents of the JAR file manifest. For instance,
-to find the classpath of I<$file>, you could use:
-
- my $cp = $info->java_info()->{$file}->{'Class-Path'};
-
-=item files
-
-the list of the files contained in the archive.
-
-=back
-
-=item native()
-
-Returns true if the binary package is native and false otherwise.
-Nativeness will be judged by its version number.
-
-If the version number is absent, this will return false (as
-native packages are a lot rarer than non-native ones).
-
-=item index()
-
-Returns a reference to an array of hash references with content
-information about the binary package.  Each hash may have the
-following keys:
-
-=over 4
-
-=item name
-
-Name of the index entry without leading slash.
-
-=item owner
-
-=item group
-
-=item uid
-
-=item gid
-
-The former two are in string form and may depend on the local system,
-the latter two are the original numerical values as saved by tar.
-
-=item date
-
-Format "YYYY-MM-DD".
-
-=item time
-
-Format "hh:mm".
-
-=item type
-
-Entry type as one character.
-
-=item operm
-
-Entry permissions as octal number.
-
-=item size
-
-Entry size in bytes.  Note that tar(1) lists the size of directories as
-0 (so this is what you will get) contrary to what ls(1) does.
-
-=item link
-
-If the entry is either a hardlink or symlink, contains the target of the
-link.
-
-=item count
-
-If the entry is a directory, contains the number of other entries this
-directory contains.
-
-=back
-
-=item relation(FIELD)
-
-Returns a Lintian::Relation object for the specified FIELD, which should
-be one of the possible relationship fields of a Debian package or one of
-the following special values:
-
-=over 4
-
-=item all
-
-The concatenation of Pre-Depends, Depends, Recommends, and Suggests.
-
-=item strong
-
-The concatenation of Pre-Depends and Depends.
-
-=item weak
-
-The concatenation of Recommends and Suggests.
-
-=back
-
-If FIELD isn't present in the package, the returned Lintian::Relation
-object will be empty (always satisfied and implies nothing).
-
-=item is_transitional
-
-Returns a truth value if the package appears to be a transitional
-package.
-
-This is based on the package's description.
-
-=item strings (FILE)
-
-Returns an open handle, which will read the data from coll/strings for
-FILE.
-
-=item is_conffile (FILE)
-
-Returns a truth value if FILE is listed in the conffiles control file.
-If the control file is not present or FILE is not listed in it, it
-returns C<undef>.
-
-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).
-
 =back
 
 =head1 AUTHOR
@@ -581,7 +621,7 @@ Originally written by Frank Lichtenheld <djpig@debian.org> for Lintian.
 
 =head1 SEE ALSO
 
-lintian(1), Lintian::Collect(3), Lintian::Relation(3)
+lintian(1), L<Lintian::Collect>, L<Lintian::Relation>
 
 =cut
 
diff --git a/lib/Lintian/Collect/Changes.pm b/lib/Lintian/Collect/Changes.pm
index 9fd03dd..9e2c957 100644
--- a/lib/Lintian/Collect/Changes.pm
+++ b/lib/Lintian/Collect/Changes.pm
@@ -22,63 +22,6 @@ use strict;
 use warnings;
 use base 'Lintian::Collect';
 
-# Initialize a new .changes file collect object.  Takes the package name,
-# which is currently unused.
-sub new {
-    my ($class, $pkg) = @_;
-    my $self = {};
-    bless($self, $class);
-    return $self;
-}
-
-# Returns information about the files referenced in the .changes file.
-# sub files Needs-Info <>
-sub files {
-    my ($self) = @_;
-
-    return $self->{files} if exists $self->{files};
-
-    my %files;
-
-    my $file_list = $self->field('files') || '';
-    local $_;
-    for (split /\n/, $file_list) {
-        chomp;
-        s/^\s+//o;
-        next if $_ eq '';
-
-        my ($md5sum,$size,$section,$priority,$file) = split(/\s+/o, $_);
-        next if $file =~ m,/,;
-
-        $files{$file}{checksums}{md5} = {
-            'sum' => $md5sum, 'filesize' => $size,
-        };
-        $files{$file}{name} = $file;
-        $files{$file}{size} = $size;
-        $files{$file}{section} = $section;
-        $files{$file}{priority} = $priority;
-    }
-
-    foreach my $alg (qw(sha1 sha256)) {
-        my $list = $self->field("checksums-$alg") || '';
-        for (split /\n/, $list) {
-            chomp;
-            s/^\s+//o;
-            next if $_ eq '';
-
-            my ($checksum, $size, $file) = split(/\s+/o, $_);
-            next if $file =~ m,/,;
-
-            $files{$file}{checksums}{$alg} = {
-                'sum' => $checksum, 'filesize' => $size
-            };
-        }
-    }
-
-    $self->{files} = \%files;
-    return $self->{files};
-}
-
 =head1 NAME
 
 Lintian::Collect::Changes - Lintian interface to .changes file data collection
@@ -104,22 +47,35 @@ files.
 
 =over 4
 
-=item new(PACKAGE)
+=item new (PACKAGE)
 
 Creates a new Lintian::Collect::Changes object.  Currently, PACKAGE is
 ignored.  Normally, this method should not be called directly, only via
-the Lintian::Collect constructor.
+the L<Lintian::Collect> constructor.
+
+=cut
+
+# Initialize a new .changes file collect object.  Takes the package name,
+# which is currently unused.
+sub new {
+    my ($class, $pkg) = @_;
+    my $self = {};
+    bless($self, $class);
+    return $self;
+}
 
 =back
 
 =head1 INSTANCE METHODS
 
+=over 4
+
 In addition to the instance methods listed below, all instance methods
-documented in the Lintian::Collect module are also available.
+documented in the L<Lintian::Collect> module are also available.
 
 =over 4
 
-=item files()
+=item files
 
 Returns a reference to a hash containing information about files listed
 in the .changes file.  Each hash may have the following keys:
@@ -162,6 +118,55 @@ checksum.
 
 =back
 
+=cut
+
+# sub files Needs-Info :fields
+sub files {
+    my ($self) = @_;
+
+    return $self->{files} if exists $self->{files};
+
+    my %files;
+
+    my $file_list = $self->field('files') || '';
+    local $_;
+    for (split /\n/, $file_list) {
+        chomp;
+        s/^\s+//o;
+        next if $_ eq '';
+
+        my ($md5sum,$size,$section,$priority,$file) = split(/\s+/o, $_);
+        next if $file =~ m,/,;
+
+        $files{$file}{checksums}{md5} = {
+            'sum' => $md5sum, 'filesize' => $size,
+        };
+        $files{$file}{name} = $file;
+        $files{$file}{size} = $size;
+        $files{$file}{section} = $section;
+        $files{$file}{priority} = $priority;
+    }
+
+    foreach my $alg (qw(sha1 sha256)) {
+        my $list = $self->field("checksums-$alg") || '';
+        for (split /\n/, $list) {
+            chomp;
+            s/^\s+//o;
+            next if $_ eq '';
+
+            my ($checksum, $size, $file) = split(/\s+/o, $_);
+            next if $file =~ m,/,;
+
+            $files{$file}{checksums}{$alg} = {
+                'sum' => $checksum, 'filesize' => $size
+            };
+        }
+    }
+
+    $self->{files} = \%files;
+    return $self->{files};
+}
+
 =back
 
 =head1 AUTHOR
@@ -170,7 +175,7 @@ Originally written by Adam D. Barratt <adsb@debian.org> for Lintian.
 
 =head1 SEE ALSO
 
-lintian(1), Lintian::Collect(3)
+lintian(1), L<Lintian::Collect>
 
 =cut
 
diff --git a/lib/Lintian/Collect/Package.pm b/lib/Lintian/Collect/Package.pm
index d8cef08..20e0258 100644
--- a/lib/Lintian/Collect/Package.pm
+++ b/lib/Lintian/Collect/Package.pm
@@ -27,16 +27,104 @@ use Carp qw(croak);
 use Lintian::Path;
 use Lintian::Util qw(open_gz perm2oct);
 
-# Returns the path to the dir where the package is unpacked
-#  or a file therein (see pod below)
-# May croak if the package has not been unpacked.
+=head1 NAME
+
+Lintian::Collect::Package - Lintian base interface to binary and source package data collection
+
+=head1 SYNOPSIS
+
+    my ($name, $type) = ('foobar', 'source');
+    my $collect = Lintian::Collect->new($name, $type);
+    my $file;
+    eval { $file = $collect->unpacked('/bin/ls'); };
+    if ( $file && -e $file ) {
+        # work with $file
+        ;
+    } elsif ($file) {
+        print "/bin/ls is not available in the Package\n";
+    } else {
+        print "Package has not been unpacked\n";
+    }
+
+=head1 DESCRIPTION
+
+Lintian::Collect::Package provides part of an interface to package
+data for source and binary packages.  It implements data collection
+methods specific to all packages that can be unpacked (or can contain
+files)
+
+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.
+
+=head1 INSTANCE METHODS
+
+In addition to the instance methods listed below, all instance methods
+documented in the L<Lintian::Collect> module are also available.
+
+=over 4
+
+=item unpacked ([FILE])
+
+Returns the path to the directory in which the package has been
+unpacked.  FILE must be relative to the root of the of the package and
+should be without leading slash (and without leading "./").  If FILE
+is not in the package, it returns the path to a non-existent file
+entry.
+
+The path returned is not guaranteed to be inside the Lintian Lab as
+the package may have been unpacked outside the Lab (e.g. as
+optimization).
+
+Caveat with symlinks: Package is extracted as is and the path returned
+by this method points to the extracted file object.  If this is a
+symlink, it may "escape the root" and point to a file outside the lab
+(and a path traversal).
+
+The following code may be helpful in checking for path traversal:
+
+ use Cwd qw(realpath);
+
+ my $collect = ... ;
+ my $file = '../../../etc/passwd';
+ # Append slash to follow symlink if $collect->unpacked returns a symlink
+ my $uroot = realpath ($collect->unpacked . '/');
+ my $ufile = realpath ($collect->unpacked ($file));
+ if ($ufile =~ m,^$uroot,) {
+    # has not escaped $uroot
+    do_stuff($ufile);
+ } else {
+    # escaped $uroot
+    die "Possibly path traversal ($file)";
+ }
+
+Alternatively one can use resolve_pkg_path in L<Lintian::Util> or
+L<link_resolved|Lintian::Path/link_resolved>.
+
+To get a list of entries in the package or the file meta data of the
+entries (as L<path objects|Lintian::Path>), see L</sorted_index> and
+L</index (FILE)>.
+
+=cut
+
 # sub unpacked Needs-Info unpacked
 sub unpacked {
     my ($self, $file) = @_;
     return $self->_fetch_extracted_dir('unpacked', 'unpacked', $file);
 }
 
-# Returns the information from collect/file-info
+=item file_info (FILE)
+
+Returns the output of file(1) for FILE (if it exists) or C<undef>.
+
+NB: The value may have been calibrated by Lintian.  A notorious example
+is gzip files, where file(1) can be unreliable at times (see #620289)
+
+=cut
+
 sub file_info {
     my ($self, $file) = @_;
     if (exists $self->{file_info}) {
@@ -69,14 +157,40 @@ sub file_info {
     return;
 }
 
-# Returns the information from the indices
+=item index (FILE)
+
+Returns a L<path object|Lintian::Path> to FILE in the package.  FILE
+must be relative to the root of the control.tar.gz and must be without
+leading slash (or "./").  If FILE is not in the package, it returns
+C<undef>.
+
+To get a list of entries in the package, see L</sorted_index>.  To
+actually access the underlying file (e.g. the contents), use
+L</unpacked ([FILE])>.
+
+Caveat: Not
+
+=cut
+
 # sub index Needs-Info index
 sub index {
     my ($self, $file) = @_;
     return $self->_fetch_index_data('index', 'index', 'index-owner-id', $file);
 }
 
-# Returns sorted file index (eqv to sort keys %{$info->index}), except it is cached.
+=item sorted_control_index
+
+Returns a sorted array of file names listed in the package.  The names
+will not have a leading slash (or "./") and can be passed to
+L</unpacked ([FILE])> or L</index (FILE)> as is.
+
+The array will not contain the entry for the "root" of the package.
+
+NB: For source packages, please see the
+L<"index"-caveat|Lintian::Collect::Source/index (FILE)>.
+
+=cut
+
 #  sub sorted_index Needs-Info :index
 sub sorted_index {
     my ($self) = @_;
@@ -252,96 +366,6 @@ sub _fetch_index_data {
 
 1;
 
-=head1 NAME
-
-Lintian::Collect::Package - Lintian base interface to binary and source package data collection
-
-=head1 SYNOPSIS
-
-    my ($name, $type) = ('foobar', 'source');
-    my $collect = Lintian::Collect->new($name, $type);
-    my $file;
-    eval { $file = $collect->unpacked('/bin/ls'); };
-    if ( $file && -e $file ) {
-        # work with $file
-        ;
-    } elsif ($file) {
-        print "/bin/ls is not available in the Package\n";
-    } else {
-        print "Package has not been unpacked\n";
-    }
-
-=head1 DESCRIPTION
-
-Lintian::Collect::Package provides part of an interface to package
-data for source and binary packages.  It implements data collection
-methods specific to all packages that can be unpacked (or can contain
-files)
-
-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.
-
-=head1 INSTANCE METHODS
-
-=over 4
-
-=item unpacked([$name])
-
-Returns the path to the directory in which the package has been
-unpacked.  If C<$name> is given, it will return the path to that
-specific file (or dir).  The method will strip any leading "./" and
-"/" from C<$name>, but it will not check if C<$name> actually exists
-nor will it check for path traversals.
-  Caller is responsible for checking the sanity of the path passed to
-unpacked and verifying that the returned path points to the expected
-file.
-
-The path returned is not guaranteed to be inside the Lintian Lab as
-the package may have been unpacked outside the Lab (e.g. as
-optimization).
-
-The following code may be helpful in checking for path traversal:
-
- use Cwd qw(realpath);
-
- my $collect = ... ;
- my $file = '../../../etc/passwd';
- # Append slash to follow symlink if $collect->unpacked returns a symlink
- my $uroot = realpath($collect->unpacked() . '/');
- my $ufile = realpath($collect->unpacked($file));
- if ($ufile =~ m,^$uroot,) {
-    # has not escaped $uroot
-    do_stuff($ufile);
- } else {
-    # escaped $uroot
-    die "Possibly path traversal ($file)";
- }
-
-Alternatively one can use Lintian::Util::resolve_pkg_path.
-
-=item file_info (FILE)
-
-Returns the output of file(1) for FILE (if it exists) or C<undef>.
-
-Note the file names do not have any leading "./" nor "/".
-
-=item index (FILE)
-
-Looks up FILE in the package index and returns a L<Lintian::Path>
-for it or C<undef> (if FILE is not in the index).
-
-Note the file names do not have any leading "./" nor "/".
-
-=item sorted_index
-
-Returns a sorted list of all files listed in index (or file_info hashref).
-
-It does not contain "root dir".
-
 =back
 
 =head1 AUTHOR
@@ -350,8 +374,8 @@ Originally written by Niels Thykier <niels@thykier.net> for Lintian.
 
 =head1 SEE ALSO
 
-lintian(1), Lintian::Collect(3), Lintian::Collect::Binary(3),
-Lintian::Collect::Source(3)
+lintian(1), L<Lintian::Collect>, L<Lintian::Collect::Binary>,
+L<Lintian::Collect::Source>
 
 =cut
 
diff --git a/lib/Lintian/Collect/Source.pm b/lib/Lintian/Collect/Source.pm
index 3249795..4acb1da 100644
--- a/lib/Lintian/Collect/Source.pm
+++ b/lib/Lintian/Collect/Source.pm
@@ -31,6 +31,43 @@ use Parse::DebianChangelog;
 
 use Lintian::Util qw(read_dpkg_control);
 
+=head1 NAME
+
+Lintian::Collect::Source - Lintian interface to source package data collection
+
+=head1 SYNOPSIS
+
+    my ($name, $type) = ('foobar', 'source');
+    my $collect = Lintian::Collect->new($name, $type);
+    if ($collect->native) {
+        print "Package is native\n";
+    }
+
+=head1 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.
+
+=head1 CLASS METHODS
+
+=over 4
+
+=item new (PACKAGE)
+
+Creates a new Lintian::Collect::Source object.  Currently, PACKAGE is
+ignored.  Normally, this method should not be called directly, only via
+the Lintian::Collect constructor.
+
+=cut
+
 # Initialize a new source package collect object.  Takes the package name,
 # which is currently unused.
 sub new {
@@ -40,8 +77,25 @@ sub new {
     return $self;
 }
 
-# Get the changelog file of a source package as a Parse::DebianChangelog
-# object.  Returns undef if the changelog file couldn't be found.
+=back
+
+=head1 INSTANCE METHODS
+
+In addition to the instance methods listed below, all instance methods
+documented in the L<Lintian::Collect> and L<Lintian::Collect::Package>
+modules are also available.
+
+=over 4
+
+=item changelog
+
+Returns the changelog of the source package as a Parse::DebianChangelog
+object, or C<undef> if the changelog is a symlink or doesn't exist.  The
+debfiles collection script must have been run to create the changelog
+file, which this method expects to find in F<debfiles/changelog>.
+
+=cut
+
 # sub changelog Needs-Info :debfiles
 sub changelog {
     my ($self) = @_;
@@ -56,8 +110,15 @@ sub changelog {
     return $self->{changelog};
 }
 
-# Returns the path to diffstat result on the diff (if it exists) or an empty file
-# if there is no diff.gz
+=item diffstat
+
+Returns the path to diffstat output run on the Debian packaging diff
+(a.k.a. the "diff.gz") for 1.0 non-native packages.  For source
+packages without a "diff.gz" component, this returns the path to an
+empty file (this may be a device like /dev/null).
+
+=cut
+
 #  sub diffstat Needs-Info diffstat
 sub diffstat {
     my ($self) = @_;
@@ -68,10 +129,22 @@ sub diffstat {
     return $dstat;
 }
 
-# Returns whether the package is a native package.  For everything except
-# format 3.0 (quilt) packages, we base this on whether we have a Debian
-# *.diff.gz file.  3.0 (quilt) packages are always non-native.  Returns true
-# if the package is native and false otherwise.
+=item native
+
+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 an 1.0
+package.
+
+=cut
+
 # sub native Needs-Info :field
 sub native {
     my ($self) = @_;
@@ -98,8 +171,15 @@ sub native {
     return $self->{native};
 }
 
-# Returns a hash of binaries to the package type, assuming a type of deb
-# unless the package type field is present.
+=item binaries
+
+Returns a hash reference with the binary package names as keys and the
+(X-)Package-Type as value (which should be either C<deb> or C<udeb>
+currently).  The debfiles collection script must have been run to make
+the F<debfiles/control> file available.
+
+=cut
+
 # sub binaries Needs-Info :binary_field
 sub binaries {
     my ($self) = @_;
@@ -118,8 +198,25 @@ sub binaries {
     return $self->{binaries};
 }
 
-# Returns the value of a source field in d/control or $def//undef
-# if that field is not present.
+=item source_field([FIELD[, DEFAULT]])
+
+Returns the content of the field FIELD from source package paragraph
+of the F<debian/control> file, or DEFAULT (defaulting to C<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.
+
+The debfiles collection script must have been run to make the
+F<debfiles/control> file available.
+
+NB: If a field from the "dsc" file itself is desired, please use
+L<field|Lintian::Collect/field> instead.
+
+=cut
+
 # sub source_field Needs-Info :_load_dctrl
 sub source_field {
     my ($self, $field, $def) = @_;
@@ -128,9 +225,26 @@ sub source_field {
     return $self->{source_field};
 }
 
-# Returns the value of a control field for a binary package or undef
-# if that control field isn't present.  This does not implement
-# inheritance from the settings in the source stanza.
+=item binary_field (PACKAGE[, FIELD[, DEFAULT]])
+
+Returns the content of the field FIELD for the binary package PACKAGE
+in the F<debian/control> file, or DEFAULT (defaulting to C<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
+C<undef> regardless of FIELD and DEFAULT.
+
+The debfiles collection script must have been run to make the
+F<debfiles/control> file available.
+
+=cut
+
 # sub binary_field Needs-Info :_load_dctrl
 sub binary_field {
     my ($self, $package, $field, $def) = @_;
@@ -200,11 +314,37 @@ sub _load_dctrl {
     return 1;
 }
 
-# Return a Lintian::Relation object for the given relationship field in a
-# binary package.  In addition to all the normal relationship fields, the
-# following special field names are supported:  all (pre-depends, depends,
-# recommends, and suggests), strong (pre-depends and depends), and weak
-# (recommends and suggests).
+=item binary_relation (PACKAGE, FIELD)
+
+Returns a L<Lintian::Relation> object for the specified FIELD in the
+binary package PACKAGE in the F<debian/control> file.  FIELD should be
+one of the possible relationship fields of a Debian package or one of
+the following special values:
+
+=over 4
+
+=item all
+
+The concatenation of Pre-Depends, Depends, Recommends, and Suggests.
+
+=item strong
+
+The concatenation of Pre-Depends and Depends.
+
+=item weak
+
+The concatenation of Recommends and Suggests.
+
+=back
+
+If FIELD isn't present in the package, the returned Lintian::Relation
+object will be empty (always satisfied and implies nothing).
+
+Any substvars in F<debian/control> will be represented in the returned
+relation as packages named after the substvar.
+
+=cut
+
 # sub binary_relation Needs-Info :binary_field
 sub binary_relation {
     my ($self, $package, $field) = @_;
@@ -232,12 +372,29 @@ sub binary_relation {
     return $result;
 }
 
+=item relation (FIELD)
+
+Returns a L<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:
+
+=over 4
+
+=item build-depends-all
+
+The concatenation of Build-Depends and Build-Depends-Indep.
+
+=item build-conflicts-all
+
+The concatenation of Build-Conflicts and Build-Conflicts-Indep.
+
+=back
+
+If FIELD isn't present in the package, the returned Lintian::Relation
+object will be empty (always satisfied and implies nothing).
+
+=cut
 
-# Return a Lintian::Relation object for the given build relationship
-# field.  In addition to all the normal build relationship fields, the
-# following special field names are supported:  build-depends-all
-# (build-depends and build-depends-indep) and build-conflicts-all
-# (build-conflicts and build-conflicts-indep).
 # sub relation Needs-Info :field
 sub relation {
     my ($self, $field) = @_;
@@ -264,6 +421,13 @@ sub relation {
     return $self->{relation}->{$field};
 }
 
+=item relation_noarch (FIELD)
+
+The same as L</relation (FIELD)>, but ignores architecture
+restrictions in the FIELD field.
+
+=cut
+
 # Similar to relation(), return a Lintian::Relation object for the given build
 # relationship field, but ignore architecture restrictions.  It supports the
 # same special field names.
@@ -295,6 +459,19 @@ sub relation_noarch {
     return $self->{relation_noarch}->{$field};
 }
 
+=item debfiles ([FILE])
+
+Returns the path to FILE in the debian dir of the extracted source
+package.  FILE must be relative to the root of the debian dir and
+should be without leading slash (and and without "./").  If FILE is
+not in the debian dir, it returns the path to a non-existent file
+entry.
+
+The caveats of L<unpacked|Lintian::Collect::Package/unpacked ([FILE])>
+also apply to this method.
+
+=cut
+
 # Like unpacked except this only returns the contents of debian/ from a source
 # package.
 #
@@ -304,6 +481,26 @@ sub debfiles {
     return $self->_fetch_extracted_dir('debfiles', 'debfiles', $file);
 }
 
+=item index (FILE)
+
+For the general documentation of this method, please refer to the
+documenation of it in
+L<Lintian::Collect::Package|Lintian::Collect::Package/index (FILE)>.
+
+The index of a source package is not very well defined for source
+packages and this is reflected in the behaviour of this method and
+sorted_index as well.  In general all files in the "upstream
+tarball(s)" are covered by this method and sorted_index.
+
+For non-native packages, this means that the packaging is generally
+not available via these methods.  Though if upstream has its own
+packages files, these may be listed even if they are not available
+via unpacked as is the case for 3.0 (quilt) packages.
+
+=back
+
+=cut
+
 # Overriden method; please see Lintian::Collect::Package::index for
 # more information.
 #
@@ -314,162 +511,6 @@ sub index {
     return $self->_fetch_index_data('index', 'index', undef, $file);
 }
 
-=head1 NAME
-
-Lintian::Collect::Source - Lintian interface to source package data collection
-
-=head1 SYNOPSIS
-
-    my ($name, $type) = ('foobar', 'source');
-    my $collect = Lintian::Collect->new($name, $type);
-    if ($collect->native) {
-        print "Package is native\n";
-    }
-
-=head1 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.
-
-=head1 CLASS METHODS
-
-=over 4
-
-=item new(PACKAGE)
-
-Creates a new Lintian::Collect::Source object.  Currently, PACKAGE is
-ignored.  Normally, this method should not be called directly, only via
-the Lintian::Collect constructor.
-
-=back
-
-=head1 INSTANCE METHODS
-
-In addition to the instance methods listed below, all instance methods
-documented in the Lintian::Collect module are also available.
-
-=over 4
-
-=item binaries()
-
-Returns a hash reference with the binary package names as keys and the
-Package-Type as value (which should be either C<deb> or C<udeb>
-currently).  The debfiles collection script must have been run
-to make the F<debfiles/control> file available.
-
-=item binary_field(PACKAGE[, FIELD[, DEFAULT]])
-
-Returns the content of the field FIELD for the binary package PACKAGE
-in the F<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.  This hashref should not be modified.
-
-The debfiles collection script must have been run to make the
-F<debfiles/control> file available.
-
-=item binary_relation(PACKAGE, FIELD)
-
-Returns a Lintian::Relation object for the specified FIELD in the binary
-package PACKAGE in the F<debian/control> file.  FIELD should be one of the
-possible relationship fields of a Debian package or one of the following
-special values:
-
-=over 4
-
-=item all
-
-The concatenation of Pre-Depends, Depends, Recommends, and Suggests.
-
-=item strong
-
-The concatenation of Pre-Depends and Depends.
-
-=item weak
-
-The concatenation of Recommends and Suggests.
-
-=back
-
-If FIELD isn't present in the package, the returned Lintian::Relation
-object will be empty (always satisfied and implies nothing).
-
-Any substvars in F<debian/control> will be represented in the returned
-relation as packages named after the substvar.
-
-=item changelog()
-
-Returns the changelog of the source package as a Parse::DebianChangelog
-object, or undef if the changelog is a symlink or doesn't exist.  The
-debfiles collection script must have been run to create the changelog
-file, which this method expects to find in F<debfiles/changelog>.
-
-=item native()
-
-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 an 1.0
-package.
-
-=item relation(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:
-
-=over 4
-
-=item build-depends-all
-
-The concatenation of Build-Depends and Build-Depends-Indep.
-
-=item build-conflicts-all
-
-The concatenation of Build-Conflicts and Build-Conflicts-Indep.
-
-=back
-
-If FIELD isn't present in the package, the returned Lintian::Relation
-object will be empty (always satisfied and implies nothing).
-
-=item relation_noarch(FIELD)
-
-The same as relation(), but ignores architecture restrictions in the
-FIELD field.
-
-=item source_field([FIELD[, DEFAULT]])
-
-Returns the content of the field FIELD from source package paragraph
-of the F<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.  This hashref should not be modified.
-
-The debfiles collection script must have been run to make the
-F<debfiles/control> file available.
-
-NB: If a field from the "dsc" file itself is desired, please use
-L<field|Lintian::Collect/field> instead.
 
 =back
 

-- 
Debian package checker


Reply to: