diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-04-21 17:49:01 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-04-28 21:05:25 +0200 |
commit | ea9614b6fbf55a4b4dd1d342f09b7f96f3736310 (patch) | |
tree | 3259e9bae32705493ba22e1bb3a02762bd46f49b /t | |
parent | cec1692c8efb7afdbde9f21e90ca2fc681eccc29 (diff) | |
download | urpmi-ea9614b6fbf55a4b4dd1d342f09b7f96f3736310.tar urpmi-ea9614b6fbf55a4b4dd1d342f09b7f96f3736310.tar.gz urpmi-ea9614b6fbf55a4b4dd1d342f09b7f96f3736310.tar.bz2 urpmi-ea9614b6fbf55a4b4dd1d342f09b7f96f3736310.tar.xz urpmi-ea9614b6fbf55a4b4dd1d342f09b7f96f3736310.zip |
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
Diffstat (limited to 't')
-rw-r--r-- | t/helper.pm | 6 |
1 files changed, 6 insertions, 0 deletions
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; |