On Thu, Jul 20, 2006 at 10:24:49PM -0500, Andy Lester wrote:
> Is there anything out there that will generate a tree of  
> dependencies, probably based on META.yml?
> 
> I figure I can pass in Mason, Test::WWW::Mechanize and Catalyst and  
> get back a list of dependencies that those require.  It would be the  
> entire tree, so like so:
> 
> Test::WWW::Mechanize
>       Test::Builder
>       WWW::Mechanize
>               LWP::UserAgent
>                       HTTP::Response
>                       HTML::Form
>               HTML::Tree
>               Blah::Blah
>       Test::LongString
>               Test::Builder
>               Blah::Blah
> 
> If it doesn't exist, I'll write it.  I just don't want to reinvent  
> the wheel.

That's exactly what Module::Dependency will (now) do.  Except that the
output is upside down since I'm using a parents and children analogy.

For example, to show one level of parent dependencies and two levels of
child dependencies for ExtUtils::MakeMaker, while only showing each
module once, you could say:

$ pmd_dump.pl -f=key -h -p=1 -c=2 -U ExtUtils::MakeMaker
        Carp
        Cwd
        Data::Dumper
        Exporter
        ExtUtils::MM
        ExtUtils::MY
        ExtUtils::MakeMaker::Config
        ExtUtils::Manifest
        File::Path
        File::Spec
        VMS::Filespec
        strict
        vars
ExtUtils::MakeMaker
        ExtUtils::Installed
                /bin/cpan/instmodsh
        ExtUtils::MM_AIX
        ExtUtils::MM_Any
                ExtUtils::MM_BeOS
                ExtUtils::MM_Cygwin
                ExtUtils::MM_DOS
                ExtUtils::MM_OS2
                ExtUtils::MM_Unix
                ExtUtils::MM_VMS
                ExtUtils::MM_Win32
        ExtUtils::MM_NW5
        ExtUtils::MM_OS2
        ExtUtils::MM_Unix
                ExtUtils::MM_QNX
                ExtUtils::MM_UWIN
                ExtUtils::MM_VOS
        ExtUtils::MM_VMS
        ExtUtils::MM_Win32
                ExtUtils::MM_Win95
        Module::Build::Compat
                Module::Build::Base

Changing the -f=key to -f=filename and removing the -h would make each
like look like:

        ExtUtils::MM_AIX filename: path/to/lib/site_perl/ExtUtils/MM_AIX.pm

See http://search.cpan.org/~timb/Module-Dependency/pmd_dump.pl

Tim.

Reply via email to