From patchwork Sat Jun 18 05:25:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 40103 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2790127BBEA; Sat, 18 Jun 2022 06:26:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9F47D27BBE9 for ; Sat, 18 Jun 2022 06:26:17 +0100 (BST) Received: from localhost ([::1]:50338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2QyO-0006Fn-Qe for patchwork@mira.cbaines.net; Sat, 18 Jun 2022 01:26:16 -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 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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(-) base-commit: 3154b582567539d8d607344fbd03a3d8456f66cb 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*) ;;