diff options
author | Guillem Jover <guillem@debian.org> | 2016-12-20 11:05:39 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2017-01-26 23:26:33 +0100 |
commit | feab90e61d0cdaf113a8c233cc584f3125f85924 (patch) | |
tree | 7b16bee99dce4aec1b5cd15fe7fca90d85d6cbf4 /scripts/dpkg-genbuildinfo.pl | |
parent | dad593660d922abce634542b43e9d56b03228a8c (diff) | |
download | dpkg-feab90e61d0cdaf113a8c233cc584f3125f85924.tar.gz |
dpkg-genbuildinfo: Add initial support for DEB_BUILD_OPTIONS
This will make it possible to enable or disable specific features that
should be recorded in the .buildinfo file. For now only “all” and “path”
are supported.
Closes: #848705
Diffstat (limited to 'scripts/dpkg-genbuildinfo.pl')
-rwxr-xr-x | scripts/dpkg-genbuildinfo.pl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/dpkg-genbuildinfo.pl b/scripts/dpkg-genbuildinfo.pl index 09bcc139b..57f881e5c 100755 --- a/scripts/dpkg-genbuildinfo.pl +++ b/scripts/dpkg-genbuildinfo.pl @@ -36,6 +36,7 @@ use Dpkg::ErrorHandling; use Dpkg::Arch qw(get_build_arch get_host_arch); use Dpkg::Build::Types; use Dpkg::Build::Info qw(get_build_env_whitelist); +use Dpkg::BuildOptions; use Dpkg::BuildFlags; use Dpkg::BuildProfiles qw(get_build_profiles); use Dpkg::Control::Info; @@ -59,7 +60,9 @@ my $uploadfilesdir = '..'; my $outputfile; my $stdout = 0; my $admindir = $Dpkg::ADMINDIR; -my $always_include_path = 0; +my %use_feature = ( + path => 0, +); my @build_profiles = get_build_profiles(); my $buildinfo_format = '0.2'; my $buildinfo; @@ -295,6 +298,9 @@ sub usage { "), $Dpkg::PROGNAME; } +my $build_opts = Dpkg::BuildOptions->new(); +$build_opts->parse_features('buildinfo', \%use_feature); + while (@ARGV) { $_ = shift @ARGV ; if (m/^--build=(.*)$/) { @@ -317,7 +323,7 @@ while (@ARGV) { # Deprecated option warning('--buildinfo-id is deprecated, it is without effect'); } elsif (m/^--always-include-path$/) { - $always_include_path = 1; + $use_feature{path} = 1; } elsif (m/^--admindir=(.*)$/) { $admindir = $1; } elsif (m/^-(?:\?|-help)$/) { @@ -407,7 +413,7 @@ $fields->{'Build-Architecture'} = get_build_arch(); $fields->{'Build-Date'} = get_build_date(); my $cwd = cwd(); -if ($always_include_path) { +if ($use_feature{path}) { $fields->{'Build-Path'} = $cwd; } else { # Only include the build path if its root path is considered acceptable |