From 6edc86b44547295d475f98183f604a6c915c9082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 7 Sep 2023 18:00:28 +0200 Subject: Remove xdg sysconfdir. It was based on a missunderstanding of the spec. `sysconfdir` is mentioned, but only as an element of XDG_CONFIG_DIR. --- module/calp/load-config.scm | 9 ++++++--- module/xdg/basedir.scm | 10 +--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/module/calp/load-config.scm b/module/calp/load-config.scm index 5844c1b6..0ce1f131 100644 --- a/module/calp/load-config.scm +++ b/module/calp/load-config.scm @@ -43,8 +43,11 @@ ;; altconfig could be placed in the list below. But I want to raise an error ;; if an explicitly given config is missing. [(find file-exists? - (list - (path-append (xdg-config-home) "calp" "config.scm") - (path-append (xdg-sysconfdir) "calp" "config.scm"))) + (let ((end '("calp" "config.scm"))) + `(,(apply path-append (xdg-config-home) end) + ,@(map (lambda (sysconfdir) + (apply path-append sysconfdir end)) + (xdg-config-dirs)) + ,(apply path-append "/etc" end)))) => identity]) ) diff --git a/module/xdg/basedir.scm b/module/xdg/basedir.scm index 92a5c7d9..664f58e3 100644 --- a/module/xdg/basedir.scm +++ b/module/xdg/basedir.scm @@ -3,7 +3,7 @@ ;;; Code: (define-module (xdg basedir) - :export (sysconfdir runtime-dir + :export (runtime-dir data-home config-home cache-home data-dirs config-dirs)) @@ -28,14 +28,6 @@ (parse-path str) '("/usr/local/share" "/usr/share")))) -;;; sysconfdir -;;; /etc -;;; Techincly not part of the standard, but it's mentioned -(define (sysconfdir) - (or (getenv "sysconfdir") - "/etc")) - - ;;; XDG_CONFIG_DIRS ;;; colon (:) separated, in adddition to XDG_CONFIG_HOME ;;; /etc/xdg -- cgit v1.2.3