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

[SCM] Debian package checker branch, master, updated. 2.5.0-rc2-122-g12888e8



The following commit has been merged in the master branch:
commit fb654d03d01cd53cf2266e93f5c2082c3a6f478f
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Apr 2 13:51:38 2011 +0200

    Made manpages check strong dependencies for manpages

diff --git a/checks/manpages b/checks/manpages
index 2943955..d7efdb4 100644
--- a/checks/manpages
+++ b/checks/manpages
@@ -26,20 +26,23 @@ use Util;
 use Lintian::Check qw(check_spelling);
 use Lintian::Tags qw(tag);
 use Text::ParseWords ();
+use File::Basename;
 
 sub run {
 
 my $pkg = shift;
 my $type = shift;
 my $info = shift;
+my $proc = shift;
+my $group = shift;
 
-use File::Basename;
 
 my %binary;
 my %link;
 # my %sect_by_binary;
 # my %sect_by_manpage;
 my %manpage;
+my $relation;
 
 # Read package contents...
 foreach my $file (@{$info->sorted_index}) {
@@ -330,6 +333,32 @@ foreach my $file (@{$info->sorted_index}) {
     }
 }
 
+# Check our dependencies:
+$relation = $info->relation('strong');
+foreach my $depproc ($group->get_processables('binary')){
+    if ($relation->implies($depproc->pkg_name())){
+	# Find the manpages in our related dependencies
+	my $depinfo = $depproc->info();
+	foreach my $file (@{ $depinfo->sorted_index() }){
+	    next if $file eq '';
+	    my $index_info = $depinfo->index->{$file};
+	    my $perm = $index_info->{type};
+	    my ($fname, $path, $suffix) = fileparse($file, qr,\..+$,o);
+	    my $lang = '';
+	    next unless ($perm =~ m,^[\-lh],o) and
+		(($path =~ m,^usr/man/\S+,o)
+		 or ($path =~ m,^usr/X11R6/man/\S+,o)
+		 or ($path =~ m,^usr/share/man/\S+,o) );
+	    next unless ($path =~ m,man\d/$,o);
+	    $manpage{$fname} = [] unless exists $manpage{$fname};
+	    $lang = $1 if $path =~ m,/([^/]+)/man\d/$,o;
+	    push @{$manpage{$fname}}, {file => $file, lang => $lang};
+	}
+    }
+}
+
+
+
 for my $f (sort keys %binary) {
     if (exists $manpage{$f}) {
 	# X11 binary?  This shouldn't happen any more; these are no longer
diff --git a/checks/manpages.desc b/checks/manpages.desc
index e147d41..4b7719c 100644
--- a/checks/manpages.desc
+++ b/checks/manpages.desc
@@ -2,7 +2,7 @@ Check-Script: manpages
 Author: Christian Schwarz <schwarz@debian.org>
 Abbrev: man
 Type: binary
-Needs-Info: unpacked, file-info, index
+Needs-Info: unpacked, file-info, index, fields
 Info: This script checks if a binary package conforms to manual page policy.
 
 Tag: bad-link-to-undocumented-manpage
diff --git a/t/tests/manpages-dependencies/debian/Makefile b/t/tests/manpages-dependencies/debian/Makefile
new file mode 100644
index 0000000..9b54f07
--- /dev/null
+++ b/t/tests/manpages-dependencies/debian/Makefile
@@ -0,0 +1,7 @@
+all: pecho.1
+
+pecho.1: pecho
+	pod2man --section 1  $< $@
+
+clean:
+	rm -f pecho.1
diff --git a/t/tests/files-flash-non-free/debian/debian/control.in b/t/tests/manpages-dependencies/debian/debian/control.in
similarity index 65%
copy from t/tests/files-flash-non-free/debian/debian/control.in
copy to t/tests/manpages-dependencies/debian/debian/control.in
index b531357..9f3301d 100644
--- a/t/tests/files-flash-non-free/debian/debian/control.in
+++ b/t/tests/manpages-dependencies/debian/debian/control.in
@@ -1,28 +1,26 @@
 Source: {$srcpkg}
 Priority: extra
-Section: {$section}
+Section: devel
 Maintainer: {$author}
 Standards-Version: {$standards_version}
-Build-Depends: debhelper (>= 7)
-Homepage: http://lintian.debian.org/
+Build-Depends: debhelper (>= 7.0.50~)
 
-Package: {$srcpkg}
-Architecture: {$architecture}
-Depends: $\{misc:Depends\}
+Package: pecho
+Architecture: all
+Depends: $\{misc:Depends\}, {$srcpkg}-data
 Description: {$description}
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
  things.  It should not be installed like a regular package.  It may
  be an empty package.
 
-Package: {$srcpkg}-non-free
-Section: non-free/{$section}
-Architecture: {$architecture}
+Package: pecho-data
+Architecture: all
 Depends: $\{misc:Depends\}
-Description: {$description} (okay)
- non-free in non-free, nice.
- .
+Description: {$description} - data
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
  things.  It should not be installed like a regular package.  It may
  be an empty package.
+ .
+ Data package.
diff --git a/t/tests/manpages-dependencies/debian/debian/pecho-data.manpages b/t/tests/manpages-dependencies/debian/debian/pecho-data.manpages
new file mode 100644
index 0000000..129103b
--- /dev/null
+++ b/t/tests/manpages-dependencies/debian/debian/pecho-data.manpages
@@ -0,0 +1 @@
+pecho.1
diff --git a/t/tests/manpages-dependencies/debian/debian/pecho.install b/t/tests/manpages-dependencies/debian/debian/pecho.install
new file mode 100644
index 0000000..93025b8
--- /dev/null
+++ b/t/tests/manpages-dependencies/debian/debian/pecho.install
@@ -0,0 +1 @@
+pecho usr/bin
diff --git a/t/tests/manpages-dependencies/debian/pecho b/t/tests/manpages-dependencies/debian/pecho
new file mode 100644
index 0000000..d982088
--- /dev/null
+++ b/t/tests/manpages-dependencies/debian/pecho
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+print join(' ', @ARGV), "\n";
+
+=head1 NAME
+
+pecho - POSIX compliant Perl implementation of echo
+
+=head1 SYNOPSIS
+
+pecho [args ...]
+
+=head1 DESCRIPTION
+
+Prints arguments to stdout.
+
+=head1 AUTHORS
+
+Niels Thykier <niels@thykier.net>
+
+=cut
+
diff --git a/t/tests/manpages-dependencies/desc b/t/tests/manpages-dependencies/desc
new file mode 100644
index 0000000..bb8abfb
--- /dev/null
+++ b/t/tests/manpages-dependencies/desc
@@ -0,0 +1,5 @@
+Testname: manpages-general
+Sequence: 6000
+Version: 1.0
+Description: Test for manpages in dependencies
+Test-Against: binary-without-manpage
diff --git a/t/debs/deb-format-record-size/tags b/t/tests/manpages-dependencies/tags
similarity index 100%
copy from t/debs/deb-format-record-size/tags
copy to t/tests/manpages-dependencies/tags

-- 
Debian package checker


Reply to: