[Reproducible-commits] [debhelper] 08/23: dh_installdocs: Error out on some unsafe binNMUs with --link-doc

Jérémy Bobbio lunar at moszumanska.debian.org
Mon Dec 22 02:13:46 UTC 2014


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

lunar pushed a commit to branch pu/reproducible_builds
in repository debhelper.

commit f631c4c30d17c5e537005bacfdd730dd9149cfcc
Author: Niels Thykier <niels at thykier.net>
Date:   Sun Nov 16 20:18:33 2014 +0100

    dh_installdocs: Error out on some unsafe binNMUs with --link-doc
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 dh_installdocs | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/dh_installdocs b/dh_installdocs
index 3eefcdf..af10898 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -158,6 +158,8 @@ init(options => {
 	"link-doc=s" => \$dh{LINK_DOC},
 });
 
+my $called_getpackages = 0;
+
 foreach my $package (@{$dh{DOPACKAGES}}) {
 	next if is_udeb($package);
 	
@@ -166,6 +168,27 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	my $link_doc=($dh{LINK_DOC} && $dh{LINK_DOC} ne $package);
 
 	if ($link_doc) {
+		getpackages('both') unless $called_getpackages++;
+
+		if (package_arch($package) ne package_arch($dh{LINK_DOC})) {
+			if (compat(9)) {
+				my $changelog=pkgfile($package, 'changelog') || 'debian/changelog';
+				if (! -e $changelog) {
+					error("could not find changelog $changelog");
+				}
+
+				open(my $fd, '<', $changelog) or error("open $changelog: $!");
+				my $line = <$fd>;
+				close($fd);
+
+				warning("WARNING: --link-doc between architecture all and not all packages breaks binNMUs");
+				if (defined($line) && $line =~ m/\A\S.*;.*\bbinary-only=yes/) {
+					error("Aborting build as this is a binNMU (leading to a broken package)");
+				}
+			} else {
+				error("--link-doc not allowed between ${package} and $dh{LINK_DOC} (one is all and the other not)");
+			}
+		}
 		# Make sure that the parent directory exists.
 		if (! -d "$tmp/usr/share/doc" && ! -l "$tmp/usr/share/doc") {
 			doit("install","-g",0,"-o",0,"-d","$tmp/usr/share/doc");
@@ -345,3 +368,9 @@ This program is a part of debhelper.
 Joey Hess <joeyh at debian.org>
 
 =cut
+
+# Local Variables:
+# indent-tabs-mode: t
+# tab-width: 4
+# cperl-indent-level: 4
+# End:

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



More information about the Reproducible-commits mailing list