diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-28 15:54:18 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-31 15:55:26 -0700 |
commit | 1f12dfda4aeb6d08af454d60caa5985b2bd5b1ba (patch) | |
tree | 74ed16275286479a2c9aee411138b41d1d065746 /src/connection.lisp | |
parent | a2f6906904352b1ba6309893f9969e22597009d2 (diff) | |
download | consfigurator-1f12dfda4aeb6d08af454d60caa5985b2bd5b1ba.tar.gz |
cache XDG_CACHE_HOME as a connattr
This should provide a performance improvement.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection.lisp')
-rw-r--r-- | src/connection.lisp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/connection.lisp b/src/connection.lisp index 782160a..9c1a291 100644 --- a/src/connection.lisp +++ b/src/connection.lisp @@ -227,6 +227,12 @@ login(1)). Tilde expansion works correctly." (failed-change "Failed to determine remote home directory.") (ensure-directory-pathname (stripln home))))) +(defmethod connection-connattr + ((connection connection) (k (eql :XDG-CACHE-HOME))) + (ensure-directory-pathname + (stripln + (connection-run connection "echo ${XDG_CACHE_HOME:-$HOME/.cache}" nil)))) + ;;;; Functions to access the slots of the current connection @@ -556,7 +562,7 @@ specification of POSIX ls(1))." (defun remote-consfigurator-cache-pathname (path) (merge-pathnames - path (car (runlines "echo ${XDG_CACHE_HOME:-$HOME/.cache}/consfigurator/")))) + path (merge-pathnames "consfigurator/" (get-connattr :XDG-CACHE-HOME)))) (defun readfile (path) (connection-readfile |