After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702991 - Doesn't add monitor for .local/share/applications if it doesn't exist
Doesn't add monitor for .local/share/applications if it doesn't exist
Status: RESOLVED OBSOLETE
Product: gnome-menus
Classification: Core
Component: libgnome-menu
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-menus dummy account
gnome-menus dummy account
Depends on:
Blocks:
 
 
Reported: 2013-06-24 16:08 UTC by Emilio Pozuelo Monfort
Modified: 2021-05-25 12:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add monitors for non-existent paths (1.48 KB, patch)
2013-06-24 17:54 UTC, Emilio Pozuelo Monfort
none Details | Review

Description Emilio Pozuelo Monfort 2013-06-24 16:08:15 UTC
Currently when a new user first logs in, ~/.local/share/applications doesn't exist for him. If he creates a .desktop file somehow (e.g. through alacarte) the directory is created and a .desktop file is added, but gnome-shell doesn't notice the new desktop file because libgnome-menu didn't add a monitor:

Resolving files in: Resolving files in: Adding <AppDir>/home/test2/.local/share/applications</AppDir> in <DefaultAppDirs/>
Adding <AppDir>/usr/local/share/applications</AppDir> in <DefaultAppDirs/>
Adding <AppDir>/usr/share/applications</AppDir> in <DefaultAppDirs/>
[...]
Loading entry directory "/usr/local/share/applications" (legacy <no>)
Failed to canonicalize "/usr/local/share/applications": No such file or directory
Loading entry directory "/home/test2/.local/share/applications" (legacy <no>)
Failed to canonicalize "/home/test2/.local/share/applications": No such file or directory

Perhaps if canonicalize fails with ENOENT we can ignore the error. Or we can canonicalize the parent and add the basename (recursively), e.g.

Canonicalize /home/test2/.local/share/applications -> ENOENT
Canonicalize /home/test2/.local/share/ -> ENOENT
Canonicalize /home/test2/.local/ -> OK!

Return /home/test2/.local/ + share/applications
Comment 1 Emilio Pozuelo Monfort 2013-06-24 17:54:15 UTC
Created attachment 247661 [details] [review]
Add monitors for non-existent paths

A directory may be created later on so add a monitor to notice
changes on it if that happens.
Comment 2 Emilio Pozuelo Monfort 2013-06-24 17:59:01 UTC
That patch works for me:

from session.log:

Resolving files in: Resolving files in: Adding <AppDir>/home/test2/.local/share/applications</AppDir> in <DefaultAppDirs/>
Adding <AppDir>/usr/local/share/applications</AppDir> in <DefaultAppDirs/>
Adding <AppDir>/usr/share/applications</AppDir> in <DefaultAppDirs/>
[...]
Loading desktop entry "/usr/share/applications/glchess.desktop"
Loading entry directory "/usr/local/share/applications" (legacy <no>)
Failed to canonicalize "/usr/local/share/applications": No such file or directory
Looking up cached dir "/usr/local/share/applications"
Caching dir "local"
Caching dir "share"
Caching dir "applications"
**** adding monitor for /usr/local/share/applications, 1
Attempting to read entries from applications (full path /usr/local/share/applications)
Unable to list directory "/usr/local/share/applications"
Loading entry directory "/home/test2/.local/share/applications" (legacy <no>)
Failed to canonicalize "/home/test2/.local/share/applications": No such file or directory
Looking up cached dir "/home/test2/.local/share/applications"
Caching dir "home"
Caching dir "test2"
Caching dir ".local"
Caching dir "share"
Caching dir "applications"
**** adding monitor for /home/test2/.local/share/applications, 1
Attempting to read entries from applications (full path /home/test2/.local/share/applications)
Unable to list directory "/home/test2/.local/share/applications"
Loading entry directory "/usr/share/desktop-directories" (legacy <no>)



I haven't seen any drawbacks so far, but I can think of at least more wakeups due to bug #522314. I'm also not quite confident of not doing canonicalization at all. Could there be any risk if we don't do it?
Comment 3 Emilio Pozuelo Monfort 2013-06-25 14:30:41 UTC
We're going to create ~/local/share/applications in g-s-d's housekeeping plugin, see bug #703048.

Leaving this open as there are other dirs that are affected by this and so a more general fix is needed.
Comment 4 André Klapper 2021-05-25 12:45:48 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new enhancement request ticket at
  https://gitlab.gnome.org/GNOME/gnome-menus/-/issues/

Thank you for your understanding and your help.