This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch master in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=4c6d0e7159a192e82c43cb8ee68cb091cbce301a commit 4c6d0e7159a192e82c43cb8ee68cb091cbce301a Author: Guillem Jover <[email protected]> AuthorDate: Wed Oct 10 00:05:31 2018 +0200 build: Set environment variables only for CPAN tests All these environment variables are only relevant while running the test suite. Do not pollute the rest of the environment. --- debian/changelog | 1 + scripts/Build.PL.in | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index dcf7ca2e4..0773799db 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,7 @@ dpkg (1.19.3) UNRELEASED; urgency=medium - run-script: Remove unused PERL_PROFILE variable, PERL5OPT can be used instead, and does not require leaving an unquoted variable around. - run-script: Add «set -e». + - Build.PL: Set environment variables only for CPAN tests. [ Updated programs translations ] * German (Sven Joachim). diff --git a/scripts/Build.PL.in b/scripts/Build.PL.in index 376c04ceb..6418d0d36 100644 --- a/scripts/Build.PL.in +++ b/scripts/Build.PL.in @@ -17,12 +17,6 @@ if (-e 'Build.PL.in') { my $class = Module::Build->subclass( class => 'Module::Build::Dpkg', code => q{ - BEGIN { - $ENV{DPKG_TEST_MODE} = 'cpan'; - $ENV{DPKG_DATADIR} = 'data'; - $ENV{DPKG_ORIGINS_DIR} = 't/origins'; - } - sub subst { my ($self, $file) = @_; my $path = $self->install_path(); @@ -52,6 +46,14 @@ my $class = Module::Build->subclass( $self->SUPER::ACTION_build; $self->subst('lib/Dpkg.pm'); } + sub ACTION_test { + my $self = shift; + + local $ENV{DPKG_TEST_MODE} = 'cpan'; + local $ENV{DPKG_DATADIR} = 'data'; + local $ENV{DPKG_ORIGINS_DIR} = 't/origins'; + $self->SUPER::ACTION_test; + } }, ); -- Dpkg.Org's dpkg

