[debhelper-devel] [debhelper] 02/02: Dh_Lib: Add is_build_profile_active

Niels Thykier nthykier at moszumanska.debian.org
Tue Jun 27 17:42:18 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 a406bcde5dbef25ba24bd293855a0d3e7a305363
Author: Niels Thykier <niels at thykier.net>
Date:   Tue Jun 27 17:41:53 2017 +0000

    Dh_Lib: Add is_build_profile_active
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 Debian/Debhelper/Dh_Lib.pm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 092626d..961237c 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -1541,6 +1541,16 @@ sub get_buildoption {
 	return undef;
 }
 
+# Returns true if DEB_BUILD_PROFILES lists the given profile.
+sub is_build_profile_active {
+	my ($wanted) = @_;
+	return 0 if not exists($ENV{DEB_BUILD_PROFILES});
+	for my $prof (split(m/\s+/, $ENV{DEB_BUILD_PROFILES})) {
+		return 1 if $prof eq $wanted;
+	}
+	return 0;
+}
+
 # install a dh config file (e.g. debian/<pkg>.lintian-overrides) into
 # the package.  Under compat 9+ it may execute the file and use its
 # output instead.

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