From 838ac881ec98cb71d4a4e4b20773573f99ecbf25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 16 Jun 2020 15:33:57 +0200 Subject: time-machine: Add '--disable-authentication'. * guix/inferior.scm (cached-channel-instance): Add #:authenticate? and pass it to 'latest-channel-instances'. * guix/scripts/time-machine.scm (show-help, %options): Add '--disable-authentication'. (%default-options): Add 'authenticate-channels?'. (guix-time-machine): Honor it. --- guix/inferior.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'guix/inferior.scm') diff --git a/guix/inferior.scm b/guix/inferior.scm index c9a5ee5129..d347754bbc 100644 --- a/guix/inferior.scm +++ b/guix/inferior.scm @@ -687,13 +687,16 @@ failing when GUIX is too old and lacks the 'guix repl' command." (define* (cached-channel-instance store channels #:key + (authenticate? #t) (cache-directory (%inferior-cache-directory)) (ttl (* 3600 24 30))) "Return a directory containing a guix filetree defined by CHANNELS, a list of channels. The directory is a subdirectory of CACHE-DIRECTORY, where entries can be reclaimed after TTL seconds. -This procedure opens a new connection to the build daemon." +This procedure opens a new connection to the build daemon. AUTHENTICATE? +determines whether CHANNELS are authenticated." (define instances - (latest-channel-instances store channels)) + (latest-channel-instances store channels + #:authenticate? authenticate?)) (define key (bytevector->base32-string @@ -732,6 +735,8 @@ This procedure opens a new connection to the build daemon." (mbegin %store-monad (show-what-to-build* (list profile)) (built-derivations (list profile)) + ;; Note: Caching is fine even when AUTHENTICATE? is false because + ;; we always call 'latest-channel-instances?'. (symlink* (derivation->output-path profile) cached) (add-indirect-root* cached) (return cached)))))) -- cgit v1.2.3