Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for content prior to filename #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ssoriche
Copy link

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

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](https://metacpan.org/source/MLEHMANN/AnyEvent-AIO-1.1/META.yml)
@karenetheridge
Copy link
Member

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?

@ssoriche
Copy link
Author

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.

@ssoriche
Copy link
Author

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.

@haarg
Copy link
Member

haarg commented Sep 12, 2017

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.

@skaji
Copy link

skaji commented Sep 12, 2017

I don't think Parse::CPAN::Meta should accept meta files whose filenames does not match their contents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants