Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#33316 - [xdg-utils] xdg-desktop-menu fails unless /usr/share/desktop-directories/ exists in filesystem

Attached to Project: Arch Linux
Opened by Jon Gjengset (Jonhoo) - Monday, 07 January 2013, 00:46 GMT
Last edited by Andreas Radke (AndyRTR) - Monday, 07 January 2013, 18:50 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan de Groot (JGC)
Andreas Radke (AndyRTR)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: Calling xdg-desktop-menu install to install a .desktop file fails if the directory for .directory files (/usr/share/desktop-directories/) does not exist. In Arch, this directory does not exist by default, so the installation of .desktop files now fails even though /usr/share/applications/ exists and is writable.


Additional info:
xdg-utils 1.1.0.git20121008-1

# XDG_UTILS_DEBUG_LEVEL=3 xdg-desktop-menu install test.desktop
Install locations for *.directory files:
xdg_user_dir: /root/.local/share/desktop-directories
xdg_global_dir:
kde_user_dir:
kde_global_dir:
gnome_user_dir:
gnome_global_dir:
xdg-desktop-menu: No writable system menu directory found.


Steps to reproduce:

1. Verify that /usr/share/desktop-directories does not exist (it did not on my Arch install at least)
2. Install any .desktop file with xdg-desktop-menu install
3. Notice that the operation fails with the message "No writable system menu directory found."
4. Create the directory /usr/share/desktop-directories as root (which is not needed for *.desktop files)
5. Run xdg-desktop-menu install again
6. Notice that the script now runs correctly
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Monday, 07 January 2013, 18:50 GMT
Reason for closing:  Fixed
Additional comments about closing:  1.1.0.git20121008-2
Comment by Andreas Radke (AndyRTR) - Monday, 07 January 2013, 15:02 GMT
Any pkg that will call to install a *.desktop file will ship one in itself. So it will first install the file and then it will call to update the .desktop database.

I cannot imagine a case where you have not one single file in /usr/share/applications/ installed before the post.install msg is called.
Comment by Jon Gjengset (Jonhoo) - Monday, 07 January 2013, 15:11 GMT
The problem is not with /usr/share/applications, it's that /usr/share/desktop-directories must exist to install desktop files.
Comment by Jon Gjengset (Jonhoo) - Monday, 07 January 2013, 17:57 GMT
From what I can tell, the issue is that xdg-desktop-menu will check all the various locations for all the file types it supports regardless of what file is being installed, and if any of them do not exist, then it will exit with a failure. Since the check for the *.directory location fails (at line 1273) before the installation of *.desktop files (starting at line 1304), and does so regardless of whether any *.directory files are being installed, the code installing the .desktop file never gets executed.
Comment by Andreas Radke (AndyRTR) - Monday, 07 January 2013, 18:02 GMT
Can you give a pkg from our repos that fails that way that doesn't depend on gnome-menu or a similar pkg that contains the files in /usr/share/desktop-directories.
Comment by Jon Gjengset (Jonhoo) - Monday, 07 January 2013, 18:08 GMT
xdg-utils
Comment by Andreas Radke (AndyRTR) - Monday, 07 January 2013, 18:50 GMT
I've added an empty directory /usr/share/desktop-directories to the xdg-utils pkg. That should be enough to prevent such failures.

Loading...