Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Which modules on the whole CPAN depends on this module?

by sedusedan (Pilgrim)
on Jul 05, 2013 at 06:18 UTC ( [id://1042611]=perlquestion: print w/replies, xml ) Need Help??

sedusedan has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone have a script/module for finding the direct and indirect reverse dependencies of a module? For example, the recent Perl 5.18 broke Regexp::Grammars (which affected at least two of my modules since 1 depends on RG, and the other depends on the first one). I would like to know how many modules will now fail to build on 5.18+ because of RG, that is to say which modules depend directly/indirectly on RG.

Sorta like http://deps.cpantesters.org/ in reverse.

  • Comment on Which modules on the whole CPAN depends on this module?

Replies are listed 'Best First'.
Re: Which modules on the whole CPAN depends on this module?
by davido (Cardinal) on Jul 05, 2013 at 07:26 UTC
      I used RG as an example, but that's good to hear!
Re: Which modules on the whole CPAN depends on this module?
by Corion (Patriarch) on Jul 05, 2013 at 07:20 UTC
      As davido also pointed out, only immediate reverse dependencies are currently shown by deps.cpantesters.org as well as MetaCPAN. Recursively querying MetaCPAN API should be straightforward, albeit rather inefficient.
        Patches welcome to make it recurse. Also to make it spew out XML.
Re: Which modules on the whole CPAN depends on this module?
by ambrus (Abbot) on Jul 05, 2013 at 07:46 UTC

    You can use rsync to keep a local mirror of the module metafiles only from a CPAN mirror. This takes much less disk space than mirroring the whole CPAN, and if you've downloaded them once you can use rsync to keep it up to date while transferring only the new files on the net. A command like rsync -Rvz "cpan.some.mirror.com::CPAN/modules/by-authors/id/?/??/./*/*.meta" "cpan.some.mirror.com::CPAN/modules/02packages.details.txt" /path/to/local/mirror should work if you change the url to a CPAN mirror close to you.

    Once you've got the metafiles and the 02packages.details.txt, you can parse them and search in them. The metafiles contain the dependenct modules of each distribution, and the 02packages.details.txt tells which distributions provide which modules.

Re: Which modules on the whole CPAN depends on this module?
by sedusedan (Pilgrim) on Sep 12, 2013 at 19:17 UTC

    Just an update. I've written list-rev-deps (on CPAN (1)) which uses MetaCPAN API as well as scrapes the website.

    (1) https://metacpan.org/module/list-rev-deps

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1042611]
Approved by davido
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2025-02-09 13:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (96 votes). Check out past polls.