From 739ab68bac4c5b15fee34d5938e3d7eee4735627 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 17 Oct 2015 13:02:53 +0200 Subject: http-client: Add 'http-fetch/cached'. * guix/utils.scm (cache-directory): New procedure. * guix/http-client.scm (%http-cache-ttl): New variable. (http-fetch/cached): New procedure. --- guix/utils.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'guix/utils.scm') diff --git a/guix/utils.scm b/guix/utils.scm index 0802a1b67a..190b787185 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -81,6 +81,7 @@ fold-tree fold-tree-leaves split + cache-directory filtered-port compressed-port @@ -703,6 +704,12 @@ elements after E." ((head . tail) (loop tail (cons head acc)))))) +(define (cache-directory) + "Return the cache directory for Guix, by default ~/.cache/guix." + (or (getenv "XDG_CONFIG_HOME") + (and=> (getenv "HOME") + (cut string-append <> "/.cache/guix")))) + ;;; ;;; Source location. -- cgit v1.2.3