diabelek has asked for the wisdom of the Perl Monks concerning the following question:
Is there a way to prevent CPAN/modules from asking question or auto answering them when installing them. I have the script at the bottom of this post that works great for most modules but there are some modules or CPAN that ask questions during an install, don't time out and don't have an obvious way of overriding it. The current problem I have might be CPAN (not 100% positive). I get "Do you want to install lwp-request? y" for libwww-perl-5.812. It never times out and isn't auto answered by the build_requires_install_policy
Any ideas?
-------require CPAN; require CPAN::Config; # configure cpan to go to pyro $CPAN::Config->{urllist} = [ q[http://server/cpan] ]; $CPAN::Config->{http_proxy} = q[]; $CPAN::Config->{ftp_proxy} = q[]; $CPAN::Config->{build_requires_install_policy} = q[yes]; $CPAN::Config->{prerequisites_policy} = q[follow]; # now get the modules from the config appropriate file my @packages = []; my @ppm_packages = []; my $common_package_file; my $os_package_file; my $ppm_package_file; if( $^O eq "MSWin32" ) { open( $common_package_file, 'p:\automation\commoncpan.txt' ) or die( "Unable to open common package file\n" ); open( $os_package_file, 'p:\automation\windowscpan.txt' ) or die( "Unable to open windows package file\n" ); open( $ppm_package_file, 'p:\automation\windowsppm.txt' ) or die( "Unable to open windows ppm package file\n" ); } elsif( $^O eq "linux" ) { open( $common_package_file, '/srv/automation/commoncpan.txt' ) or die( "Unable to open common package file\n" ); open( $os_package_file, '/srv/automation/linuxcpan.txt' ) or die( "Unable to open linux package file\n" ); } else { die( "ERROR: Unsupported OS\n" ); } @packages = <$common_package_file>; my $package; while( ($package = <$os_package_file>) ) { #just add the packages to the end of the array push( @packages, $package ); } @ppm_packages = <$ppm_package_file>; close( $common_package_file ); close( $os_package_file ); close( $ppm_package_file ); foreach my $line (@packages) { chomp( $line ); print( CPAN::install( $line ) ); } foreach my $line (@ppm_packages) { chomp( $line ); $ENV{http_proxy} = 'proxy'; print( `ppm install $line` ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CPAN Modules asking questions
by Corion (Patriarch) on May 02, 2008 at 15:58 UTC | |
by Herkum (Parson) on May 02, 2008 at 18:38 UTC | |
|
Re: CPAN Modules asking questions
by stiller (Friar) on May 02, 2008 at 16:05 UTC | |
by Anonymous Monk on May 07, 2008 at 20:38 UTC | |
|
Re: CPAN Modules asking questions
by Ultra (Hermit) on May 19, 2008 at 13:58 UTC |