Subject: | lack of module_name breaks its use in tools like Carton + patch |
Tools like Carton rely on being able to tell from the metadata of a
distribution what the main module of a dist is to be able to later
request that module from the CPAN package index and select the right
dist to install.
In the case of MIME-tools this means that Carton tries to glean this
information from the Makefile, generated by Module::Install.
Module::Install inserts the relevant bit of information by first
looking for a module_name value being provided in Makefile.PL and then
using the name value, replacing - with ::, resulting in the rather
unfortunate:
MIME::tools
This is not a package indexed by CPAN, so further attempts to install/
upgrade it via Carton will fail, leaving no choice but to manually
fiddle with carton.lock and making sure to remember on each commit to
not let it change the module entry from MIME::Parser to MIME::tools.
Normally a decent way to fix it would be to change the name from
MIME-tools to MIME::Tools, however i think this might cause issues,
since it's not in sync with the dist file name. As such adding a
module_name entry to Makefile.PL seems to be the correct solution.
As follows the proposed patch:
diff --git a/Makefile.PL b/Makefile.PL
index 65e0f79..0e54425 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -3,6 +3,7 @@ use warnings;
use inc::Module::Install;
name 'MIME-tools';
+module_name 'MIME::Tools';
version_from 'lib/MIME/Tools.pm';
author q{Eryq <eryq@zeegee.com>, David F. Skoll
<dfs@roaringpenguin.com>, Dave O'Neill <dmo@roaringpenguin.com>};
abstract 'Tools to manipulate MIME messages';