GNOME Bugzilla – Bug 608421
glib desktop-app-info.c test removes gedit.desktop in real filesystem
Last modified: 2018-05-24 12:06:21 UTC
This was originally reported downstream to http://bugs.gentoo.org/show_bug.cgi?id=297684
The problem is that, when building glib with tests enabled, I got my /usr/share/applications/gedit.desktop removed.
Due some investigation in downstream bug, seems that this is done by desktop-app-info test, since gedit.desktop removal is now workarounded downstream (but, of course, test is now failing).
Maybe an idea would be to provide with glib sources a .desktop file used for test with it, without touching real system
Thanks a lot
Created attachment 257102 [details] [review]
Don't access system-wide gedit.desktop
Attached test that removes dependency from system-wide gedit.desktop.
Created attachment 257103 [details] [review]
Make can_delete/delete consistent
This patch depends on the first one and should be applied with it. This fixes inconsistency when g_desktop_info_can_delete() returns FALSE while g_desktop_info_delete() succeeds.
This feels a bit too much like "fixing" a testcase when it has actually demonstrated a real problem that we should fix.
I guess the real solution here is to only attempt deletes from XDG_DATA_HOME, and not from the system xdg directories.
Yes, that's probably another, better solution.
Though the test should probably be rewritten anyway (see the first patch), so that it does not assume/access system wide gedit.desktop as it just may not be present on the system (in which case we effectively disable this part of the test). The solution with temporary directory [created outside XDG_DATA_HOME] should be applicable.
-- GitLab Migration Automatic Message --
This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/263.