summaryrefslogtreecommitdiff
path: root/Porting
diff options
context:
space:
mode:
authorMatthew Horsfall <wolfsage@gmail.com>2015-06-08 11:45:04 -0400
committerMatthew Horsfall <wolfsage@gmail.com>2015-06-08 12:59:22 -0400
commitc513477368008913839f704b793c43889f25e450 (patch)
treefeaf6a9ce6bc7f7bfe15d5890be7f5240091411d /Porting
parent3e0de0e5d9eb8d3519c1e3956d742daf071f7e21 (diff)
downloadperl-c513477368008913839f704b793c43889f25e450.tar.gz
bisect.pl: Allow custom CPAN::MyConfig when using --module/--with-module
Diffstat (limited to 'Porting')
-rwxr-xr-xPorting/bisect-runner.pl28
-rwxr-xr-xPorting/bisect.pl18
2 files changed, 38 insertions, 8 deletions
diff --git a/Porting/bisect-runner.pl b/Porting/bisect-runner.pl
index b1a501fc81..a8bae1149a 100755
--- a/Porting/bisect-runner.pl
+++ b/Porting/bisect-runner.pl
@@ -66,7 +66,7 @@ unless(GetOptions(\%options,
'test-build', 'validate',
'all-fixups', 'early-fixup=s@', 'late-fixup=s@', 'valgrind',
'check-args', 'check-shebang!', 'usage|help|?', 'gold=s',
- 'module=s', 'with-module=s',
+ 'module=s', 'with-module=s', 'cpan-config-dir=s',
'A=s@',
'D=s@' => sub {
my (undef, $val) = @_;
@@ -167,6 +167,8 @@ bisect.pl - use git bisect to pinpoint changes
.../Porting/bisect.pl --module=autobox,Moose
# When did this code stop working in blead with these modules?
.../Porting/bisect.pl --with-module=Moose,Moo -e 'use Moose; 1;'
+ # Like the above 2 but with custom CPAN::MyConfig
+ .../Porting/bisect.pl --module=Moo --cpan-config-dir=/home/blah/custom/
=head1 DESCRIPTION
@@ -559,11 +561,12 @@ MSCHWERN/Test-Simple-1.005000_005.tar.gz.
In so far, it is not such a misnomer.
-Note that this and B<--with-module> will both require a CPAN::MyConfig.
+Note that this and L<--with-module> will both require a CPAN::MyConfig.
If F</home/.cpan/CPAN/MyConfig.pm> does not exist, a CPAN shell will
be started up for you so you can configure one. Feel free to let
CPAN pick defaults for you. Enter 'quit' when you are done, and
-then everything should be all set.
+then everything should be all set. Alternatively, you may
+specify a custom L<CPAN::MyConfig> by using L<--cpan-config-dir>.
Also, if you want to bisect a module that needs a display (like
TK) and you don't want random screens appearing and disappearing
@@ -585,7 +588,7 @@ And then:
--with-module module1,module2,...
-Like B<--module> above, except this simply installs the requested
+Like L<--module> above, except this simply installs the requested
modules and they can then be used in other tests.
For example:
@@ -594,6 +597,20 @@ For example:
=item *
+--cpan-config-dir /home/blah/custom
+
+If defined, this will cause L<CPAN> to look for F<CPAN/MyConfig.pm> inside of
+the specified directory, instead of using the default config of
+F<$ENV{HOME}/.cpan/>.
+
+If no default config exists, a L<CPAN> shell will be fired up for you to
+configure things. Letting L<CPAN> automatically configure things for you
+should work well enough. You probably want to choose I<manual> instead of
+I<local::lib> if it asks. When you're finished with configuration, just
+type I<q> and hit I<ENTER> and the bisect should continue.
+
+=item *
+
--force-manifest
By default, a build will "skip" if any files listed in F<MANIFEST> are not
@@ -1466,7 +1483,8 @@ if ($options{module} || $options{'with-module'}) {
# Make sure we load up our CPAN::MyConfig and then
# override the build_dir so we have a fresh one
# every build
- my $cdir = File::Spec->catfile($ENV{HOME},".cpan");
+ my $cdir = $options{'cpan-config-dir'}
+ || File::Spec->catfile($ENV{HOME},".cpan");
my @cpanshell = (
"$prefix/bin/perl",
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");
}