Package: libmodule-build-perl / 0.421000-2+deb8u1

0001-Allow-loading-from-system-path-when-running-under-au.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 5a72ba915915cc44d7651f185fc2f0a3e7acfecd Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Fri, 19 Sep 2014 00:00:51 +0300
Subject: [PATCH] Allow loading from system path when running under autopkgtest

When re-using the build time test suite as a runtime as-installed one,
we explicitly want to load Module::Build from the system paths. This
situation is detected by the ADTTMP environment variable, set by the
autopkgtest tool. See http://dep.debian.net/deps/dep8/

Rewiring check_compiler() to return early is to avoid a call
to M::B->current(), which needs a 'build_params' file remaining
from its own build.

Forwarded: not-needed
---
 t/lib/MBTest.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/lib/MBTest.pm b/t/lib/MBTest.pm
index fda7f69..86c6d1f 100644
--- a/t/lib/MBTest.pm
+++ b/t/lib/MBTest.pm
@@ -220,7 +220,7 @@ sub find_in_path {
 }
 
 sub check_compiler {
-  if ($ENV{PERL_CORE}) {
+  if ($ENV{PERL_CORE} || $ENV{ADTTMP}) {
     require IPC::Cmd;
     if ( $Config{usecrosscompile} && !IPC::Cmd::can_run($Config{cc}) ) {
       return;
@@ -271,7 +271,7 @@ sub blib_load {
   (my $path = $mod) =~ s{::}{/}g;
   $path .= ".pm";
   my ($pkg, $file, $line) = caller;
-  unless($ENV{PERL_CORE}) {
+  unless($ENV{PERL_CORE} || $ENV{ADTTMP}) {
     unless($INC{$path} =~ m/\bblib\b/) {
       (my $load_from = $INC{$path}) =~ s{$path$}{};
       die "$mod loaded from '$load_from'\nIt should have been loaded from blib.  \@INC contains:\n  ",
-- 
2.1.0