NAME
pminstalled.pl - Builds a Perl Public Module Descriptor File
SYNOPSYS
Executed in the server:
perlmodule.server$ pminstalled.pl [options] [searchpathlist] -o .ppmdf.descriptor
or executed in the client (assuming automatic SSH authentication):
client$ ssh remote.machine perl pminstalled.pl [options] [searchpathlist] > .ppmdf.descriptor
EXECUTION MODES
When executed without options produces a set of warnings (sent to STDERR) and a PPMDF description of the set of Perl modules in searchpathlist
is sent to STDOUT. If searchpathlist
is empty it defaults to the @INC
list of the Perl interpreter being used.
For each directory /some/path/
in the search list, pminstalled.pl
recursively looks for module files like
An/Interesting/Module.pm
that have a .pm
extension. The associated directory /some/path/auto/An/Intersting/Module
is also visited and all the files there will be added to the list for An::Interesting::Module
.
To save the PPMDF, redirect STDOUT to some file like in this example (along these code snippets nereida
is the client machine and orion
the Perl Public Modules Server):
pp2@nereida:$ ssh orion perl pminstalled.pl > /tmp/perl5lib/.orion.installed.modules
Duplicated module 'Test/Builder.pm':
Is in:
/usr/local/share/perl/5.8.8/Test/Builder.pm
and in:
/usr/local/share/perl/5.8.4/Test/Builder.pm
only the first will be considered.
Duplicated module 'Test/Simple.pm':
Is in:
/usr/local/share/perl/5.8.8/Test/Simple.pm
and in:
/usr/local/share/perl/5.8.4/Test/Simple.pm
only the first will be considered.
..... etc, etc.
pp2@nereida:$
If you want to make public modules that aren't in the official @INC
path, just add the corresponding -I
options to the perl interpreter executing pminstalled.pl
:
$ ssh orion perl -I/home/casiano/public_html/cpan pminstalled.pl \
> /tmp/perl5lib/.orion.plus.public.installed.modules
If we want an entirely different search path alternative to @INC
we execute pminstalled.pl
with the list of directories where to look at:
orion:$ perl pminstalled.pl /home/casiano/public_html/cpan -o /home/casiano/public_html/.orion.via.web
PERL PUBLIC MODULES DESCRIPTOR FILE (PPMDF)
A Perl Modules Descriptor File describes what Modules in the Module Server Machine will be published and what files must be downloaded for each of those modules. It is used by Remote::Use to automatically download the Perl modules need by a script being executed from a Perl Public Modules Server (See Remote::Use::Tutorial). The following example illustrates the syntax of a PPMDF file:
pp2@nereida:~/LRemoteUse/examples$ cat /tmp/perl5lib/.orion.via.web
(
'Trivial.pm' => { dir => '', files => [
'/Trivial.pm' ] },
'Tintin/Trivial.pm' => { dir => '', files => [
'/Tintin/Trivial.pm' ] },
'Parse/Eyapp.pm' => { dir => '',
files => [ '/Parse/Eyapp.pm' ],
bin => [ '/bin/eyapp', '/bin/treereg' ]
},
'Parse/Eyapp/Lalr.pm' => { dir => '', files => [
'/Parse/Eyapp/Lalr.pm' ] },
'Parse/Eyapp/YATW.pm' => { dir => '', files => [
'/Parse/Eyapp/YATW.pm' ] },
'Parse/Eyapp/Treeregexp.pm' => { dir => '', files => [
'/Parse/Eyapp/Treeregexp.pm' ] },
'Parse/Eyapp/Parse.pm' => { dir => '', files => [
'/Parse/Eyapp/Parse.pm' ] },
'Parse/Eyapp/Scope.pm' => { dir => '', files => [
'/Parse/Eyapp/Scope.pm' ] },
'Parse/Eyapp/Options.pm' => { dir => '', files => [
'/Parse/Eyapp/Options.pm' ] },
'Parse/Eyapp/Output.pm' => { dir => '', files => [
'/Parse/Eyapp/Output.pm' ] },
'Parse/Eyapp/Node.pm' => { dir => '', files => [
'/Parse/Eyapp/Node.pm' ] },
'Parse/Eyapp/Grammar.pm' => { dir => '', files => [
'/Parse/Eyapp/Grammar.pm' ] },
'Parse/Eyapp/Driver.pm' => { dir => '', files => [
'/Parse/Eyapp/Driver.pm' ] },
'Parse/Eyapp/Base.pm' => { dir => '', files => [
'/Parse/Eyapp/Base.pm' ] },
'Parse/Eyapp/_TreeregexpSupport.pm' => { dir => '', files => [
'/Parse/Eyapp/_TreeregexpSupport.pm' ] },
'Math/Prime/XS.pm' => { dir => '', files => [
'/auto/Math/Prime/XS/XS.bs',
'/auto/Math/Prime/XS/XS.so',
'/Math/Prime/XS.pm' ] },
);
The file is a Perl list. For each published module Some::Module
there is a key which is the associated file name Some/Module.pm
and a value. The value is a hash reference that must contain at least two entries: one named dir
and another named file
. The second contains the list of files to be downloaded when Some::Module
is used. The dir
entry contains the prefix path that must be removed from the path of the source file names (at the server) to produce the target file names (at the client).
'Some/Module.pm' => {
dir => '/prefix/path/',
files => [ '/auto/Some/Module/Module.so',
'/Some/Module.pm',
'/Some/Module.pod' ],
bin => [ '/some/script', /another/script' ],
man => [ '/some/man', /another/man' ],
}
For each module entry additional file families can be added as illustrates the bin
entry for Parse::Eyapp
in the former example:
'Parse/Eyapp.pm' => { dir => '',
files => [ '/Parse/Eyapp.pm' ],
bin => [ '/bin/eyapp', '/bin/treereg' ]
}
LIST OF OPTIONS
--relative path
,-r path
The consequence of using
-r path
is thatpath
will be removed from thedir
entries in the PPMDF file--log file
,-l file
Specifies the log file where warnings will be saved. For example:
pp2@nereida:$ ssh orion perl pminstalled.pl -log /tmp/dups > /tmp/perl5lib/.orion.installed.modules
--output file
,-o log
Must be followed by the name of the output file.
--pod
,--nopod
The POD files (extension
.pod
) associated with the module will be added to thefiles
entry for that module-help
SEE ALSO
See Remote::Use::Tutorial for more detailed use
DVI version of Remote::Use::Tutorial at http://nereida.deioc.ull.es/~pp2/Remote_Use/Tutorial.dvi
DVI version of pminstalled.pl at http://nereida.deioc.ull.es/~pp2/Remote_Use/pminstalled.dvi
AUTHOR
Casiano Rodriguez Leon <casiano@ull.es>
COPYRIGHT
(c) Copyright 2008 Casiano Rodriguez-Leon
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.