On Sat, Jun 28, 2003 at 10:13:06PM +0100, Fergal Daly wrote:
> On Saturday 28 June 2003 02:51, Michael G Schwern wrote:
> > When I merged Test::Simple with Test::More I left a Test-More tarball lying
> > around containing a Makefile.PL which simply died saying "download
> > Test-Simple instead".
> 
> That's OK for a merge (or you could have an empty archive with a dependency on 
> Test::Simple so CPAN.pm can be happy.)
> 
> I don't think dieing is a good idea for a rename or a deprecation. It's 
> probably a good thing to die when a developer gets your module but if a user 
> gets it to satisfy a dependency then it shouldn't fail. Is there a way to 
> know if Makefile.PL is being run by CPAN.pm?

There's no need, CPAN.pm won't pick up the old named module.  All it 
contains is a Makefile.PL and a MANIFEST.  Perhaps a README.  There is no 
.pm files for the CPAN indexer to pick up on.  search.cpan.org shouldn't 
even pick up on it.  The only way a user could find that tarball is to 
manually download it from CPAN.  Its just a hollow dummy.  There's no other 
reason someone would download the dummy.

To make it clear, what you would do is release a Test-Warn-None-0.05.tar.gz
which contained a Makefile.PL which died with a message about having been
renamed to Test::NoWarnings and to download Test-NoWarnings instead.  That's
for the folks still downloading modules by hand.

For those using the CPAN shell or modules having dependencies on the old
name (Test::Warn::None), Test-NoWarnings could contain all the normal stuff
plus a Test::Warn::None which is a thin wrapper around Test::NoWarnings so 
backwards compat is maintained.  It also means that CPAN will index this
tarball as having Test::Warn::None in it so when the CPAN shell tries to
install Test::Warn::None it downloads Test-NoWarnings.

Optionally, you could put a warning about using Test::NoWarnings when 
Test::Warn::None starts up.

The Test::Warn::None wrapper might look like this:
    
    package Test::Warn::None;
    use Test::NoWarnings;
    @ISA = qw(Test::NoWarnings);

    sub import {
        shift;
        @_ = ('Test::NoWarnings', @_);
        goto Test::NoWarnings->can('import'); 
    }

    1;

Simply fooling Test::NoWarnings->import into thinking it was called.


-- 
It's Crack Cocaine time!

Reply via email to