From 5bafc70d1e1daf6a91e8bf29a464263262505f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 8 Jun 2020 22:46:06 +0200 Subject: channels: Make 'validate-pull' call right after clone/pull. This should come before patching, authentication, etc. * guix/channels.scm (latest-channel-instance): Add #:validate-pull parameter and honor it. Return a single value: the instance. (ensure-forward-channel-update): Change 'instance' parameter to 'commit' and adjust accordingly. (latest-channel-instances): Adjust to 'latest-channel-instance' changes. * guix/scripts/pull.scm (warn-about-backward-updates): Change 'instance' parameter to 'commit' and adjust accordingly. * tests/channels.scm ("latest-channel-instances #:validate-pull"): Likewise. --- tests/channels.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/channels.scm b/tests/channels.scm index 2c857083e9..5f13a48ec1 100644 --- a/tests/channels.scm +++ b/tests/channels.scm @@ -212,12 +212,12 @@ (commit (oid->string (commit-id commit2))))) (old (channel (inherit spec) (commit (oid->string (commit-id commit1)))))) - (define (validate-pull channel current instance relation) + (define (validate-pull channel current commit relation) (return (and (eq? channel old) (string=? (oid->string (commit-id commit2)) current) (string=? (oid->string (commit-id commit1)) - (channel-instance-commit instance)) + commit) relation))) (with-store store -- cgit v1.2.1