[top first posting reordered]

On Fri, 14 Mar 2008 12:27:17 +0100, eMko wrote:
> Andrew Wan wrote:
>> I've got a list of CPAN modules that I want to install, over the 
>> internet.
>> 
>> From experience, I just type cpan, then: install HTML::Clean
>> (press RETURN for dependency prompts) install HTML::ContentExtractor
>> (press RETURN for dependency prompts) install HTML::Diff
>> (press RETURN for dependency prompts) ...
>> 
>> 
>> Is there a batch way I can install my packages? So I can repeat the
>> installation at another PC with just one command-line?

> Hello. This command
> 
> perl -MCPAN -e"install Wx, Tie::File, Tie::Hash"
> 
> works well. It is only for instance, because Wx I have installed (and
> using) and either Tie::File or Tie::Hash comes with Perl.
> 
> To all intents and purposes, this is not a batch installation because
> you have to press enter if Perl asks you if it should resolve
> dependencies etc. If you want a real batch-install, I think the best way
> is to download the module archives (and its dependencies) and write a
> shell (or Perl ;-) ) script that -unpack this archives -in every archive
> runs "perl Makefile.PL", "make", "make check" and "make install".

There is no make check target in the standard Makefile.  You mean "make
test".

You can eliminate the asking about installing dependencies with a CPAN.pm
configuration parameter.  It was one of the questions when you first ran
cpan:

The CPAN module can detect when a module which you are trying to build
depends on prerequisites. If this happens, it can build the
prerequisites for you automatically ('follow'), ask you for
confirmation ('ask'), or just ignore them ('ignore'). Please set your
policy to one of the three values.

You can set it now to build prerequisites automatically with 

  o conf prerequisites_policy follow

You can eliminate additional questions with 

  o conf build_requires_install_policy yes

However you cannot stop modules from asking questions during their
Makefile.PL or Build.PL if they want.

To install many modules with a single command, use a bundle:

http://search.cpan.org/~andk/CPAN-1.9205/lib/CPAN.pm#Bundles

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to