Bug#922914: Check also on storing item
積丹尼 Dan Jacobson
jidanni at jidanni.org
Thu Feb 21 21:03:09 GMT 2019
$ XDG_UTILS_DEBUG_LEVEL=33 xdg-mime default zzzz.desktop text/html
make_default_kde: No kde runtime detected
make_default_generic zzzz.desktop text/html
Updating /home/jidanni/.config/mimeapps.list
$ cat /home/jidanni/.config/mimeapps.list
[Default Applications]
text/html=zzzz.desktop
$ XDG_UTILS_DEBUG_LEVEL=33 xdg-mime query default text/html
Checking /home/jidanni/.config/mimeapps.list
Checking /home/jidanni/.local/share/applications/mimeapps.list
Checking /home/jidanni/.local/share/applications/defaults.list and /home/jidanni/.local/share/applications/mimeinfo.cache
Checking /home/jidanni/.local/share/applications/defaults.list and /home/jidanni/.local/share/applications/mimeinfo.cache
Checking /usr/local/share//applications/defaults.list and /usr/local/share//applications/mimeinfo.cache
Checking /usr/local/share//applications/defaults.list and /usr/local/share//applications/mimeinfo.cache
Checking /usr/share//applications/defaults.list and /usr/share//applications/mimeinfo.cache
org.gnome.Epiphany.desktop
$ XDG_UTILS_DEBUG_LEVEL=33 xdg-mime query default text/html 2>&1|uniq -c
1 Checking /home/jidanni/.config/mimeapps.list
1 Checking /home/jidanni/.local/share/applications/mimeapps.list
2 Checking /home/jidanni/.local/share/applications/defaults.list and /home/jidanni/.local/share/applications/mimeinfo.cache
2 Checking /usr/local/share//applications/defaults.list and /usr/local/share//applications/mimeinfo.cache
1 Checking /usr/share//applications/defaults.list and /usr/share//applications/mimeinfo.cache
1 org.gnome.Epiphany.desktop
We notice: same checks messages twice. Spurious "//"s.
$ XDG_UTILS_DEBUG_LEVEL=33 xdg-mime query default text/html 2>&1|tr \ \\n|sort -u|grep ^/ |xargs grep text/html 2>&-
/home/jidanni/.config/mimeapps.list:text/html=zzzz.desktop
/home/jidanni/.local/share/applications/mimeapps.list:text/html=userapp-Aurora-OCQ17W.desktop
/home/jidanni/.local/share/applications/mimeapps.list:text/html=userapp-Aurora-OCQ17W.desktop;
/usr/share//applications/mimeinfo.cache:text/html=org.gnome.Epiphany.desktop;chromium.desktop;firefox.desktop;abiword.desktop;
$ XDG_UTILS_DEBUG_LEVEL=33 xdg-mime query default text/html
Checking /home/jidanni/.config/mimeapps.list
chromium.desktop
Conclusion:
So there is a check on if the item really exists, but it is only done on
retrieving it. Not storing it. Why not both?
More information about the Pkg-freedesktop-maintainers
mailing list