GNU bug report logs - #39231
[PATCH] guix-install.sh: Correctly treat empty or unset $XDG_DATA_DIRS

Previous Next

Package: guix-patches;

Reported by: Alexander Krotov <krotov <at> iitp.ru>

Date: Tue, 21 Jan 2020 23:41:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39231 in the body.
You can then email your comments to 39231 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#39231; Package guix-patches. (Tue, 21 Jan 2020 23:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alexander Krotov <krotov <at> iitp.ru>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 21 Jan 2020 23:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alexander Krotov <krotov <at> iitp.ru>
To: guix-patches <at> gnu.org
Cc: Alexander Krotov <krotov <at> iitp.ru>
Subject: [PATCH] guix-install.sh: Correctly treat empty or unset $XDG_DATA_DIRS
Date: Wed, 22 Jan 2020 02:01:33 +0300
If $XDG_DATA_DIRS is unset, default value of "/usr/local/share:/usr/share"
is used according to XDG Base Directory Specification. However,
/etc/profile.d/guix.sh treats this value as empty list when appending its
own directory, so after installing Guix on the system, launchers such
as Rofi stop searching for .desktop files in /usr/share/applications/
and can't launch applications other than those installed with Guix.

This patch fixes the bug in generated /etc/profile.d/guix.sh

* etc/guix-install.sh (sys_create_init_profile): Use default value of
  /usr/local/share:/usr/share/ before appending if $XDG_DATA_DIRS is not
  set.
---
 etc/guix-install.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index b57d71981f..da781d41ff 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -409,7 +409,7 @@ export GUIX_PROFILE GUIX_LOCPATH
 eval `guix package --search-paths=prefix 2> /dev/null`
 
 # set XDG_DATA_DIRS to include Guix installations
-export XDG_DATA_DIRS="$GUIX_PROFILE/share${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS"
+export XDG_DATA_DIRS="$GUIX_PROFILE/share:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}"
 EOF
 }
 
-- 
2.25.0





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 26 Jan 2020 22:22:01 GMT) Full text and rfc822 format available.

Notification sent to Alexander Krotov <krotov <at> iitp.ru>:
bug acknowledged by developer. (Sun, 26 Jan 2020 22:22:02 GMT) Full text and rfc822 format available.

Message #10 received at 39231-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Alexander Krotov <krotov <at> iitp.ru>
Cc: 39231-done <at> debbugs.gnu.org
Subject: Re: [bug#39231] [PATCH] guix-install.sh: Correctly treat empty or
 unset $XDG_DATA_DIRS
Date: Sun, 26 Jan 2020 23:20:55 +0100
Hi,

Alexander Krotov <krotov <at> iitp.ru> skribis:

> If $XDG_DATA_DIRS is unset, default value of "/usr/local/share:/usr/share"
> is used according to XDG Base Directory Specification. However,
> /etc/profile.d/guix.sh treats this value as empty list when appending its
> own directory, so after installing Guix on the system, launchers such
> as Rofi stop searching for .desktop files in /usr/share/applications/
> and can't launch applications other than those installed with Guix.
>
> This patch fixes the bug in generated /etc/profile.d/guix.sh
>
> * etc/guix-install.sh (sys_create_init_profile): Use default value of
>   /usr/local/share:/usr/share/ before appending if $XDG_DATA_DIRS is not
>   set.

Good catch.  Applied, thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 24 Feb 2020 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 118 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.