Move package discovery into API so other modules can use it #2

Merged
merged 21 commits into from Oct 10, 2011

Conversation

Projects
None yet
2 participants

Here's the pull request I promised.

The logic for discovering modules was in the bin/mcpani script
which meant it couldn't be used from things like CPAN::Mini::Inject::Server.

This patch uses Dist::Metadata (which uses CPAN::Meta and Module::Metadata) to discover provided packages inside CPAN::Mini::Inject::add() and removes the no-longer needed functionality from the script.

I think I added sufficient tests to go with the changes.

What do you think?

p.s. I did not do anything like update $CPAN::Mini::Inject::VERSION.
Obviously that's for you to do since you're the maintainer/releaser.
Besides I don't know how to build with Module::Build. I only use it for installing. I'm a Dist::Zilla guy. :-)

rwstauner added some commits Jun 14, 2011

Fix find-modules regexp to ignore t/ and inc/
Include root directory of tar when anchoring the regexp.
Warn if provides hash is empty
simple boolean check would never evaluate to true
use Dist::Metadata to determine as much info as possible
dist name and version
and multiple packages
Test adding a dist with multiple modules
and requiring less data up front.
Define 'added_modules' to enable post-add inspection
Document it, test it, and use it from bin/mcpani.
Describe the method of determining package/versions
Link to Dist::Metadata so people know where to look
if they want to know why/how it works.
Be less specific about the internals of Dist::Metadata
in case it changes.
That's what the link is for.
Don't set module/version args to dist name/version
Instead of guessing a module/version by mangling dist name,
just use the discovered packages.
If none are discoverable, croak that module/version are required.
Don't overwrite discovered version with specified one
to avoid confusion/incorrect indexing.
Remove modules that are no longer used directly
Archive::Tar and Module::Build::ModuleInfo
are no longer used by code in this distribution.
Owner

wchristian commented Jul 11, 2011

Just sounding off here, because right now my internet sucks so much that doing anything online is a pain. After the 18th i'll be able to poke at this more closely. Also, interestingly thaljef seems to have done something related: AndyA#12

@wchristian wchristian merged commit 9b5d3f4 into wchristian:master Oct 10, 2011

Owner

wchristian commented Oct 10, 2011

Merged this in because the tests are all still working, with additional ones and everything looks sane. Plus, he went and poked me on IRC. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment