[debhelper-devel] [debhelper] 17/17: Revert "dh_installdocs: Install use dir of mainpackage (C11)"

Niels Thykier nthykier at moszumanska.debian.org
Thu Jun 29 15:49:21 UTC 2017


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit 91d213d70bbc39a5ee626cfa9dce9e04008bb29f
Author: Niels Thykier <niels at thykier.net>
Date:   Thu Jun 29 12:03:45 2017 +0000

    Revert "dh_installdocs: Install use dir of mainpackage (C11)"
    
    This reverts commit 71007f72da682dd9d7f932d81ca2ecd5d46a0e70
    (plus effectively 6c946cd0bb239a4fd02e7acbcb797ecccfb0e3cb).
    
    The policy said "X-doc => X" not "X-doc => main package", so the
    current implementation was insufficient.  Roll it back while we
    figure out a better way to do this.
---
 debhelper.pod                     | 12 ------------
 debian/changelog                  |  2 ++
 dh_installdocs                    | 15 +++------------
 t/dh_installdocs/dh_installdocs.t | 13 +------------
 4 files changed, 6 insertions(+), 36 deletions(-)

diff --git a/debhelper.pod b/debhelper.pod
index cfdc8ce..942334b 100644
--- a/debhelper.pod
+++ b/debhelper.pod
@@ -605,18 +605,6 @@ warning.
 
 =item -
 
-B<dh_installdocs> now installs user-supplied documentation
-(e.g. debian/I<package>.docs) into F</usr/share/doc/mainpackage>
-rather than F</usr/share/doc/package> by default as recommended by
-Debian Policy 3.9.7.
-
-If you need the old behaviour, it can be emulated by using the
-B<--mainpackage> option.
-
-Please remember to check/update your doc-base files.
-
-=item -
-
 B<dh_installdirs> no longer creates debian/I<package> directories
 unless explicitly requested (or it has to create a subdirectory in
 it).
diff --git a/debian/changelog b/debian/changelog
index 19c496f..0d71bb3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,6 +32,8 @@ debhelper (10.6) UNRELEASED; urgency=medium
   * dh_installman: Ditto.
   * dh_installman: Fix bug in how it handled language auto-detection in
     compat 11.  Previously, it did not work as intended.
+  * dh_installdocs: Revert change in compat 11, where it would install
+    documentation into /usr/share/doc/mainpackage.  (Reopens: #824221)
 
  -- Niels Thykier <niels at thykier.net>  Tue, 27 Jun 2017 17:29:32 +0000
 
diff --git a/dh_installdocs b/dh_installdocs
index 8e09022..fc22bce 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -37,10 +37,6 @@ level).
 
 List documentation files to be installed into I<package>.
 
-In compat 11 (or later), these will be installed into
-F</usr/share/doc/mainpackage>.  Previously it would be
-F</usr/share/doc/package>.
-
 =item F<debian/copyright>
 
 The copyright file is installed into all packages, unless a more
@@ -245,16 +241,10 @@ foreach my $package (getpackages()) {
 	next if $skip_install;
 
 	if (not $nodocs and @docs) {
-		my $target_package = $package;
 		my $exclude = ' -and ! -empty';
 		if ($dh{EXCLUDE_FIND}) {
 			$exclude .= ' -and ! \( '.$dh{EXCLUDE_FIND}.' \)';
 		}
-		if (not compat(10)) {
-			$target_package = $dh{MAINPACKAGE};
-		}
-		my $target_dir = "$tmp/usr/share/doc/$target_package";
-		install_dir($target_dir) unless -l $target_dir;
 		foreach my $doc (@docs) {
 			next if excludefile($doc);
 			next if -f $doc && ! -s _; # ignore empty files
@@ -264,13 +254,14 @@ foreach my $package (getpackages()) {
 				my $dir = ($basename eq '.') ? $doc : "$doc/..";
 				my $pwd=`pwd`;
 				chomp $pwd;
-				my $docdir = "$pwd/$target_dir";
+				my $docdir = "$pwd/$tmp/usr/share/doc/$package";
 				complex_doit("cd '$dir' && " .
 							 "find '$basename' \\( -type f -or -type l \\)$exclude -print0 | LC_ALL=C sort -z | " .
 							 "xargs -0 -I {} cp --reflink=auto --parents -dp {} $docdir");
 			}
 			else {
-				doit("cp", '--reflink=auto', "-a", $doc, $target_dir);
+				doit("cp", '--reflink=auto', "-a", $doc,
+					 "$tmp/usr/share/doc/$package");
 			}
 		}
 		doit("chown","-R","0:0","$tmp/usr/share/doc");
diff --git a/t/dh_installdocs/dh_installdocs.t b/t/dh_installdocs/dh_installdocs.t
index ee7e546..e4b2e76 100755
--- a/t/dh_installdocs/dh_installdocs.t
+++ b/t/dh_installdocs/dh_installdocs.t
@@ -22,7 +22,7 @@ if (not defined($rootcmd)) {
 	plan skip_all => 'fakeroot required';
 }
 else {
-	plan(tests => 22);
+	plan(tests => 18);
 }
 
 # Drop DEB_BUILD_PROFILES and DEB_BUILD_OPTIONS so they don't interfere
@@ -37,11 +37,6 @@ system("$rootcmd $TOPDIR/dh_installdocs -pbar $doc");
 ok(-e "debian/bar/usr/share/doc/bar/docfile");
 system("rm -rf debian/foo debian/bar debian/baz");
 
-#regression in debhelper 9.20160709 (#830309)
-system("DH_COMPAT=11 $rootcmd $TOPDIR/dh_installdocs -pbar $doc");
-ok(-e "debian/bar/usr/share/doc/foo/docfile");
-system("rm -rf debian/foo debian/bar debian/baz");
-
 #regression in debhelper 9.20160702 (#830309)
 system("$rootcmd $TOPDIR/dh_installdocs -pbaz --link-doc=foo $doc");
 ok(-l "debian/baz/usr/share/doc/baz");
@@ -55,12 +50,6 @@ ok(readlink("debian/baz/usr/share/doc/baz") eq 'foo');
 ok(-e "debian/baz/usr/share/doc/foo/docfile");
 system("rm -rf debian/foo debian/bar debian/baz");
 
-system("DH_COMPAT=11 $rootcmd $TOPDIR/dh_installdocs -pbaz --link-doc=bar $doc");
-ok(-l "debian/baz/usr/share/doc/baz");
-ok(readlink("debian/baz/usr/share/doc/baz") eq 'bar');
-ok(-e "debian/baz/usr/share/doc/foo/docfile");
-system("rm -rf debian/foo debian/bar debian/baz");
-
 system("$rootcmd $TOPDIR/dh_installdocs -pfoo --link-doc=bar $doc");
 ok(-l "debian/foo/usr/share/doc/foo");
 ok(readlink("debian/foo/usr/share/doc/foo") eq 'bar');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list