Skip Menu |

This queue is for tickets about the CPAN-Mini-Inject CPAN distribution.

Report information
The Basics
Id: 63350
Status: resolved
Priority: 0/
Queue: CPAN-Mini-Inject

People
Owner: Nobody in particular
Requestors: djo [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.27
Fixed in: (no value)



Subject: [Patch] Inject method removes modules from modulelist which it shouldn't
Hi, I discovered a small bug in the inject method where it removes too much when trying to remove "old" entries on the module list. Eg. If You first inject Any::Moose and then Moose the inject method will remove Any::Moose from the modulelist. The attached patch fixes the issue. -- Best regards, David Jack Olrik <david@olrik.dk> http://david.olrik.dk GnuPG fingerprint C290 0A4A 0CCC CBA8 2B37 E18D 01D2 F6EF 2E61 9894 ["The first rule of Perl club is You do not talk about Perl club"]
Subject: CPAN-Mini-Inject-0.27.patch
diff -NurB CPAN-Mini-Inject-0.27.orig/lib/CPAN/Mini/Inject.pm CPAN-Mini-Inject-0.27/lib/CPAN/Mini/Inject.pm --- CPAN-Mini-Inject-0.27.orig/lib/CPAN/Mini/Inject.pm 2010-01-28 21:11:23.000000000 +0100 +++ CPAN-Mini-Inject-0.27/lib/CPAN/Mini/Inject.pm 2010-11-26 11:54:51.000000000 +0100 @@ -310,7 +310,7 @@ # remove old version from the list @{ $self->{modulelist} } - = grep { $_ !~ m/$options{module}\s+/ } @{ $self->{modulelist} }; + = grep { $_ !~ m/^$options{module}\s+/ } @{ $self->{modulelist} }; push( @{ $self->{modulelist} },
I've applied the patch and uploaded 0.27_01 to CPAN so the testers can have fun with it.
The smokers seem to be fine with this change, so it'll be out in 0.29 soonish.