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

[SCM] Debian package checker branch, master, updated. 2.2.14-19-ga4f1a03



The following commit has been merged in the master branch:
commit a4f1a037d3c288e65c4e327b078e6e3666c3166a
Author: Russ Allbery <rra@debian.org>
Date:   Sat Sep 12 19:36:04 2009 -0700

    Permit diversion of man pages with minor section differences
    
    * checks/scripts:
      + [RA] Permit diversion of a man page as long as the package is
        installing a man page by the same name in the same numeric section,
        even if the specific section is different.  Thanks, Niko Tyni.
        (Closes: #543781)

diff --git a/checks/scripts b/checks/scripts
index 389636b..2ce8d8c 100644
--- a/checks/scripts
+++ b/checks/scripts
@@ -1061,6 +1061,24 @@ for my $divert (keys %added_diversions) {
     my $divertrx = $divert;
     $divert = unquote($divert, $expand_diversions);
 
+    if (not exists $added_diversions{$divertrx}{'removed'}) {
+	tag 'orphaned-diversion', $divert, $script;
+    }
+
+    # Handle man page diversions somewhat specially.  We may divert away a man
+    # page in one section without replacing that same file, since we're
+    # installing a man page in a different section.  An example is diverting a
+    # man page in section 1 and replacing it with one in section 1p (such as
+    # libmodule-corelist-perl at the time of this writing).
+    #
+    # Deal with this by turning all man page diversions into wildcard
+    # expressions instead that match everything in the same numeric section so
+    # that they'll match the files shipped in the package.
+    if ($divertrx =~ m,^(usr\\/share\\/man\\/\S+\\/.*\\\.\d)\w*(\\\.gz\z),) {
+	$divertrx = "$1.*$2";
+	$expand_diversions = 1;
+    }
+
     if ($expand_diversions) {
 	tag 'diversion-for-unknown-file', $divert, "$script:$line"
 	    unless (grep { $_ =~ m/$divertrx/ } keys %{$info->index});
@@ -1068,10 +1086,6 @@ for my $divert (keys %added_diversions) {
 	tag 'diversion-for-unknown-file', $divert, "$script:$line"
 	    unless (exists $info->index->{$divert});
     }
-
-    if (not exists $added_diversions{$divertrx}{'removed'}) {
-	tag 'orphaned-diversion', $divert, $script;
-    }
 }
 
 }
diff --git a/debian/changelog b/debian/changelog
index 08e5c84..e0c358b 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -48,6 +48,10 @@ lintian (2.2.15) UNRELEASED; urgency=low
     + [RA] Don't warn about missing dependencies on programs if the
       program invocation is followed by || true.  Thanks, Aurelien Jarno.
       (Closes: #541372)
+    + [RA] Permit diversion of a man page as long as the package is
+      installing a man page by the same name in the same numeric section,
+      even if the specific section is different.  Thanks, Niko Tyni.
+      (Closes: #543781)
 
   * data/fields/essential:
     + [RA] New list of essential packages.
diff --git a/t/tests/scripts-diversions/debian/debian/install b/t/tests/scripts-diversions/debian/debian/install
index a38bd53..bf6447b 100644
--- a/t/tests/scripts-diversions/debian/debian/install
+++ b/t/tests/scripts-diversions/debian/debian/install
@@ -1,3 +1,5 @@
 orphan usr/share/scripts
 some-file usr/share/scripts
-file.1 /usr/share/scripts
+file.1 usr/share/scripts
+foo usr/bin
+foo.1p usr/share/man/man1
diff --git a/t/tests/scripts-diversions/debian/debian/postrm b/t/tests/scripts-diversions/debian/debian/postrm
index b965f3e..383d0d2 100644
--- a/t/tests/scripts-diversions/debian/debian/postrm
+++ b/t/tests/scripts-diversions/debian/debian/postrm
@@ -20,6 +20,11 @@ if [ remove = "$1" ]; then
     dpkg-divert --remove --package scripts-diversions \
         --divert /usr/share/scripts/file.1.real \
         /usr/share/scripts/file.1 > /dev/null
+
+    # Clean up the diversion for a binary man page.
+    dpkg-divert --remove --package scripts-diversions \
+        --divert /usr/share/man/man1/foo.real.1.gz \
+        /usr/share/man/man1/foo.1.gz
 fi
 
 #DEBHELPER#
diff --git a/t/tests/scripts-diversions/debian/debian/preinst b/t/tests/scripts-diversions/debian/debian/preinst
index c980aef..2116ef4 100644
--- a/t/tests/scripts-diversions/debian/debian/preinst
+++ b/t/tests/scripts-diversions/debian/debian/preinst
@@ -35,6 +35,12 @@ if [ install = "$1"  ]; then
     dpkg-divert --add --rename --package scripts-diversions \
         --divert /usr/share/scripts/file.1.real \
         /usr/share/scripts/file.1 > /dev/null
+
+    # We're allowed to divert a man page to install another man page in a
+    # different section but the same numeric section.  (Bug#543781)
+    dpkg-divert --add --rename --package scripts-diversions \
+        --divert /usr/share/man/man1/foo.real.1.gz \
+        /usr/share/man/man1/foo.1.gz
 fi
 
 # This isn't a diversion we create anywhere, but we're allowed to do this in
diff --git a/t/tests/scripts-diversions/debian/foo b/t/tests/scripts-diversions/debian/foo
new file mode 100755
index 0000000..adff45d
--- /dev/null
+++ b/t/tests/scripts-diversions/debian/foo
@@ -0,0 +1,2 @@
+#!/bin/sh
+echo 'Fake foo binary'
diff --git a/t/tests/scripts-diversions/debian/foo.1p b/t/tests/scripts-diversions/debian/foo.1p
new file mode 100644
index 0000000..c3088fd
--- /dev/null
+++ b/t/tests/scripts-diversions/debian/foo.1p
@@ -0,0 +1,3 @@
+.TH foo 1p
+.SH NAME
+foo \- a fake man page for a foo

-- 
Debian package checker


Reply to: