Permalink
Browse files

Shared doco between cpandeps and lib/CPAN/FindDependencies.pm

  • Loading branch information...
DrHyde committed May 21, 2009
1 parent b76592a commit 0df4b22fb1e50607ac064a0a68353cb76bac6fed
Showing with 90 additions and 53 deletions.
  1. +3 −0 MANIFEST
  2. +27 −0 Makefile.PL
  3. +12 −6 examples/cpandeps
  4. +1 −47 lib/CPAN/FindDependencies.pm
  5. +47 −0 shared/parameters
View
@@ -36,3 +36,6 @@ t/cache/CPAN-FindDependencies-1.1/HTML-Parser-3.60.yml
t/cache/Tie-Scalar-Decay-1.1.1-malicious/02packages.details.txt.gz
t/cache/Tie-Scalar-Decay-1.1.1-malicious/Tie-Scalar-Decay-1.1.1.MakefilePL
t/cache/Tie-Scalar-Decay-1.1.1-malicious/Time-HiRes-1.9719.yml
shared/parameters
ARTISTIC.txt
GPL2.txt
View
@@ -1,5 +1,8 @@
# $Id: Makefile.PL,v 1.11 2007/12/13 15:16:03 drhyde Exp $
use ExtUtils::MakeMaker;
use Config;
use lib::CPAN::FindDependencies;
WriteMakefile(
NAME => 'CPAN::FindDependencies',
@@ -18,6 +21,30 @@ WriteMakefile(
'File::Temp' => 0.19,
'Capture::Tiny' => 0.05,
'Devel::CheckOS' => 1.52,
},
dist => {
PREOP => join(' ', split(/[\n\r]+/, qq[
$Config{perlpath} -e '
undef \$\$/;
foreach my \$\$file (map { "CPAN-FindDependencies-$CPAN::FindDependencies::VERSION/".\$\$_ } qw(\$(EXE_FILES) \$(TO_INST_PM))) {
my \$\$contents = <FOO>;
close(FOO);
\$\$contents =~ s/\\#include (.*)/
print "Including \$\$1\\n";
open(FOO, \$\$1);
\$\$include = <FOO>;
close(FOO);
\$\$include;
/ge;
\\# open(FOO, ">\$\$file");
\\# print FOO \$\$contents;
\\# close(FOO);
print \$\$contents;
}
'
]))
}
);
View
@@ -27,20 +27,26 @@ cpandeps - show a module on the CPAN's dependency tree.
This program is a simple wrapper around CPAN::FindDependencies.
=head1 SYNOPSIS
cpandeps CPAN::FindDependencies
cpandeps CPAN::FindDependencies perl 5.8.8 cachedir ../foo/bar
Given a module name, this program will show you the module's
dependency tree. It takes exactly the same arguments as the
C<finddeps> function of CPAN::FindDependencies, with the exception
that C<nowarnings> is turned *on* by default.
It shows the module name, its distribution, and if any warnings were
raised (such as if a module's dependencies couldn't be fetched) this
is indicated with an asterisk before the module's name.
=over
=head1 SYNOPSIS
#include shared/parameters
cpandeps CPAN::FindDependencies
=back
cpandeps CPAN::FindDependencies perl 5.8.8 cachedir ../foo/bar
It shows the module name, its distribution, and if any warnings were
raised (such as if a module's dependencies couldn't be fetched) this
is indicated with an asterisk before the module's name.
=head1 WARNINGS, BUGS and FEEDBACK
@@ -55,53 +55,7 @@ named parameters:
=over
=item nowarnings
Warnings about modules where we can't find their META.yml or Makefile.PL, and
so can't divine their pre-requisites, will be suppressed;
=item fatalerrors
Failure to get a module's dependencies will be a fatal error
instead of merely emitting a warning;
=item perl
Use this version of perl to figure out what's in core. If not
specified, it defaults to 5.005. Three part version numbers
(eg 5.8.8) are supported but discouraged.
=item 02packages
The location of CPAN.pm's C<02packages.details.txt.gz> file as a
local filename, with either a relative or an absolute path. If not
specified, it is fetched from a CPAN mirror instead. The file is
fetched just once.
=item cachedir
A directory to use for caching. It defaults to no caching. Even if
caching is turned on, this is only for META.yml or Makefile.PL files.
02packages is not cached - if you want to read that from a local disk, see the
C<02packages> option.
=item maxdepth
Cuts off the dependency tree at the specified depth. Your specified
module is at depth 0, your dependencies at depth 1, their dependencies
at depth 2, and so on.
=item usemakefilepl
If set to true, then for any module that doesn't have a META.yml,
try to use its Makefile.PL as well. Note that this involves
downloading code from the Internet and running it. This obviously
opens you up to all kinds of bad juju, hence why it is disabled
by default.
=item recommended
Adds recommended modules to the list of dependencies, if set to a true value.
#include shared/parameters
=back
View
@@ -0,0 +1,47 @@
=item nowarnings
Warnings about modules where we can't find their META.yml or Makefile.PL, and
so can't divine their pre-requisites, will be suppressed;
=item fatalerrors
Failure to get a module's dependencies will be a fatal error
instead of merely emitting a warning;
=item perl
Use this version of perl to figure out what's in core. If not
specified, it defaults to 5.005. Three part version numbers
(eg 5.8.8) are supported but discouraged.
=item 02packages
The location of CPAN.pm's C<02packages.details.txt.gz> file as a
local filename, with either a relative or an absolute path. If not
specified, it is fetched from a CPAN mirror instead. The file is
fetched just once.
=item cachedir
A directory to use for caching. It defaults to no caching. Even if
caching is turned on, this is only for META.yml or Makefile.PL files.
02packages is not cached - if you want to read that from a local disk, see the
C<02packages> option.
=item maxdepth
Cuts off the dependency tree at the specified depth. Your specified
module is at depth 0, your dependencies at depth 1, their dependencies
at depth 2, and so on.
=item usemakefilepl
If set to true, then for any module that doesn't have a META.yml,
try to use its Makefile.PL as well. Note that this involves
downloading code from the Internet and running it. This obviously
opens you up to all kinds of bad juju, hence why it is disabled
by default.
=item recommended
Adds recommended modules to the list of dependencies, if set to a true value.

0 comments on commit 0df4b22

Please sign in to comment.