[SCM] Debian package checker branch, master, updated. 2.5.4-102-g6ac8805
The following commit has been merged in the master branch:
commit 6ac880570102a2b6443fc9719da1863a7e879a99
Author: Niels Thykier <niels@thykier.net>
Date: Sun Jan 22 22:13:39 2012 +0100
Added pod to L::Collect::Group and fixed copyright
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/lib/Lintian/Collect/Group.pm b/lib/Lintian/Collect/Group.pm
index ff61e2d..717f9a5 100644
--- a/lib/Lintian/Collect/Group.pm
+++ b/lib/Lintian/Collect/Group.pm
@@ -1,7 +1,7 @@
# -*- perl -*-
# Lintian::Collect::Group -- interface to group data collections
-# Copyright (C) 2008 Russ Allbery
+# Copyright (C) 2011 Niels Thykier
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
@@ -19,11 +19,46 @@
# This is a "Lintian::Collect"-like interace (as in "not quite a
# Lintian::Collect").
package Lintian::Collect::Group;
+
use strict;
use warnings;
use Carp qw(croak);
+=head1 NAME
+
+Lintian::Collect::Group - Lintain interface to group data collection
+
+=head1 SYNOPSIS
+
+ my $group = Lintian::ProcessableGroup->new ('lintian_2.5.0_i386.changes');
+ my $ginfo = Lintian::Collect::Group->new ($group);
+
+ foreach my $bin ($group->get_binary_processables) {
+ my $pkg_name = $bin->pkg_name;
+ foreach my $dirdep ($ginfo->direct_dependencies ($pkg_name)) {
+ print "$pkg_name (pre-)depends on $dirdep (which is also in this group)\n";
+ }
+ }
+
+=head1 DESCRIPTION
+
+Lintian::Collect::Group is a "group" variant of the Lintian::Collect
+modules. It attempts to expose a similar interface as these and
+provide useful information about the processable group (or members of
+it).
+
+=head1 CLASS METHODS
+
+=over 4
+
+=item Lintian::Collect::Group->new ($group)
+
+Creates a new object to provide information about
+L<$group|Lintian::ProcessableGroup>.
+
+=cut
+
sub new {
my ($class, $group) = @_;
my $self = {
@@ -32,12 +67,20 @@ sub new {
return bless $self, $class;
}
-# Returns the direct strong dependendencies for a package
-# that are available in the group.
-# (strong dependencies are "Depends" and "Pre-Depends")
-#
-# Note: "Self-dependencies" (if any) are *not* included.
-#
+=item $ginfo->direct_dependencies ($pkg_name)
+
+If $pkg_name is a part of the underlying processable group, this
+method returns a listref containing all the direct dependencies of
+$pkg_name. If $pkg_name is not a part of the group, this returns
+undef.
+
+Note: Only strong dependencies (Pre-Depends and Depends) are
+considered.
+
+Note: Self-dependencies (if any) are I<not> included in the result.
+
+=cut
+
# sub direct_dependencies Needs-Info <>
sub direct_dependencies {
my ($self, $p) = @_;
@@ -67,6 +110,12 @@ sub direct_dependencies {
return $deps;
}
+=item $ginfo->type
+
+Return the type of this collect object (which is the string 'group').
+
+=cut
+
# Return the package type.
# sub type Needs-Info <>
sub type {
@@ -74,6 +123,19 @@ sub type {
return 'group';
}
+=back
+
+=head1 AUTHOR
+
+Originally written by Niels Thykier <niels@thykier.net> for Lintian.
+
+=head1 SEE ALSO
+
+lintian(1), Lintian::Collect::Binary(3), Lintian::Collect::Changes(3),
+Lintian::Collect::Source(3)
+
+=cut
+
1;
__END__;
diff --git a/t/scripts/pod-coverage.t b/t/scripts/pod-coverage.t
index a0a8f2a..e8d5169 100755
--- a/t/scripts/pod-coverage.t
+++ b/t/scripts/pod-coverage.t
@@ -15,6 +15,7 @@ our %MODULES =
(
'Lintian::Check' => [],
'Lintian::Collect' => [],
+ 'Lintian::Collect::Group' => [],
'Lintian::Command' => [],
'Lintian::Command::Simple' => [],
'Lintian::Data' => [],
--
Debian package checker
Reply to: