~ruther/guix-local

dd1d09f7e4c522d2185eda9c806ea525e10172be — Ludovic Courtès 10 years ago cd76fbd
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.
1 files changed, 2 insertions(+), 1 deletions(-)

M guix/utils.scm
M guix/utils.scm => guix/utils.scm +2 -1
@@ 808,7 808,8 @@ elements after E."
(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)