utils: 'cache-directory' gracefully deals with unset 'HOME'.
Fixes <http://bugs.gnu.org/23165>. * guix/utils.scm (cache-directory): Use 'getpwuid' when 'HOME' is unset.
This commit is contained in:
parent
cd76fbde6f
commit
dd1d09f7e4
|
@ -808,7 +808,8 @@ elements after E."
|
||||||
(define (cache-directory)
|
(define (cache-directory)
|
||||||
"Return the cache directory for Guix, by default ~/.cache/guix."
|
"Return the cache directory for Guix, by default ~/.cache/guix."
|
||||||
(or (getenv "XDG_CONFIG_HOME")
|
(or (getenv "XDG_CONFIG_HOME")
|
||||||
(and=> (getenv "HOME")
|
(and=> (or (getenv "HOME")
|
||||||
|
(passwd:dir (getpwuid (getuid))))
|
||||||
(cut string-append <> "/.cache/guix"))))
|
(cut string-append <> "/.cache/guix"))))
|
||||||
|
|
||||||
(define (readlink* file)
|
(define (readlink* file)
|
||||||
|
|
Loading…
Reference in New Issue