From 030fa324859eb5b3e7b539c6e1dcbbb3fac1db4c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 29 Aug 2021 12:31:21 -0700 Subject: use UIOP:XDG-CACHE-HOME Signed-off-by: Sean Whitton --- src/connection/local.lisp | 3 +-- src/data.lisp | 4 +--- src/data/asdf.lisp | 4 +--- src/image.lisp | 4 +--- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/connection/local.lisp b/src/connection/local.lisp index abe6f01..53bfc20 100644 --- a/src/connection/local.lisp +++ b/src/connection/local.lisp @@ -72,5 +72,4 @@ (defmethod connection-connattr ((connection local-connection) (k (eql :XDG-CACHE-HOME))) - (ensure-directory-pathname (or (getenv "XDG_CACHE_HOME") - (strcat (getenv "HOME") "/.cache")))) + (uiop:xdg-cache-home)) diff --git a/src/data.lisp b/src/data.lisp index fe96809..fa814f0 100644 --- a/src/data.lisp +++ b/src/data.lisp @@ -470,9 +470,7 @@ properties, or data sources which return objects referencing existing files." :version (caddr triple)))) (defun get-local-data-cache-dir () - (ensure-directory-pathname - (strcat (or (getenv "XDG_CACHE_HOME") (strcat (getenv "HOME") "/.cache")) - "/consfigurator/data"))) + (merge-pathnames "consfigurator/data/" (uiop:xdg-cache-home))) ;;;; Passphrases diff --git a/src/data/asdf.lisp b/src/data/asdf.lisp index 83142c0..ee1385c 100644 --- a/src/data/asdf.lisp +++ b/src/data/asdf.lisp @@ -29,9 +29,7 @@ (defun get-path-to-system-tarball (iden1 system) (let* ((tarball (merge-pathnames (strcat "consfigurator/systems/" system ".tar.gz") - (ensure-directory-pathname - (or (getenv "XDG_CACHE_HOME") - (strcat (getenv "HOME") "/.cache"))))) + (uiop:xdg-cache-home))) (tarball-write-date (and (file-exists-p tarball) (file-write-date tarball)))) (multiple-value-bind (version files) (system-version-files system) diff --git a/src/image.lisp b/src/image.lisp index 8bc34b3..fc29179 100644 --- a/src/image.lisp +++ b/src/image.lisp @@ -327,9 +327,7 @@ ASDF-REQUIREMENTS, after having uploaded those Lisp systems using UPLOAD-ALL-PREREQUISITE-DATA.") (:method ((asdf-requirements asdf-requirements)) `(progn - (let* ((cache (ensure-directory-pathname - (or (getenv "XDG_CACHE_HOME") - (strcat (getenv "HOME") "/.cache")))) + (let* ((cache (uiop:xdg-cache-home)) (dest (ensure-directories-exist (merge-pathnames "consfigurator/systems/" cache))) (file (merge-pathnames -- cgit v1.2.3