local-file.desktop MimeTypes may not match reality
src/gnome-software-local-file.desktop.in
contains:
MimeType=application/x-rpm;application/x-redhat-package-manager;application/x-deb;application/x-app-package;application/vnd.ms-cab-compressed;application/vnd.flatpak;application/vnd.flatpak.repo;application/vnd.flatpak.ref;application/vnd.snap;
However which types of file it can open depends on a combination of build-time options and which packages are installed at runtime. For example:
- If compiled with
-Dpackagekit=false
, none of the filetypes handled by that plugin can be installed - If the distro splits the Snap plugin to a separate package (as Debian does), Snaps can't be installed if that package is not installed
It's a bit clumsy but my best idea here is to fragment this file into many smaller files, all with the same description etc but only varying in MimeType
:
- gnome-software-local-file-packagekit.desktop(.in) for the types handled by the packagekit plugin
- gnome-software-local-file-fwupd.desktop(.in) for ms-cab-compressed
- etc
These files would be installed at build time if and only if the corresponding plugin is enabled. Distros would package them in the same package as the plugin, so they would only be on end-user systems if the corresponding plugin is installed.