]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 655912: install-module.pl is unable to install LWP::UserAgent on Perl <5.8.8...
authorFrédéric Buclin <LpSolit@gmail.com>
Sun, 31 Jul 2011 11:56:13 +0000 (13:56 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Sun, 31 Jul 2011 11:56:13 +0000 (13:56 +0200)
r/a=mkanat

Bugzilla/Install/CPAN.pm

index 74b87ae4c6b710612a835247730ef5de9c41774a..b1f3133c394a56e51a59e910ed3ab2179510567c 100644 (file)
@@ -164,8 +164,20 @@ sub install_module {
     if (!$module) {
         die install_string('no_such_module', { module => $name }) . "\n";
     }
+    my $version = $module->cpan_version;
+    my $module_name = $name;
+
+    if ($name eq 'LWP::UserAgent' && $^V lt v5.8.8) {
+        # LWP 6.x requires Perl 5.8.8 or newer.
+        # As PAUSE only indexes the very last version of each module,
+        # we have to specify the path to the tarball ourselves.
+        $name = 'GAAS/libwww-perl-5.837.tar.gz';
+        # This tarball contains LWP::UserAgent 5.835.
+        $version = '5.835';
+    }
+
     print install_string('install_module', 
-              { module => $name, version => $module->cpan_version }) . "\n";
+              { module => $module_name, version => $version }) . "\n";
 
     if (_always_test($name)) {
         CPAN::Shell->install($name);