Re: Unable to Change MIME Types Reported by File

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux