From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id cObYNPthrWLQyQAAbAwnHQ (envelope-from ) for ; Sat, 18 Jun 2022 07:26:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id KM7kM/thrWIizwAAG6o9tA (envelope-from ) for ; Sat, 18 Jun 2022 07:26:19 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 65843BCFA for ; Sat, 18 Jun 2022 07:26:19 +0200 (CEST) Received: from localhost ([::1]:50338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2QyP-0006Fn-Sd for larch@yhetil.org; Sat, 18 Jun 2022 01:26:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2QyA-0006Fd-FT for guix-patches@gnu.org; Sat, 18 Jun 2022 01:26:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2QyA-0006z4-3l for guix-patches@gnu.org; Sat, 18 Jun 2022 01:26:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o2Qy9-0006zC-Vc; Sat, 18 Jun 2022 01:26:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56050] [PATCH] home: services: environment-variables: Fix XDG base directories. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Sat, 18 Jun 2022 05:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56050@debbugs.gnu.org Cc: Philip McGrath X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Philip McGrath Received: via spool by submit@debbugs.gnu.org id=B.165552993626819 (code B ref -1); Sat, 18 Jun 2022 05:26:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Jun 2022 05:25:36 +0000 Received: from localhost ([127.0.0.1]:47392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2Qxj-0006yV-Ud for submit@debbugs.gnu.org; Sat, 18 Jun 2022 01:25:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:57828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2Qxf-0006yK-ME for submit@debbugs.gnu.org; Sat, 18 Jun 2022 01:25:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2Qxf-0006F2-Eh for guix-patches@gnu.org; Sat, 18 Jun 2022 01:25:31 -0400 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]:33389) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2Qxc-0006mP-1Q for guix-patches@gnu.org; Sat, 18 Jun 2022 01:25:29 -0400 Received: by mail-qv1-xf30.google.com with SMTP id 89so9250331qvc.0 for ; Fri, 17 Jun 2022 22:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=QjwKyJ2e+bvjFXk+UXmFvz9mwHUCHBZquJEGkyogtfA=; b=FwSFe5aXL1rKQp2PHmWJ+fIuqEZCDvyvIm1ZgsdYjtLMGO8RswKrEYabEuZ8Gv1kzm ips2tBjnFnXXo6e1tc2lJkkAR8VSRXTfLkvw4XWYgNBaNF5FmVCL7SpRafZxmlJfC6/P j27cklAQujgOEH8HhXzd2wyVXw0RzTBcT2u8KBlUBHXWsr+8qLE44BWZBAxJBF0kp8ao QC4+1XkNyHIQxRi9MeAL1ylgMrx5VeH59z5UJdfMWqxKmm9jqDq1Lp60o/O40wCqZyAt hI7hIcykjAv6pkI+j3/Unk41exhmP+2faSwn4Mx2hR2ESREJzRN51/lTdXUGLQF3km1I G2WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=QjwKyJ2e+bvjFXk+UXmFvz9mwHUCHBZquJEGkyogtfA=; b=V+4utEVi+p2so8s1I9RUcAipM9dIRL6ZCxh2USodtErosdlGjOkgWbhBvN7ybMFMBU xSxIFmH2YGo3UEm1mgNHbVuH92EuVkVna9KUua5yVzKEY59tFhKPBiMIA2s1ZwziyNT4 HSclKVdEesg3keX2ydl4nW15pdUz94mGcoR/bEKodnzWgxlln/fDepb+RPfhk3nr1K3p usFJJzWjBHEF715rY9p5Lf7yC1VZLQaIc1HH12pIeph34ng5pMAEUWdLgAoxU5voi9pZ Ngr+Qw1b7VsE6mbL8W9wqEMEvG3m1nqWTqz201d7/d6SrP1HODAQykaW/QIiOyev5u6k q2ow== X-Gm-Message-State: AJIora9VeGtapEtOWQ6BTndMrAmGnjd9aTbtPxPevHB/bSW8UdMku2fi P+F/1qw/MenetcmKg3aRVzJjjaG8d7tC9tVpkDc= X-Google-Smtp-Source: AGRyM1sbX938k9eUZxKz3mNjRRFjNzWMoGRRCvQUAX+VC2XTunGntBDFYzETRqPtPZ7OIGRNOT8Y3w== X-Received: by 2002:ad4:5cab:0:b0:464:643b:1099 with SMTP id q11-20020ad45cab000000b00464643b1099mr11205147qvh.95.1655529925033; Fri, 17 Jun 2022 22:25:25 -0700 (PDT) Received: from localhost (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with UTF8SMTPSA id ay35-20020a05620a17a300b006a716fed4d6sm5568971qkb.50.2022.06.17.22.25.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jun 2022 22:25:24 -0700 (PDT) From: Philip McGrath Date: Sat, 18 Jun 2022 01:25:23 -0400 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: permerror client-ip=2607:f8b0:4864:20::f30; envelope-from=philip@philipmcgrath.com; helo=mail-qv1-xf30.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_PERMERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1655529979; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=QjwKyJ2e+bvjFXk+UXmFvz9mwHUCHBZquJEGkyogtfA=; b=pevDiwlGQ3Mbv+X2IKjqFCwkS+vVI8f0f9j7rtgoLqmPDWwDBKDq9UOB+aez5bSpD5g2R5 +ouxB+cReweuOkP17gCyTOvmxJa3bGfolPErl8mySJCMAWomgSNMim0vkz2qJm3Lrqn+C/ 6GV9QjqvPKqwZyzg/JO+xn54nmrhYBwCVz/iJizAkyoHvJA39A1G9PbEd+1I+BYiqe+UWR wMdzcLSO+fCrsAz4kRWsa2xcqSXDqDQV7/z1I+3Onrf1fXgAyKnOJtScyaKLa0Q89UZuxV foTTEgtNbPeVM6nKwgJmsFvSxhAKrq0l+xT8R6YzIPnuY5meF4w/9in6ZwAXAQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655529979; a=rsa-sha256; cv=none; b=dX/WhsuLDBehZwnQ+NeIKxp64J1thJxngp+c6ODUWTE1XytQsVKdY9hl7N7JgEdU2+b25A JIsPTdfPniJ4hub53gjbWcX0xVeCDdoHTmJvZnbrLFY7TbH/+0S4eexmRsO+ZrjGZVqqpX 63G2y6tktAqtU/mk7+jNCBeUjx/B3olee273a2J3P3FfyO0E0KffLXsL+uKYDIm/O483UU YDOIqpY8hPzUpFK/CNl4Uw/u+srLoda9xuhdEmuoDNSxsEppQwnShGVI3+NEhD6NcW5mq7 9CKShIHL9ykAQOFMYnmW8NQQJe2PfFQfsacbqMzl/Vm2xdA8mArRZsobUi3hpg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=FwSFe5aX; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.41 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=FwSFe5aX; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 65843BCFA X-Spam-Score: 2.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: GXuxIS4IBrrC When the environment initialization script is run, XDG_DATA_DIRS and/or XDG_CONFIG_DIRS may be empty or unset, in which case we must use their respective defaults from the specification, rather than ending the value with a trailing ":". For further discussion, see . * gnu/home/services.scm (environment-variables->setup-environment-script): Use conditional parameter expansion for XDG_DATA_DIRS and XDG_CONFIG_DIRS. --- MANPATH and INFOPATH don't have this problem because they have well-defined behavior for a trailing ":". XCURSOR_PATH, on the other hand, does seem to have a similar problem. In my KDE Plasma Wayland session, at least, omiting the default caused the cursor to disappear when hovering over the border of a window. I could fix this on my Debian-based distribution by putting: export XCURSOR_PATH="${XCURSOR_PATH:-/usr/share/icons:/usr/share/pixmaps}" in a file under "/etc/profile.d", but I'm not sure if that default is truly portable even among FHS-based distros. For example, it sounds like Gentoo uses "/usr/share/cursors/xorg-x11". So I haven't tried to address XCURSOR_PATH for now. -Philip gnu/home/services.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/home/services.scm b/gnu/home/services.scm index 5ee3357792..ba14d8a119 100644 --- a/gnu/home/services.scm +++ b/gnu/home/services.scm @@ -208,7 +208,7 @@ (define (environment-variables->setup-environment-script vars) case $XDG_DATA_DIRS in *$HOME_ENVIRONMENT/profile/share*) ;; - *) export XDG_DATA_DIRS=$HOME_ENVIRONMENT/profile/share:$XDG_DATA_DIRS ;; + *) export XDG_DATA_DIRS=$HOME_ENVIRONMENT/profile/share:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/} ;; esac case $MANPATH in *$HOME_ENVIRONMENT/profile/share/man*) ;; @@ -220,7 +220,7 @@ (define (environment-variables->setup-environment-script vars) esac case $XDG_CONFIG_DIRS in *$HOME_ENVIRONMENT/profile/etc/xdg*) ;; - *) export XDG_CONFIG_DIRS=$HOME_ENVIRONMENT/profile/etc/xdg:$XDG_CONFIG_DIRS ;; + *) export XDG_CONFIG_DIRS=$HOME_ENVIRONMENT/profile/etc/xdg:${XDG_CONFIG_DIRS:-/etc/xdg} ;; esac case $XCURSOR_PATH in *$HOME_ENVIRONMENT/profile/share/icons*) ;; base-commit: 3154b582567539d8d607344fbd03a3d8456f66cb -- 2.32.0