Open ssoriche opened 7 years ago
We could also potentially simply error on cases like these, but would that change in behaviour be too unacceptable for things that already exist in the wild?
The example module does install when using cpanm
and carton install
, however fails when being installed with carton install --deployment
because carton doesn't have the module details to populate the snapshot file. As the example was released in 2009, it may not be a very wide spread issue. My worry is the time to get the original fixed versus Parse::CPAN::Meta checking the content of the file instead of relying solely on the filename and doing the right thing.
However what I've submitted doesn't change the underlying code, the file was always read into a variable for parsing, it's just now the content of the file is used to determine what to use for parsing rather than the file extension.
I am going to amend this pull request to including printing a warning when the filename and content do not match, and continue the installation.
This feels more like a carton bug to me. Dists like this should be treated as the same as dists without metadata, which carton should be fixed to accommodate if it doesn't.
I don't think Parse::CPAN::Meta should accept meta files whose filenames does not match their contents.
Using the existing file parsing and comparisons, add checking of the META content to determine data markup prior to using the filename. These changes alleviate an issue that occurs when the content and extension do not match