[Rpm-maint] [rpm-software-management/rpm] Use MIME types instead of magic strings for RPMTAG_FILECLASS (#1099)

Panu Matilainen notifications at github.com
Thu Mar 5 08:18:43 UTC 2020


File magic strings are unreliable and largely unusable for anything but human consumption, MIME types are far more meaningful for classifying file types. Populate RPMTAG_FILECLASS (or rather, CLASSDICT) with MIME type instead, and add types for all files and not just our strange hardcoded list. Remove now redundant cruft.
    
Fixes: #1096

Note that this is only an RFC as a basis of discussion. I know we want to include MIME data, but I'm not sure we can just replace the cruft that is currently going into RPMTAG_CLASSDICT. OTOH I'd really rather not duplicate all that to another tag set just to preserve cruft that almost nobody uses (AFAIK). 

Thoughts?
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/1099

-- Commit Summary --

  * Use libelf for determining file colors
  * Support file classification by MIME type
  * Add a simple test for fileclass data
  * Use MIME types instead of magic strings for RPMTAG_FILECLASS

-- File Changes --

    M build/rpmfc.c (167)
    M tests/rpmbuild.at (47)
    M tests/rpmsigdig.at (6)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/1099.patch
https://github.com/rpm-software-management/rpm/pull/1099.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1099
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200305/539fdf96/attachment-0001.html>


More information about the Rpm-maint mailing list