[debhelper-devel] [debhelper] 01/03: include present/wanted architecture in error message
Niels Thykier
nthykier at moszumanska.debian.org
Sun Jun 4 13:28: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 d0d1357b5d4d999b85708848182a33434e50d7a1
Author: Michael Stapelberg <stapelberg at debian.org>
Date: Mon May 15 19:00:10 2017 +0200
include present/wanted architecture in error message
Signed-off-by: Niels Thykier <niels at thykier.net>
---
Debian/Debhelper/Dh_Getopt.pm | 6 +++++-
Debian/Debhelper/Dh_Lib.pm | 37 +++++++++++++++++++++++++++++++++++--
debian/changelog | 6 ++++++
dh | 2 +-
dh_installchangelogs | 2 +-
dh_installdocs | 2 +-
dh_strip | 2 +-
7 files changed, 50 insertions(+), 7 deletions(-)
diff --git a/Debian/Debhelper/Dh_Getopt.pm b/Debian/Debhelper/Dh_Getopt.pm
index a578edb..efcfd60 100644
--- a/Debian/Debhelper/Dh_Getopt.pm
+++ b/Debian/Debhelper/Dh_Getopt.pm
@@ -277,7 +277,11 @@ sub parseopts {
if (! defined $dh{DOPACKAGES} || ! @{$dh{DOPACKAGES}}) {
if (! $dh{BLOCK_NOOP_WARNINGS}) {
- warning("No packages to build.");
+ my %archs;
+ for my $pkg (getpackages()) {
+ $archs{package_declared_arch($pkg)} = 1;
+ }
+ warning("No packages to build. Architecture mismatch: " . buildarch() . ", want: " . join(" ", keys %archs));
}
exit(0);
}
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 1f6d6e8..6cfada3 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -39,6 +39,7 @@ use vars qw(@EXPORT %dh);
&autoscript &filearray &filedoublearray
&getpackages &basename &dirname &xargs %dh
&compat &addsubstvar &delsubstvar &excludefile &package_arch
+ &package_is_arch_all &package_binary_arch &package_declared_arch
&is_udeb &debhelper_script_subst &escape_shell
&inhibit_log &load_log &write_log &commit_override_log
&dpkg_architecture_value &sourcepackage &make_symlink
@@ -50,7 +51,7 @@ use vars qw(@EXPORT %dh);
&generated_file &autotrigger &package_section
&restore_file_on_clean &restore_all_files
&open_gz &reset_perm_and_owner &deprecated_functionality
- &log_installed_files
+ &log_installed_files &buildarch
);
# The Makefile changes this if debhelper is installed in a PREFIX.
@@ -1102,9 +1103,19 @@ sub getpackages {
}
# Returns the arch a package will build for.
+#
+# Deprecated: please switch to the more descriptive
+# package_binary_arch function instead.
sub package_arch {
my $package=shift;
-
+ return package_binary_arch($package);
+}
+
+# Returns the architecture going into the resulting .deb, i.e. the
+# host architecture or "all".
+sub package_binary_arch {
+ my $package=shift;
+
if (! exists $package_arches{$package}) {
warning "package $package is not in control info";
return buildarch();
@@ -1112,6 +1123,28 @@ sub package_arch {
return $package_arches{$package} eq 'all' ? "all" : buildarch();
}
+# Returns the Architecture: value which the package declared.
+sub package_declared_arch {
+ my $package=shift;
+
+ if (! exists $package_arches{$package}) {
+ warning "package $package is not in control info";
+ return buildarch();
+ }
+ return $package_arches{$package};
+}
+
+# Returns whether the package specified Architecture: all
+sub package_is_arch_all {
+ my $package=shift;
+
+ if (! exists $package_arches{$package}) {
+ warning "package $package is not in control info";
+ return buildarch();
+ }
+ return $package_arches{$package} eq 'all';
+}
+
# Returns the multiarch value of a package.
sub package_multiarch {
my $package=shift;
diff --git a/debian/changelog b/debian/changelog
index 2f39625..0d2da6a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,12 @@ debhelper (10.5) UNRELEASED; urgency=medium
* Dh_Lib: Re-add warning + exit 0 for the -i/-a shortcut that was
added in 10.3. (Closes: #863961)
+ [ Michael Stapelberg ]
+ * Dh_Getopt: Provide a more detailed error message when there are
+ no buildable packages caused by architecture restrictions.
+ (Closes: #858467)
+ * Dh_Lib: Split package_arch($package) into three distinct functions.
+
-- Niels Thykier <niels at thykier.net> Sun, 04 Jun 2017 11:09:56 +0000
debhelper (10.4) experimental; urgency=medium
diff --git a/dh b/dh
index bd1591b..e6404fc 100755
--- a/dh
+++ b/dh
@@ -825,7 +825,7 @@ sub run_override {
if (defined $override_type) {
if ($has_explicit_target) {
foreach my $package (@{$packages}) {
- my $isall=package_arch($package) eq 'all';
+ my $isall=package_is_arch_all($package);
if (($override_type eq 'indep' && $isall) ||
($override_type eq 'arch' && !$isall)) {
push @todo, $package;
diff --git a/dh_installchangelogs b/dh_installchangelogs
index 4aaef0b..9dc2c96 100755
--- a/dh_installchangelogs
+++ b/dh_installchangelogs
@@ -97,7 +97,7 @@ sub install_binNMU_changelog {
my $output_fn="$tmp/usr/share/doc/$package/$changelog_name";
open my $output, ">", $output_fn
or error("could not open $output_fn for writing: $!");
- my $arch=package_arch($package);
+ my $arch=package_binary_arch($package);
my $output_fn_binary="$output_fn.$arch";
open my $output_binary, ">", $output_fn_binary
or error("could not open $output_fn_binary for writing: $!");
diff --git a/dh_installdocs b/dh_installdocs
index 42e49a4..5d82ea5 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -192,7 +192,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
if ($link_doc) {
getpackages('both') unless $called_getpackages++;
- if (package_arch($package) ne package_arch($dh{LINK_DOC})) {
+ if (package_binary_arch($package) ne package_binary_arch($dh{LINK_DOC})) {
if (compat(9)) {
warning("WARNING: --link-doc between architecture all and not all packages breaks binNMUs");
} else {
diff --git a/dh_strip b/dh_strip
index d776068..738bcc5 100755
--- a/dh_strip
+++ b/dh_strip
@@ -313,7 +313,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
# Temporary workaround: Do not build dbgsym packages for udebs as
# dpkg-gencontrol and dpkg-deb does not agree on the file
# extension.
- if ($dh{ENABLE_DBGSYM} and not $keep_debug and package_arch($package) ne 'all' and not is_udeb($package)) {
+ if ($dh{ENABLE_DBGSYM} and not $keep_debug and not package_is_arch_all($package) and not is_udeb($package)) {
# Avoid creating a dbgsym that would clash with a registered
# package or looks like a manual -dbg package.
if (not $all_packages{"${package}-dbgsym"} and $package !~ m/-dbg(?:sym)?$/) {
--
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