summaryrefslogtreecommitdiff
path: root/scripts/Dpkg
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2018-06-16 18:33:15 +0200
committerGuillem Jover <guillem@debian.org>2018-07-24 14:51:52 +0200
commit2d02a12697808b01b360e7ceb52864c0873f7eac (patch)
treed78090d5d3ec1a60cfa77c9220d76bcc93c00061 /scripts/Dpkg
parent63e02e0aabe17cb87929037db3939b3e575e97f6 (diff)
downloaddpkg-2d02a12697808b01b360e7ceb52864c0873f7eac.tar.gz
Dpkg::Vendor::Debian: Inline _parse_feature_area() into _add_build_flags()
This function was being called on each foreach iteration to parse the options within the DEB_BUILD_MAINT_OPTIONS and DEB_BUILD_OPTIONS environment variables, and needed to parse these at construction time every time. Inlining it should make it more performant and in addition reduce line count.
Diffstat (limited to 'scripts/Dpkg')
-rw-r--r--scripts/Dpkg/Vendor/Debian.pm20
1 files changed, 7 insertions, 13 deletions
diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index 814948e83..2e42a8b86 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -86,18 +86,6 @@ sub run_hook {
}
}
-sub _parse_feature_area {
- my ($self, $area, $use_feature) = @_;
-
- require Dpkg::BuildOptions;
-
- # Adjust features based on user or maintainer's desires.
- my $opts = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_OPTIONS');
- $opts->parse_features($area, $use_feature);
- $opts = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_MAINT_OPTIONS');
- $opts->parse_features($area, $use_feature);
-}
-
sub _add_build_flags {
my ($self, $flags) = @_;
@@ -141,9 +129,15 @@ sub _add_build_flags {
## Setup
+ require Dpkg::BuildOptions;
+
# Adjust features based on user or maintainer's desires.
+ my $opts_build = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_OPTIONS');
+ my $opts_maint = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_MAINT_OPTIONS');
+
foreach my $area (sort keys %use_feature) {
- $self->_parse_feature_area($area, $use_feature{$area});
+ $opts_build->parse_features($area, $use_feature{$area});
+ $opts_maint->parse_features($area, $use_feature{$area});
}
require Dpkg::Arch;