diff options
author | Matthew Horsfall <wolfsage@gmail.com> | 2015-06-08 11:45:04 -0400 |
---|---|---|
committer | Matthew Horsfall <wolfsage@gmail.com> | 2015-06-08 12:59:22 -0400 |
commit | c513477368008913839f704b793c43889f25e450 (patch) | |
tree | feaf6a9ce6bc7f7bfe15d5890be7f5240091411d /Porting/bisect.pl | |
parent | 3e0de0e5d9eb8d3519c1e3956d742daf071f7e21 (diff) | |
download | perl-c513477368008913839f704b793c43889f25e450.tar.gz |
bisect.pl: Allow custom CPAN::MyConfig when using --module/--with-module
Diffstat (limited to 'Porting/bisect.pl')
-rwxr-xr-x | Porting/bisect.pl | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Porting/bisect.pl b/Porting/bisect.pl index a93ba656aa..68d68d135b 100755 --- a/Porting/bisect.pl +++ b/Porting/bisect.pl @@ -17,19 +17,28 @@ my ($start, $end, $validate, $usage, $bad, $jobs, $make, $gold, $module, $with_module); my $need_cpan_config; +my $cpan_config_dir; $bad = !GetOptions('start=s' => \$start, 'end=s' => \$end, 'jobs|j=i' => \$jobs, 'make=s' => \$make, 'gold=s' => \$gold, validate => \$validate, 'usage|help|?' => \$usage, - 'module=s' => \$module, 'with-module=s' => \$with_module); + 'module=s' => \$module, 'with-module=s' => \$with_module, + 'cpan-config-dir=s' => \$cpan_config_dir); unshift @ARGV, '--help' if $bad || $usage; unshift @ARGV, '--validate' if $validate; if ($module || $with_module) { - $need_cpan_config = 1; - unshift @ARGV, '--module', $module if defined $module; unshift @ARGV, '--with-module', $with_module if defined $with_module; + + if ($cpan_config_dir) { + my $c = File::Spec->catfile($cpan_config_dir, 'CPAN', 'MyConfig.pm'); + die "--cpan-config-dir: $c does not exist\n" unless -e $c; + + unshift @ARGV, '--cpan-config-dir', $cpan_config_dir; + } else { + $need_cpan_config = 1; + } } my $runner = $0; @@ -75,7 +84,10 @@ if ($need_cpan_config) { I could not find a CPAN::MyConfig. We need to create one now so that you can bisect with --module or --with-module. I'll boot up the CPAN shell for you. Feel free to use defaults or change things as needed. +We recommend using 'manual' over 'local::lib' if it asks. + Type 'quit' when finished. + EOF system("$^X -MCPAN -e shell"); } |