diff options
author | Niels Thykier <niels@thykier.net> | 2017-06-27 17:41:53 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2017-06-27 17:41:53 +0000 |
commit | a406bcde5dbef25ba24bd293855a0d3e7a305363 (patch) | |
tree | 8cc18227593897eb05ad651f6bd6981a1011c734 /Debian | |
parent | 9a61f6a8a30980e3f47704e702fce8c5a26a79d5 (diff) | |
download | debhelper-a406bcde5dbef25ba24bd293855a0d3e7a305363.tar.gz |
Dh_Lib: Add is_build_profile_active
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'Debian')
-rw-r--r-- | Debian/Debhelper/Dh_Lib.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm index 092626df..961237c7 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. |