xdg-mime default regression in 1.2.1
This is a forward of a downstream bug report in Gentoo by Rainer W at https://bugs.gentoo.org/931673.
Tweaked version of the test script he provided:
#!/bin/bash
temp=$(mktemp -d)
[[ -z ${temp} ]] && exit 1
cd "${temp}" || exit 1
export XDG_CONFIG_HOME=$PWD XDG_DATA_DIRS=$PWD XDG_DATA_HOME=$PWD
mkdir applications || exit 1
cat <<-EOF > applications/a.desktop
Exec=true a %u
MimeType=x/a;x/b;x/c;
EOF
cat <<-EOF > applications/b.desktop
Exec=true b %u
MimeType=x/a;x/b;x/c;
EOF
xdg-mime query default x/a
xdg-mime default b.desktop x/a
xdg-mime query default x/a
With xdg-utils-1.2.1, we get:
$ bash /tmp/test-xdg.sh
a.desktop
a.desktop
But with earlier versions, the output was:
$ bash /tmp/test-xdg.sh
a.desktop
b.desktop