From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kNjSAAN+s2I6HAEAbAwnHQ (envelope-from ) for ; Wed, 22 Jun 2022 22:39:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +M3KAAN+s2IO/wAAauVa8A (envelope-from ) for ; Wed, 22 Jun 2022 22:39:31 +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 F1C683BF0D for ; Wed, 22 Jun 2022 22:39:29 +0200 (CEST) Received: from localhost ([::1]:39318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o478J-0007wg-TM for larch@yhetil.org; Wed, 22 Jun 2022 16:39:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o477v-0007wH-Cs for guix-patches@gnu.org; Wed, 22 Jun 2022 16:39:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42810) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o477v-0002lk-0C for guix-patches@gnu.org; Wed, 22 Jun 2022 16:39:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o477u-0008IV-6B for guix-patches@gnu.org; Wed, 22 Jun 2022 16:39:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56050] [PATCH] home: services: environment-variables: Fix XDG base directories. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Jun 2022 20:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Philip McGrath Cc: 56050@debbugs.gnu.org Received: via spool by 56050-submit@debbugs.gnu.org id=B56050.165593030931854 (code B ref 56050); Wed, 22 Jun 2022 20:39:02 +0000 Received: (at 56050) by debbugs.gnu.org; 22 Jun 2022 20:38:29 +0000 Received: from localhost ([127.0.0.1]:36707 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o477F-0008HY-LI for submit@debbugs.gnu.org; Wed, 22 Jun 2022 16:38:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o477D-0008HL-G4 for 56050@debbugs.gnu.org; Wed, 22 Jun 2022 16:38:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4778-0002j7-3O; Wed, 22 Jun 2022 16:38:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=imuQGtbSSwc3O50edoq+ii4sXIEiqP71fDaTQtQdUeE=; b=aYX4BFOn7mD9DxZCpwod 1XT0HU4PGnzBKhaenAkv9irHJcQLIJKRX6Qw1BBlZY1k8u3hZDoeYK0Zy9wid9FZafZ38LwW5zeUr q1ceXOoQRehUFvP141yJ6vITXc9hmFMam9GM7Gz2sNR6TkMlNEV6Xfzsvb+KknFBKuJdd6ID+fIC1 5mrl6QFegz/L2L95yRu6lFRbbxtEzFFRjVrbngVZonnxbE+CujHqsNBBNBUsqiwCra+nmMewMIcR7 qx1W8rCMVFuEH/Ni6hW9s4WK4eaBBRmf8dx+zwS430j7/K2PgIr0aS44nPG4gtruYJTuKQYOr/1qE FrelAmGf/AkC6Q==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:51274 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4777-0003t4-NS; Wed, 22 Jun 2022 16:38:13 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Wed, 22 Jun 2022 22:38:11 +0200 In-Reply-To: (Philip McGrath's message of "Sat, 18 Jun 2022 01:25:23 -0400") Message-ID: <871qvg303w.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=1655930370; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=imuQGtbSSwc3O50edoq+ii4sXIEiqP71fDaTQtQdUeE=; b=AB45+aP/HGi3XWHptUg/h1U175gUMg4MgVTZNiYgB5QvvJjOtDa1Ovki+0arD3DnCImJAb q9psFzTSNqRZ/F7lMhrpKSBoii5RtAJ5dhvXNByIhmbfgByfhVl1hfAjyde8ZkJWTOPqtE B7bJLtYQZ1gH4jkW0raKgvZ2xSVyfKzartc8HQubLRhdismep3VIJAx0eLM46D3bccsN7G 1DFcYwR7HKWEIcGtQhusDZFwxlQnP4WC/i+ewMKiQlDuuBNUgzVLGULn5NBFu1EwluBoML D91/hCf5NEhtoe1HtmJ3NzHstrmCLDX+4G8fcysZix374BwDyg2R8//8VugCmA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655930370; a=rsa-sha256; cv=none; b=kz/xACN4YKfJ0IUfM03ZL9cSpLvNwGl9niZkHrKZdXKt8Z2xvP3sIr7SfrF8fR128AdYCh Gyu2HuSfXPL/cmI26Fq+d+uIdDt69uAyeikaXWbNt1b5p2HmD3Du/9PyBAHob9KxruT9e1 FD3Zoqt2Lnx3tK9jzzDzpbP5Bd3qP+Veb+U7Hvk5fAe5YcRSulj1MopogXHy4ngh3mRJbV 769Z0S4INdGXLlhQf4bfCwOY6HyKS6sQ2qPOvfFVY2RN/FFOQ42T6vXoLk5Ob1zVSC0Eaw ckwJunj7m7ecy46y52KSwYNGJSR0dbTQnw1/M/FaLC7k4meZoJHxJzofxYfeKA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=aYX4BFOn; dmarc=pass (policy=none) header.from=gnu.org; 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: -3.86 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=aYX4BFOn; dmarc=pass (policy=none) header.from=gnu.org; 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: F1C683BF0D X-Spam-Score: -3.86 X-Migadu-Scanner: scn1.migadu.com X-TUID: 8TBH/3utoBqv Philip McGrath skribis: > 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. [...] > +++ b/gnu/home/services.scm > @@ -208,7 +208,7 @@ (define (environment-variables->setup-environment-scr= ipt vars) >=20=20 > case $XDG_DATA_DIRS in > *$HOME_ENVIRONMENT/profile/share*) ;; > - *) export XDG_DATA_DIRS=3D$HOME_ENVIRONMENT/profile/share:$XDG_DATA_DI= RS ;; > + *) export XDG_DATA_DIRS=3D$HOME_ENVIRONMENT/profile/share:${XDG_DATA_D= IRS:-/usr/local/share/:/usr/share/} ;; What about doing it this way: export "XDG_DATA_DIRS=3D$HOME_ENVIRONMENT/profile/share${XDG_DATA_DIRS:+:= }$XDG_DATA_DIRS" That would avoid adding /usr, which makes little sense for Guix and could lead to bad surprises on foreign distros, such as loading incompatible data from the host distro. WDYT? > case $XDG_CONFIG_DIRS in > *$HOME_ENVIRONMENT/profile/etc/xdg*) ;; > - *) export XDG_CONFIG_DIRS=3D$HOME_ENVIRONMENT/profile/etc/xdg:$XDG_CON= FIG_DIRS ;; > + *) export XDG_CONFIG_DIRS=3D$HOME_ENVIRONMENT/profile/etc/xdg:${XDG_CO= NFIG_DIRS:-/etc/xdg} ;; Same question here, though /etc/xdg is a bit less problematic as it could exist on Guix System too. Thanks, Ludo=E2=80=99.