]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 445875: Make it possible to open a CPAN shell with install-module
authormkanat%bugzilla.org <>
Wed, 16 Sep 2009 09:45:27 +0000 (09:45 +0000)
committermkanat%bugzilla.org <>
Wed, 16 Sep 2009 09:45:27 +0000 (09:45 +0000)
Patch by Marcus Pallinger <mpal1+bugzilla@ieee.org> r=mkanat, a=mkanat

install-module.pl

index 9366189876ddafb0bc9736806eb0ce43eee6c861..241972211bbe39612bb6408a38910d7ea27b0409 100755 (executable)
@@ -43,7 +43,7 @@ use Pod::Usage;
 our %switch;
 
 GetOptions(\%switch, 'all|a', 'upgrade-all|u', 'show-config|s', 'global|g',
-                     'help|h');
+                     'shell', 'help|h');
 
 pod2usage({ -verbose => 1 }) if $switch{'help'};
 
@@ -58,8 +58,8 @@ pod2usage({ -verbose => 0 }) if (!%switch && !@ARGV);
 set_cpan_config($switch{'global'});
 
 if ($switch{'show-config'}) {
-  print Dumper($CPAN::Config);
-  exit;
+    print Dumper($CPAN::Config);
+    exit;
 }
 
 my $can_notest = 1;
@@ -69,6 +69,11 @@ if (substr(CPAN->VERSION, 0, 3) < 1.8) {
     print "* You can upgrade CPAN by doing: $^X install-module.pl CPAN\n";
 }
 
+if ($switch{'shell'}) {
+    CPAN::shell();
+    exit;
+}
+
 if ($switch{'all'} || $switch{'upgrade-all'}) {
     my @modules;
     if ($switch{'upgrade-all'}) {
@@ -114,6 +119,7 @@ This script does not run on Windows.
   ./install-module.pl --all [--global]
   ./install-module.pl --upgrade-all [--global]
   ./install-module.pl --show-config
+  ./install-module.pl --shell
 
   Do "./install-module.pl --help" for more information.
 
@@ -154,6 +160,10 @@ have them installed.
 
 Prints out the CPAN configuration in raw Perl format. Useful for debugging.
 
+=item B<--shell>
+
+Starts a CPAN shell using the configuration of F<install-module.pl>.
+
 =item B<--help>
 
 Shows this help.