I'm having trouble registering a new mime type. I had this working in Fedora 26 (and 27 iirc) but it seems to not be working in F28. I'm adding some lines to /usr/share/misc/magic and then recompiling and replacing /usr/share/mime/magic.mgc . In the past this has worked to patch the mime type this way and still works in RHEL/CentOS 7.
Using file --mime-type -k exampleFile.ica I can see my entry as the second item, but even after adding `!:strength +250` it doesn't override the default, which is application\x-wine-extension-ini
I even went so far as to remove all lines containing x-wine-extension-ini from the magic file but the assignment persists, which makes me think that either file no longer looks to /usr/share/mime/magic.mgc for the only place for mime types, there's a bug, or something else I haven't considered.
I'm happy to fill out a bug report (search through bugzilla I don't see anything) but didn't want to if there was just a change that I missed.
On 10/3/18 8:55 AM, Brian Monroe wrote:
I'm having trouble registering a new mime type. I had this working in Fedora 26 (and 27 iirc) but it seems to not be working in F28. I'm adding some lines to /usr/share/misc/magic and then recompiling and replacing /usr/share/mime/magic.mgc . In the past this has worked to patch the mime type this way and still works in RHEL/CentOS 7.
Using file --mime-type -k exampleFile.ica I can see my entry as the second item, but even after adding `!:strength +250` it doesn't override the default, which is application\x-wine-extension-ini I even went so far as to remove all lines containing x-wine-extension-ini from the magic file but the assignment persists, which makes me think that either file no longer looks to /usr/share/mime/magic.mgc for the only place for mime types, there's a bug, or something else I haven't considered.
If it finds the compiled /usr/share/mime/magic.mgc file, it will ignore /usr/share/mime/magic. Modifications are supposed to go in the /etc/magic file which could be compiled to /etc/magic.mgc. Those files are checked first.
I copied the lines from /usr/share/mime/magic to /etc/magic and made changes. Those changes overrode the original matches.
So what I had been doing was adding: ``` echo "# Citrix File Types" >> /usr/share/misc/magic echo "20 search/50 WFClient Citrix Client File" >> /usr/share/misc/magic echo "!:mime application/x-ica" >> /usr/share/misc/magic cd /usr/share/misc file -C -m /usr/share/misc/magic cd ~/ ``` so I recompile the existing magic.mgc
I changed this to:
``` echo "# Citrix File Types" >> /usr/share/misc/magic echo "20 search/50 WFClient Citrix Client File" >> /etc/magic echo "!:mime application/x-ica" >> /etc/magic cd /etc/ file -C -m /etc/magic cd ~/ ```
So there would be both a magic and magic.mgc files in etc, neither of which existed by default from a clean F28 minimal install.
`file --mime-type -b -k /path/to/example.ica` returns: application/x-wine-extension-ini\012- application/xica\012- application/octet-stream
Using my original method previously with a clean install of CentOS 7 only returns application/x-ica. This mirrored what I remember doing with F26.
On Wed, Oct 3, 2018 at 10:37 PM Samuel Sieb samuel@sieb.net wrote:
On 10/3/18 8:55 AM, Brian Monroe wrote:
I'm having trouble registering a new mime type. I had this working in Fedora 26 (and 27 iirc) but it seems to not be working in F28. I'm adding some lines to /usr/share/misc/magic and then recompiling and replacing /usr/share/mime/magic.mgc . In the past this has worked to patch the mime type this way and still works in RHEL/CentOS 7.
Using file --mime-type -k exampleFile.ica I can see my entry as the second item, but even after adding `!:strength +250` it doesn't override the default, which is application\x-wine-extension-ini I even went so far as to remove all lines containing x-wine-extension-ini from the magic file but the assignment persists, which makes me think that either file no longer looks to /usr/share/mime/magic.mgc for the only place for mime types, there's a bug, or something else I haven't considered.
If it finds the compiled /usr/share/mime/magic.mgc file, it will ignore /usr/share/mime/magic. Modifications are supposed to go in the /etc/magic file which could be compiled to /etc/magic.mgc. Those files are checked first.
I copied the lines from /usr/share/mime/magic to /etc/magic and made changes. Those changes overrode the original matches. _______________________________________________ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-leave@lists.fedoraproject.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
On 10/4/18 8:17 AM, Brian Monroe wrote:
So what I had been doing was adding:
echo "# Citrix File Types" >> /usr/share/misc/magic echo "20search/50WFClientCitrix Client File" >> /usr/share/misc/magic echo "!:mimeapplication/x-ica" >> /usr/share/misc/magic cd /usr/share/misc file -C -m /usr/share/misc/magic cd ~/
so I recompile the existing magic.mgc
You should not be modifying that file. Any changes you make will get overwritten if you upgrade the package.
echo "# Citrix File Types" >> /usr/share/misc/magic echo "20search/50WFClientCitrix Client File" >> /etc/magic
Did you lose some characters while copying? Don't you need spaces (or tabs) in there?
echo "!:mimeapplication/x-ica" >> /etc/magic cd /etc/ file -C -m /etc/magic cd ~/
So there would be both a magic and magic.mgc files in etc, neither of which existed by default from a clean F28 minimal install.
# rpm -qf /etc/magic file-5.33-7.fc28.x86_64
The "file" package is not part of the minimal install, but once you installed it, you should have had that file. It's not necessary to make the /etc/magic.mgc file.
Can you attach a sample ica file or point to where to get one?