Fails to read appstream data when content type is stolen
When you install for example org.musescore.MuseScore
from Flathub, it changes the content type of the .xml files from application/xml
to application/vnd.recordare.musicxml+xml
(apart of other things), which prevents load of the appstream data, because libxmlb has no adapter for that content type. It results into a runtime warnings on the console:
07:33:44:0471 Gs No AppStream data, try 'make install-sample-data' in data/
and no applications shown in the gnome-software.
The debug log shows things like this (for each appstram file):
07:48:46:0317 XbSilo ignoring invalid file /usr/share/app-info/xmls/fedora.xml.gz:
ctime=1647356331.338000:func-id=AddIcons@2:func-id=AppStreamUpgrade2@3:
func-id=AddOriginKeyword@1:func-id=TextTokenize@2:func-id=MediaBaseUrl@3:
scope=system:filename=/usr/share/app-info/xmls/fedora.xml.gz:
cannot process content type application/vnd.recordare.musicxml+xml
07:48:46:0317 XbSilo ignoring invalid file /var/cache/app-info/xmls/phracek-PyCharm.xml:
ctime=1649664897.416710:func-id=AddIcons@2:func-id=AppStreamUpgrade2@3:func-id=AddOriginKeyword@1:
func-id=TextTokenize@2:func-id=MediaBaseUrl@3:scope=system:filename=/var/cache/app-info/xmls/phracek-PyCharm.xml:
cannot process content type application/vnd.recordare.musicxml+xml
The appstreamcli doesn't suffer of this, because it's using libxml2 to read the xml data (and it checks on the extension, rather than on the content type.
This had been reported downstream as:
https://bugzilla.redhat.com/show_bug.cgi?id=2073205