summaryrefslogtreecommitdiff
path: root/scripts/Build.PL.in
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2018-10-10 00:05:31 +0200
committerGuillem Jover <guillem@debian.org>2018-10-10 01:13:00 +0200
commit4c6d0e7159a192e82c43cb8ee68cb091cbce301a (patch)
tree7aae29ab08945862fe7cb483dce732af1538f8d9 /scripts/Build.PL.in
parent0d95bee7b934e7e9ea8ad991113e116c2b16c8be (diff)
downloaddpkg-4c6d0e7159a192e82c43cb8ee68cb091cbce301a.tar.gz
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.
Diffstat (limited to 'scripts/Build.PL.in')
-rw-r--r--scripts/Build.PL.in14
1 files changed, 8 insertions, 6 deletions
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;
+ }
},
);