channels: Compute a package cache and use it.
authorLudovic Courtès <ludo@gnu.org>
Fri, 11 Jan 2019 16:23:39 +0000 (17:23 +0100)
committerLudovic Courtès <ludo@gnu.org>
Tue, 15 Jan 2019 19:24:09 +0000 (20:24 +0100)
commit5fbdc9a5aa63fd51c65d30fe3d30608d01fe1bc8
treeab2940f0c7250e8267609e3db9f6e4b517bd0546
parent1d90e9d7c906b1e9e94d1642bfd60c51609fd0df
channels: Compute a package cache and use it.

* gnu/packages.scm (cache-is-authoritative?, load-package-cache)
(cache-lookup, generate-package-cache): New procedures.
(%package-cache-file): New variable.
(find-packages-by-name): Rename to...
(find-packages-by-name/direct): ... this.
(find-packages-by-name): Rewrite to use the package cache when
'cache-is-authoritative?' returns true.
* tests/packages.scm ("find-packages-by-name + version, with cache")
("find-packages-by-name with cache"): New tests.
* guix/channels.scm (package-cache-file): New procedure.
(%channel-profile-hooks): New variable.
(channel-instances->derivation): Use it in #:hooks.
* guix/scripts/package.scm (build-and-use-profile): Add #:hooks and
honor it.
* guix/scripts/pull.scm (build-and-install): Pass #:hooks to
UPDATE-PROFILE.
gnu/packages.scm
guix/channels.scm
guix/scripts/package.scm
guix/scripts/pull.scm
tests/packages.scm