[debhelper-devel] [debhelper] 01/01: dh, dh_auto_*: Add NOOP promises

Niels Thykier nthykier at moszumanska.debian.org
Sat Oct 28 13:34:33 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 52bf7ef7e0bb51ec088b8016109bb8751060906e
Author: Niels Thykier <niels at thykier.net>
Date:   Sun Jul 23 12:35:38 2017 +0000

    dh,dh_auto_*: Add NOOP promises
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog  | 6 ++++++
 dh                | 9 +++++++++
 dh_auto_build     | 2 ++
 dh_auto_clean     | 2 ++
 dh_auto_configure | 2 ++
 dh_auto_install   | 2 ++
 dh_auto_test      | 2 ++
 7 files changed, 25 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 1ca4227..44eca59 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,13 +1,19 @@
 debhelper (10.10.6) UNRELEASED; urgency=medium
 
+  [ Axel Beckert ]
   * Cleanup trailing whitespace in ancient debian/changelog entries and
     debian/rules.
   * Fix typo "belive" in debian/copyright and ancient debian/changelog
     entries.
   * Use HTTPS in debian/copyright format URL.
+
+  [ Niels Thykier ]
   * Remove support for named compat levels.
   * dh_perl: Make dh_perl faster on packages with large doc
     directories by pruning the entire doc directory.
+  * dh,dh_auto_*: Support skipping all of the dh_auto_* helpers if the
+    package does not seem to have a build system (and there are no build
+    system related options passed to dh).
 
  -- Axel Beckert <abe at debian.org>  Fri, 27 Oct 2017 23:48:44 +0200
 
diff --git a/dh b/dh
index f94b0ae..d492f28 100755
--- a/dh
+++ b/dh
@@ -582,6 +582,7 @@ my @packages=@{$dh{DOPACKAGES}};
 # Filter out options intended only for this program.
 my @options;
 my $user_specified_options=0;
+my $build_system_options = 0;
 if ($sequence eq 'build-arch' ||
     $sequence eq 'install-arch' ||
     $sequence eq 'binary-arch') {
@@ -623,6 +624,7 @@ while (@ARGV_orig) {
 			next if $max_parallel == 1;
 		}
 		push @options, "-O".$opt;
+		$build_system_options = 1 if $opt ne '--no-parallel' and $opt ne '--parallel';
 		$user_specified_options=1
 			unless $opt =~ /^--((?:no-)?parallel|buildsystem|sourcedirectory|builddirectory|)/;
 	}
@@ -1071,6 +1073,13 @@ sub can_skip {
 				}
 				# Use the secret bulk check call
 				return 0 if pkgfile($pkgs, $need) ne '';
+			} elsif ($type eq 'buildsystem') {
+				# If there are any buildsystem options, we assume that
+				# the build needs a buildsystem.
+				return 0 if $build_system_options;
+				require Debian::Debhelper::Dh_Buildsystems;
+				my $system = Debian::Debhelper::Dh_Buildsystems::load_buildsystem(undef, $need);
+				return 0 if defined($system);
 			} else {
 				# Unknown hint - make no assumptions
 				return 0;
diff --git a/dh_auto_build b/dh_auto_build
index c189a21..a52ef98 100755
--- a/dh_auto_build
+++ b/dh_auto_build
@@ -45,6 +45,8 @@ B<dh_auto_build> usually passes.
 
 =cut
 
+# PROMISE: DH NOOP WITHOUT buildsystem(build)
+
 buildsystems_init();
 buildsystems_do();
 
diff --git a/dh_auto_clean b/dh_auto_clean
index e71448e..60f32ce 100755
--- a/dh_auto_clean
+++ b/dh_auto_clean
@@ -46,6 +46,8 @@ B<dh_auto_clean> usually passes.
 
 =cut
 
+# PROMISE: DH NOOP WITHOUT buildsystem(clean)
+
 inhibit_log();
 buildsystems_init();
 buildsystems_do();
diff --git a/dh_auto_configure b/dh_auto_configure
index 4bd1b36..9e10a16 100755
--- a/dh_auto_configure
+++ b/dh_auto_configure
@@ -50,6 +50,8 @@ B<dh_auto_configure> usually passes. For example:
 
 =cut
 
+# PROMISE: DH NOOP WITHOUT buildsystem(configure)
+
 buildsystems_init();
 buildsystems_do();
 
diff --git a/dh_auto_install b/dh_auto_install
index 6b34eb1..7080cc6 100755
--- a/dh_auto_install
+++ b/dh_auto_install
@@ -71,6 +71,8 @@ buildsystems_init(options => {
 	"destdir=s" => \$destdir,
 });
 
+# PROMISE: DH NOOP WITHOUT buildsystem(install)
+
 # If destdir is not specified, determine it automatically
 if (!$destdir) {
 	my @allpackages=getpackages();
diff --git a/dh_auto_test b/dh_auto_test
index a64bb2d..a59bc5d 100755
--- a/dh_auto_test
+++ b/dh_auto_test
@@ -52,6 +52,8 @@ tests will be performed.
 
 =cut
 
+# PROMISE: DH NOOP WITHOUT buildsystem(test)
+
 if (get_buildoption("nocheck")) {
 	exit 0;
 }

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