Hello esteemed Monks,
A few months ago, I was tasked with building a private CPAN for a new client. I had already done this a couple times before using CPAN::Site or CPAN::Mini, but I was never really happy with the results. So this time, I started from scratch. The result is called Pinto, and it is now available on CPAN. Pinto is inspired by CPAN::Mini, CPAN::Mini::Inject, and OrePAN, but adds several interesting features (listed below).
So I invite you to kick the tires on Pinto and give me your feedback. Beware that Pinto has a lot of dependencies, and I'm still not sure what the minimum versions should be. So I recommend brewing a fresh perl or using the -L option with cpanm(1) to install Pinto into a clean (and separate) sandbox. Pinto is still alpha code and subject to change in incompatible ways. And make sure you get the 0.026 version.
Pinto supports several usage patterns: With Pinto, you can create a repository that mirrors all the latest distributions from CPAN. Or you can create a repository with just your own private distributions. Or you can create a repository that has all the distributions required for a particular project. Or you can combine any of the above patterns.
Pinto supports adding and removing distributions in the repository: Pinto gives you the power to precisely tune the contents of your repository. For example, you can add your own locally patched CPAN distribution, and then remove it when the original author releases a fixed version.
Pinto helps you avoid breakage due to upgrades: Pinto lets you pin your repository index to a particular version of a package, so that you can hold that package at the last know working version, while allowing other packages to be upgraded.
Pinto can be integrated with your version control system: Pinto can automatically commit to your version control system whenever the contents of the repository changes. This gives you reproducible and identifiable snapshots of your dependencies, and a mechanism for rollback when things go wrong.
Pinto makes it easier to build several local repositories: Creating new Pinto repositories is easy, and each has its own configuration. So you can have different repositories for each department, or each project, or each version of perl, or each customer, or whatever you want.
Pinto can pull distributions from multiple remote repositories: Pinto can mirror or import distributions from multiple sources, so you can create private (or public) networks of repositories that enable separate teams or individuals to share distributions.
Pinto supports team development: Pinto is suitable for small to medium-sized development teams, where several developers might contribute new distributions at the same time. Pinto ensures that concurrent users don't clobber each other.
Pinto has a robust command line interface: The pinto-admin command line tool has options to control every aspect of your Pinto repository. It is well documented and behaves in a DWIM fashion.
Pinto can be extended: You can extend Pinto by creating Pinto::Action subclasses to perform new operations on your repository, such as extracting documentation from a distribution, or grepping the source code of several distributions.
Pinto might be easiest to explain with a couple command-line demonstrations. In this first demonstration, suppose our application depends on Plack-0.98, which happens to be the latest version at that moment:
# Create an empty CPAN-like repository in directory ~/mypan $ pinto-admin -r ~/mypan create # Get the current version of Plack (and all its dependencies) into the + repository $ pinto-admin -r ~/mypan import Plack # Suppose HTTP::Simple has a bug and you made your own patch as HTTP-S +imple-0.23-PATCHED.tar.gz $ pinto-admin -r ~/mypan add HTTP-Simple-0.23-PATCHED.tar.gz # Point cpan(1) or cpanm(1) at your repository, to install Plack with +your patched HTTP::Simple # cpanm --mirror file:///home/you/mypan --mirror-only Plack # Time passes...and now we decide we want to upgrade the latest Plack, + which is now Plack-2.4 $ pinto-admin -r ~/mypan import Plack-2.4 # It seems that bug in HTTP::Simple has now been fixed. So we can rem +ove our patched version $ pinto-admin -r ~/mypan remove HTTP-Simple-0.23-PATCHED.tar.gz
For this next demonstration, suppose we want to have the latest version of everything in CPAN:
# Create a new repository (or you can use an existing one) $ pinto-admin -r ~/mypan create # Get the latest version of ALL packages from a CPAN (may take a coupl +e hours) $ pinto-admin -r ~/mypan mirror # Now we have a stable snapshot of CPAN we can install from $ cpanm --mirror file:///home/you/mypan --mirror-only Catalyst Moose P +erl::Critic # Time passes...now we want to bring our snapshot up to date with the +tip of CPAN $ pinto-admin -r ~/mypan mirror # But wait! The new Moose-2.1 breaks our code. We want to stay with +our old Moose-1.4 $ pinto-admin -r ~/mypan pin Moose-1.4 # More time passes...We've fixed our code to work with Moose-2.1 $ pinto-admin -r ~/mypan unpin Moose
You can actually combine these scenarios in various ways too. At the end of the day, Pinto provides you with a stable, cherry-picked slice of CPAN that you can systematically evolve over time. I'm still figuring out how best to apply that capability. Your insights are much appreciated.
Jeffrey Thalhammer
Imaginative Software Systems
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Announce: Pinto-0.026 -- Curate Your Own CPAN Repository
by DrHyde (Prior) on Dec 08, 2011 at 14:39 UTC | |
by jthalhammer (Friar) on Dec 08, 2011 at 18:19 UTC | |
by DrHyde (Prior) on Dec 09, 2011 at 11:57 UTC | |
Re: Announce: Pinto-0.026 -- Curate Your Own CPAN Repository
by Khen1950fx (Canon) on Dec 10, 2011 at 22:12 UTC |