From ea9614b6fbf55a4b4dd1d342f09b7f96f3736310 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 21 Apr 2020 17:49:01 +0200 Subject: try harder to find genhdlist2 on CPAN testers rationale: in some cases, all dependency modules and scripts still reside in the uninstalled blib directories. CPAN.pm knows how to deal with uninstalled modules (all the blib/lib directories go into the PERL5LIB environment variable). But it does not do something similar for the blib/script directories. So we have to try harder to find genhdlist2 by adding those blib/script directories to PATH if they exist --- t/helper.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 't') diff --git a/t/helper.pm b/t/helper.pm index 451311d9..55dc8f81 100644 --- a/t/helper.pm +++ b/t/helper.pm @@ -18,6 +18,12 @@ our @EXPORT = qw(need_root_and_prepare need_downloader sub set_path() { # help CPAN testers who installed genhdlist2 using cpan but do not have /usr/local/bin in their PATH: $ENV{PATH} .= ":/usr/local/bin"; + + # help when CPAN testers have not genhdlist2 installed but do have built rpmtools: + $ENV{PATH} .= join(':', uniq(map { + my $blib_script = dirname($_) . "/script"; + -d $blib_script ? $blib_script : (); + } split(':', $ENV{PERL5LIB}))); } my $using_root; -- cgit v1.2.1