aboutsummaryrefslogtreecommitdiff
path: root/guix/channels.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-02-02 09:37:33 +0100
committerLudovic Courtès <ludo@gnu.org>2021-02-04 09:23:39 +0100
commit29009fdb2d3636eafa77b406da2430b08a22d47e (patch)
treeecc24688dab77692813434501162dd7e69dddabe /guix/channels.scm
parent8ecc265c5c6519986758567682726647850d5d03 (diff)
downloadguix-29009fdb2d3636eafa77b406da2430b08a22d47e.tar
guix-29009fdb2d3636eafa77b406da2430b08a22d47e.tar.gz
channels: Consider the current channel commit as authentic.
Fixes <https://bugs.gnu.org/45895>. When the ~/.cache/guix/authentication is empty, this change allows authentication to start at the current commit, as shown by 'guix describe', instead of starting from the introductory commit, which would take more and more time (there's currently 18K commits per year). * guix/git-authenticate.scm (authenticate-repository): Add #:authentic-commits. [authenticated-commits]: Append it. * guix/channels.scm (authenticate-channel)[authentic-commits]: New variable. Pass it to 'authenticate-repository'.
Diffstat (limited to 'guix/channels.scm')
-rw-r--r--guix/channels.scm14
1 files changed, 14 insertions, 0 deletions
diff --git a/guix/channels.scm b/guix/channels.scm
index 3cc3b4c438..05226e766b 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -47,6 +47,7 @@
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-34)
#:use-module (srfi srfi-35)
+ #:autoload (guix describe) (current-channels) ;XXX: circular dep
#:autoload (guix self) (whole-package make-config.scm)
#:autoload (guix inferior) (gexp->derivation-in-inferior) ;FIXME: circular dep
#:autoload (guix quirks) (%quirks %patches applicable-patch? apply-patch)
@@ -344,6 +345,18 @@ commits)...~%")
(progress-reporter/bar (length commits)))
+ (define authentic-commits
+ ;; Consider the currently-used commit of CHANNEL as authentic so
+ ;; authentication can skip it and all its closure.
+ (match (find (lambda (candidate)
+ (eq? (channel-name candidate) (channel-name channel)))
+ (current-channels))
+ (#f '())
+ (channel
+ (if (channel-commit channel)
+ (list (channel-commit channel))
+ '()))))
+
;; XXX: Too bad we need to re-open CHECKOUT.
(with-repository checkout repository
(authenticate-repository repository
@@ -354,6 +367,7 @@ commits)...~%")
#:keyring-reference
(string-append keyring-reference-prefix
keyring-reference)
+ #:authentic-commits authentic-commits
#:make-reporter make-reporter
#:cache-key cache-key)))