From 7b057660716a5798b0d2b1e7ad8708db836b5d20 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 27 Apr 2007 17:07:11 +0000 Subject: [PATCH] Added option to disable APT and YUM module installs --- cpan/CHANGELOG | 2 ++ cpan/config | 1 + cpan/config-solaris | 1 + cpan/config.info | 1 + cpan/download.cgi | 10 ++++++---- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cpan/CHANGELOG b/cpan/CHANGELOG index fafb9f0b8..cdc1ef510 100644 --- a/cpan/CHANGELOG +++ b/cpan/CHANGELOG @@ -14,3 +14,5 @@ Perl modules that try to auto-install depencies from CPAN no longer hang during Fixed a bug that prevented a custom temp files directory from being used when installing Perl modules. ---- Changes since 1.330 ---- When installing a Perl module from CPAN and it already exists in an operating system package (such as from APT or YUM), use that instead. +---- Changes since 1.340 ---- +Added Module Config option to not install modules from APT or YUM. diff --git a/cpan/config b/cpan/config index 68b98dd22..bf491dfd8 100644 --- a/cpan/config +++ b/cpan/config @@ -3,3 +3,4 @@ cpan=http://www.cpan.org/authors/id refresh_days=30 save_partial=0 incpackages=1 +incyum=1 diff --git a/cpan/config-solaris b/cpan/config-solaris index 0817951e0..517219ad1 100644 --- a/cpan/config-solaris +++ b/cpan/config-solaris @@ -4,3 +4,4 @@ refresh_days=30 save_partial=0 def_args='OPTIMIZE= ' 'CCFLAGS= ' 'CCCDLFLAGS= ' incpackages=1 +incyum=1 diff --git a/cpan/config.info b/cpan/config.info index aba98c0fa..637f99ebf 100644 --- a/cpan/config.info +++ b/cpan/config.info @@ -3,6 +3,7 @@ refresh_days=Days before refreshing CPAN module list,0,5 save_partial=Keep downloaded module if install fails?,1,1-Yes,0-No def_args=Default arguments to Makefile.PL,0 incpackages=Include Perl modules from software packages?,1,1-Yes,0-No +incyum=Install Perl modules from YUM or APT where available?,1,1-Yes,0-No line2=System configuration,11 packages=CPAN perl modules list,0 cpan=CPAN modules base URL,0 diff --git a/cpan/download.cgi b/cpan/download.cgi index afe198015..5a4e01592 100755 --- a/cpan/download.cgi +++ b/cpan/download.cgi @@ -68,10 +68,12 @@ elsif ($in{'source'} == 3) { @cpan = split(/\s+|\0/, $in{'cpan'}); # First check if YUM or APT can install this module for us - @yum = &list_packaged_modules(); - foreach $c (@cpan) { - ($yum) = grep { lc($_->{'mod'}) eq lc($c) } @yum; - push(@cpanyum, $yum) if ($yum); + if ($config{'incyum'}) { + @yum = &list_packaged_modules(); + foreach $c (@cpan) { + ($yum) = grep { lc($_->{'mod'}) eq lc($c) } @yum; + push(@cpanyum, $yum) if ($yum); + } } if (scalar(@cpan) == scalar(@cpanyum)) { # Can install from YUM or APT .. do it!