[debhelper-devel] [debhelper] 03/09: dh_auto_*: Only act on valid "non-empty" buildlabels
Niels Thykier
nthykier at moszumanska.debian.org
Sat Jul 29 19:01:18 UTC 2017
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch easier-multi-builds
in repository debhelper.
commit ef62f14c464893ac8dfa6a2902b974dd875ac0f3
Author: Niels Thykier <niels at thykier.net>
Date: Sun Jul 16 16:29:22 2017 +0000
dh_auto_*: Only act on valid "non-empty" buildlabels
Signed-off-by: Niels Thykier <niels at thykier.net>
---
Debian/Debhelper/Dh_Buildsystems.pm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/Debian/Debhelper/Dh_Buildsystems.pm b/Debian/Debhelper/Dh_Buildsystems.pm
index cc0f5c5..852d9fc 100644
--- a/Debian/Debhelper/Dh_Buildsystems.pm
+++ b/Debian/Debhelper/Dh_Buildsystems.pm
@@ -232,6 +232,7 @@ sub buildsystems_list {
sub buildsystems_do {
my $step=shift;
+ my $label_match = -1;
if (!defined $step) {
$step = basename($0);
@@ -246,6 +247,41 @@ sub buildsystems_do {
buildsystems_list($step);
exit 0;
}
+ for my $pkg (getpackages()) {
+ my $pkg_label = package_dh_option($pkg, 'buildlabel') // 'default';
+ next if $pkg_label ne $dh{BUILDLABEL};
+ $label_match = 0;
+ next if not process_pkg($pkg);
+ $label_match = 1;
+ last;
+ }
+
+ if ($label_match == -1) {
+ warning("No packages defined match \"$dh{BUILDLABEL}\": Please verify the parameter is correct");
+ if (not $dh{VERBOSE}) {
+ nonquiet_print("More help available with --verbose");
+ } else {
+ verbose_print("The following labels are defined");
+ my %labels;
+ for my $pkg (getpackages()) {
+ my $pkg_label = package_dh_option($pkg, 'buildlabel') // 'default';
+ push(@{$labels{$pkg_label}}, $pkg);
+ }
+ for my $label (sort(keys(%labels))) {
+ verbose_print(" * ${label}: " . join(' ', @{$labels{$label}}));
+ }
+ }
+ error("Aborting...");
+ } elsif ($label_match < 1) {
+ nonquiet_print("No packages to be processed for build label \"$dh{BUILDLABEL}\"");
+ if ($dh{VERBOSE}) {
+ my @relevant_pkgs = grep {
+ (package_dh_option($_, 'buildlabel') // 'default') eq $dh{BUILDLABEL}
+ } getpackages();
+ verbose_print("The buildlabel \"$dh{BUILDLABEL}\" affects: @relevant_pkgs")
+ }
+ exit 0;
+ }
my $buildsystem = load_buildsystem($opt_buildsys, $step);
if (defined $buildsystem) {
--
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