[debhelper-devel] [debhelper] 01/01: dh_gencontrol: Make the guess_ma result apply to the dbgsym as well

Niels Thykier nthykier at moszumanska.debian.org
Thu Apr 6 15:24:52 UTC 2017


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

nthykier pushed a commit to branch guess-ma-prototype
in repository debhelper.

commit 6a935585d6a993527c9b6bac351a44ec65c8e41c
Author: Niels Thykier <niels at thykier.net>
Date:   Thu Apr 6 15:15:00 2017 +0000

    dh_gencontrol: Make the guess_ma result apply to the dbgsym as well
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 dh_gencontrol | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/dh_gencontrol b/dh_gencontrol
index ef500a4..bceb9df 100755
--- a/dh_gencontrol
+++ b/dh_gencontrol
@@ -94,11 +94,12 @@ sub guess_multiarch {
 		return 'foreign';
 	} else {
 		my $ma_dir = dpkg_architecture_value('DEB_HOST_MULTIARCH');
+		my $host_arch = dpkg_architecture_value('DEB_HOST_ARCH');
 		my $ma_guess = 'same';
 		my @MA_OK_USR_SHARE_DOC_FILES = qw(
 			AUTHORS AUTHORS.gz BUGS BUGS.gz CREDITS CREDITS.gz
-			buildinfo_$arch.gz changelog.gz changelog.Debian.gz
-			changelog.Debian.$arch.gz copyright LGPL_EXCEPTION.txt
+			buildinfo_${host_arch}.gz changelog.gz changelog.Debian.gz
+			changelog.Debian.${host_arch}.gz copyright LGPL_EXCEPTION.txt
 			NEWS NEWS.gz NEWS.Debian NEWS.Debian.gz README README.gz
 			README.markdown README.markdown.gz README.md README.md.gz
 			README.txt README.txt.gz THANKS THANKS.gz TODO TODO.gz
@@ -136,7 +137,8 @@ sub guess_multiarch {
 				s@/+$@@;
 				return if $_ eq q{};
 				my $verdict = $MA_OK_PATHS{$_} // 'bail';
-				verbose_print("Path $_: ${verdict}");
+				# Printf debugging
+				# verbose_print("Path $_: ${verdict}");
 				return if $verdict eq 'continue';
 				$File::Find::prune = 1;
 				$ma_guess = undef if $verdict ne 'prune';
@@ -190,8 +192,21 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		$build_ids = read_dbgsym_build_ids($dbgsym_info_dir);
 	}
 
+	my $multiarch = package_multiarch($package);
+	if (defined($multiarch)) {
+		# Remove explicit "Multi-Arch: no" headers to avoid autorejects by dak.
+		push (@multiarch_params, '-UMulti-Arch') if $multiarch eq 'no';
+	} elsif (not compat(10)) {
+		# No explicit M-A header? Attempt to derive one
+		$multiarch = guess_multiarch($package);
+		push (@multiarch_params, "-DMulti-Arch=${multiarch}")
+			if defined($multiarch);
+		# Ensure it is defined from here on
+		$multiarch //= 'no';
+	}
+
+
 	if ( -d $dbgsym_tmp) {
-		my $multiarch = package_multiarch($package, 'no');
 		my $section = package_section($package);
 		my $replaces = read_dbgsym_migration($dbgsym_info_dir);
 		my $component = '';
@@ -241,16 +256,6 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		push(@debug_info_params, "-DBuild-Ids=${build_ids}");
 	}
 
-	if (defined(my $ma = package_multiarch($package))) {
-		# Remove explicit "Multi-Arch: no" headers to avoid autorejects by dak.
-		push (@multiarch_params, '-UMulti-Arch') if $ma eq 'no';
-	} elsif (not compat(10)) {
-		# No explicit M-A header? Attempt to derive one
-		my $multiarch_guess = guess_multiarch($package);
-		push (@multiarch_params, "-DMulti-Arch=${multiarch_guess}")
-			if defined($multiarch_guess);
-	}
-
 	# Generate and install control file.
 	doit("dpkg-gencontrol", "-p$package", "-l$changelog", "-T$substvars",
 		"-P$tmp", @debug_info_params, @multiarch_params,

-- 
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