thaljef / Pinto

Curate your own repository of Perl modules
https://metacpan.org/module/Pinto::Manual
66 stars 49 forks source link

Reverse dependencies #193

Open kablamo opened 9 years ago

kablamo commented 9 years ago

Hi, I'd like a command that shows me the reverse dependencies for a pkg. Specifically: something that is the intersection of CPAN::ReverseDependencies and pinto list.

Do you think it makes sense to add a subcommand to pinto for that? Or should I make this a separate pkg on cpan?

thaljef commented 9 years ago

That sounds like a fantastic idea! Why don't you start by forking Pinto. Once it takes a bit more shape, then we can decide if we want it in the core. If you haven't already figured this out, there are two basic parts for any command:

  1. An App::Pinto::Command subclass (the user interface)
  2. A Pinto::Action subclass (the implementation)

Use the code for existing commands as a starting point. Certain commands may also require a Pinto::Remote::Action subclass, but I don't think you'll need one in this case. I am happy to help, and @tartansandal may also have some insights on writing your first Pinto command.

thaljef commented 9 years ago

If I may make a suggestion, the same command could also report forward-dependencies too. I think Pinto::PrerequisiteWalker might be helpful here.

kahlil-hodgson commented 9 years ago

Excellent idea! Happy to give pointers if you are interested in this :-)

kablamo commented 9 years ago

Spent some time looking into this. It is kind of a lot of work. The first step is I need to patch CPAN::ReverseDependencies to add some features. For example:

  1. Need a way to get > 100 results.
  2. Need a way to get query a specific release instead of always looking at the latest version

That last one in particular might be a problem. If the local stack has a version pinned, the reverse dep might not apply.

thaljef commented 9 years ago

@kablamo I don't think you need CPAN::ReverseDependencies at all (if I understand your intentions correctly). Pinto already knows the whole dependency tree for everything in the repository. You just have to walk the tree and print stuff out.

kablamo commented 9 years ago

@thaljef thanks for pointing that out. Not sure what I was thinking. Thats obvious in retrospect. I'll take a look again when I get a chance.