~ruther/guix-local

934c5d5b28f74ab2fe187ad727e4b56cfda6def8 — Ludovic Courtès 9 years ago 25a3bfb
utils: 'cache-directory' always appends "/guix".

Fixes <http://bugs.gnu.org/23836>.
Fixes a regression introduced in f10dcbf1a92c147a2fedba6f774afa6a7013fcdf.
Reported by myglc2 <myglc2@gmail.com>.

* guix/utils.scm (cache-directory): Always append "/guix".
1 files changed, 5 insertions(+), 4 deletions(-)

M guix/utils.scm
M guix/utils.scm => guix/utils.scm +5 -4
@@ 637,10 637,11 @@ output port, and PROC's result is returned."

(define (cache-directory)
  "Return the cache directory for Guix, by default ~/.cache/guix."
  (or (getenv "XDG_CACHE_HOME")
      (and=> (or (getenv "HOME")
                 (passwd:dir (getpwuid (getuid))))
             (cut string-append <> "/.cache/guix"))))
  (string-append (or (getenv "XDG_CACHE_HOME")
                     (and=> (or (getenv "HOME")
                                (passwd:dir (getpwuid (getuid))))
                            (cut string-append <> "/.cache")))
                 "/guix"))

(define (readlink* file)
  "Call 'readlink' until the result is not a symlink."