channels: 'latest-channel-instances' guards against non-forward updates.
authorLudovic Courtès <ludo@gnu.org>
Wed, 20 May 2020 20:15:54 +0000 (22:15 +0200)
committerLudovic Courtès <ludo@gnu.org>
Sun, 24 May 2020 22:00:28 +0000 (00:00 +0200)
commit872898f768ae6d3b41eb93c5e183624bd1d157ff
treed88d5ff215bedffeba951ddf35b8cc0e4489a253
parent8d1d56578aa95118650ed2197bfb7fac40f4218a
channels: 'latest-channel-instances' guards against non-forward updates.

* guix/channels.scm (latest-channel-instance): Add #:starting-commit and
pass it to 'update-cached-checkout'.  Return the commit relation as a
second value.
(ensure-forward-channel-update): New procedure.
(latest-channel-instances): Add #:current-channels and #:validate-pull.
[current-commit]: New procedure.
Pass #:starting-commit to 'latest-channel-instance'.  When the returned
relation is true, call VALIDATE-PULL.
(latest-channel-derivation): Add #:current-channels and #:validate-pull.
Pass them to 'latest-channel-instances*'.
* tests/channels.scm ("latest-channel-instances #:validate-pull"): New
test.
guix/channels.scm
tests/channels.scm