From: Graham Knop Date: Sat, 30 Mar 2013 08:59:54 +0000 (-0400) Subject: Fix upgrading from versions < 0.10 X-Git-Tag: Devel-GlobalDestruction-0.11~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3d084a8cc8d18ccfd4e39a64ae21668674ed9c47;p=p5sagit%2FDevel-GlobalDestruction.git Fix upgrading from versions < 0.10 Older versions are installed in archlib due to an XS component. This will shadow a newer version installed into lib. Try to detect this situation, and uninstall the older versions if needed. --- diff --git a/Makefile.PL b/Makefile.PL index ee99c6a..b6344e0 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -65,6 +65,21 @@ unless ( eval { ExtUtils::MakeMaker->VERSION('6.56') } ) { } } +if (eval { require Devel::GlobalDestruction } + && Devel::GlobalDestruction->VERSION < 0.10) { + package MY; + no warnings 'once'; + + *install = sub { + my $self = shift; + return ' +pure_site_install :: + $(NOECHO) $(RM_F) ' . $self->quote_literal( + $self->catfile('$(DESTINSTALLSITEARCH)', 'Devel', 'GlobalDestruction.pm') + ) . "\n" . $self->SUPER::install; + }; +} + delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION('6.52') };