thaljef/Pinto — pull request #16 by renormalist (2012-09-13 15:29:50+00:00)
Title: 'add' allows --force if the archive already exists

And here we go.

I am very serious about the feature and willing to polish it
in whatever way you request, in order to not require me
to maintain my own branch forever, as I definitely need it,
twice: for my private Perl::Formance work and my professional
Tapper staging area deployment.

I added tests, manually reviewed the resulting DB schema changes (sql dump diffs),
tried to follow your coding style, and checked the changes with Perl::Critic.

It adds a feature to Pinto I already exercised with my self-made
mirrors, with CPAN::Site, and also with CPAN::Mini::Inject IIRC.

Technically it "just" replaces an existing archive in the repository.

Use cases are:

- hotfix an archive
- use Pinto as staging area before upload to CPAN - without inflating version numbers

Please apply.

Thanks!

Kind regards,
Steffen

---

PS: here the description from the patch:

Usually if the package already exists (e.g., because it has the same
version number) you cannot add it twice.

With this option you can.

It drops the existing archive file from the repository and adds the
new one back again. It registers it for the original stacks, restores
the original pinning, and it recursively pulls all the prerequisites
(unless C<--norecurse> is set), for each of the original stacks.

With this option you can hotfix a repository or use your repository as
an experimental staging area before you upload to CPAN - without
inflating version numbers. Only use it when you know what you are
doing.