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

Support file classification by MIME type #1098

Merged
merged 1 commit into from Mar 10, 2020

Conversation

pmatilai
Copy link
Member

@pmatilai pmatilai commented Mar 4, 2020

In addition to "magic" strings, support classifying files by matches
on their MIME types which are far more predictable than the notoriously
volatile magic strings which are intended for human consumption.

This adds an optional %__foo_mime and %__foo_exclude_mime patterns
to file attributes. If the mime-variant is present, magic is ignored
if present (with a warning).

The testcase is a fine example of how the grass not necessarily being
any greener on the other side: the actual output is far more predictable,
but the actual classification is not. Our "script" with an arbitrary
unknown interpreter is considered text/plain by libmagic.

Fixes: #1097

@pmatilai
Copy link
Member Author

pmatilai commented Mar 5, 2020

Rebased to fix conflict.

In addition to "magic" strings, support classifying files by matches
on their MIME types which are far more predictable than the notoriously
volatile magic strings which are intended for human consumption.

This adds an optional %__foo_mime and %__foo_exclude_mime patterns
to file attributes. If the mime-variant is present, magic is ignored
if present (with a warning).

The testcase is a fine example of how the grass not necessarily being
any greener on the other side: the actual output is far more predictable,
but the actual classification is not. Our "script" with an arbitrary
unknown interpreter is considered text/plain by libmagic.

Fixes: rpm-software-management#1097
@pmatilai
Copy link
Member Author

pmatilai commented Mar 6, 2020

Rebased + check for non-existent %ghosts added.

@pmatilai pmatilai merged commit e49111d into rpm-software-management:master Mar 10, 2020
@pmatilai pmatilai deleted the fc-mime-pr branch June 15, 2020 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

RFE: Support file classification by MIME type in dependency generation
2 participants