mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-27 04:59:27 -05:00
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
1 changed files with 2 additions and 1 deletions
|
@ -808,7 +808,8 @@ (define (same? x)
|
|||
(define (cache-directory)
|
||||
"Return the cache directory for Guix, by default ~/.cache/guix."
|
||||
(or (getenv "XDG_CONFIG_HOME")
|
||||
(and=> (getenv "HOME")
|
||||
(and=> (or (getenv "HOME")
|
||||
(passwd:dir (getpwuid (getuid))))
|
||||
(cut string-append <> "/.cache/guix"))))
|
||||
|
||||
(define (readlink* file)
|
||||
|
|
Loading…
Reference in a new issue