guix-play/guix/scripts
Ludovic Courtès a9468b422b
substitute: Download from unauthorized sources that provide the right content.
This allows substitutes to be downloaded from unauthorized servers, as
long as they advertise the same hash and references as one of the
authorized servers.

* guix/scripts/substitute.scm (assert-valid-narinfo): Remove.
(valid-narinfo?): Add #:verbose?.  Handle each case of
'signature-case'.
(equivalent-narinfo?): New procedure.
(lookup-narinfos/diverse): Add 'authorized?' parameter and honor it.
[select-hit]: New procedure.
(lookup-narinfo): Add 'authorized?' parameter and pass it.
(process-query): Adjust callers accordingly.
(process-substitution): Remove call to 'assert-valid-narinfo'.  Check
whether 'lookup-narinfo' returns true and call 'leave' if not.
* tests/substitute.scm (%main-substitute-directory)
(%alternate-substitute-directory): New variables.
(call-with-narinfo): Make 'narinfo-directory' a parameter.  Call
'mkdir-p' to create it.  Change unwind handler to check whether
CACHE-DIRECTORY exists before deleting it.
(with-narinfo*): New macro.
("substitute, no signature")
("substitute, invalid hash")
("substitute, unauthorized key"): Change expected error message to "no
valid substitute".
("substitute, unauthorized narinfo comes first")
("substitute, unsigned narinfo comes first")
("substitute, first narinfo is unsigned and has wrong hash")
("substitute, first narinfo is unsigned and has wrong refs")
("substitute, unsigned narinfo comes first")
("substitute, two invalid narinfos"): New tests.
* doc/guix.texi (Substitutes): Explain the new behavior.
2017-09-11 11:10:21 +02:00
..
container ui: Rename '_' to 'G_'. 2017-05-03 16:16:17 +02:00
import guix: Add texlive importer. 2017-06-15 17:03:19 +02:00
archive.scm scripts: Remove 'max-silent-time' from the default options. 2017-09-01 10:29:39 +02:00
authenticate.scm ui: Rename '_' to 'G_'. 2017-05-03 16:16:17 +02:00
build.scm derivations: Introduce 'read-derivation-from-file'. 2017-06-12 17:53:51 +02:00
challenge.scm ui: Rename '_' to 'G_'. 2017-05-03 16:16:17 +02:00
container.scm ui: Rename '_' to 'G_'. 2017-05-03 16:16:17 +02:00
copy.scm scripts: Remove 'max-silent-time' from the default options. 2017-09-01 10:29:39 +02:00
download.scm guix download: Support retrieving local file without the URI scheme. 2017-08-20 20:55:45 +08:00
edit.scm ui: Rename '_' to 'G_'. 2017-05-03 16:16:17 +02:00
environment.scm scripts: Remove 'max-silent-time' from the default options. 2017-09-01 10:29:39 +02:00
gc.scm syscalls: Provide 'free-disk-space'. 2017-06-02 18:47:07 +02:00
graph.scm derivations: Introduce 'read-derivation-from-file'. 2017-06-12 17:53:51 +02:00
hash.scm ui: Rename '_' to 'G_'. 2017-05-03 16:16:17 +02:00
import.scm guix: Add texlive importer. 2017-06-15 17:03:19 +02:00
lint.scm Handle the same HTTP redirects everywhere. 2017-09-05 20:57:13 +02:00
offload.scm offload: Fix potential file descriptor and memory leak. 2017-07-25 23:24:16 +02:00
pack.scm scripts: Remove 'max-silent-time' from the default options. 2017-09-01 10:29:39 +02:00
package.scm scripts: Remove 'max-silent-time' from the default options. 2017-09-01 10:29:39 +02:00
perform-download.scm derivations: Introduce 'read-derivation-from-file'. 2017-06-12 17:53:51 +02:00
publish.scm publish: Make the cache eviction policy less aggressive. 2017-07-21 17:03:25 +02:00
pull.scm scripts: Remove 'max-silent-time' from the default options. 2017-09-01 10:29:39 +02:00
refresh.scm refresh: Be more verbose when passed an explicit package list. 2017-06-24 23:28:23 +02:00
size.scm size: Default to '--sort=self'. 2017-09-07 13:57:42 +02:00
substitute.scm substitute: Download from unauthorized sources that provide the right content. 2017-09-11 11:10:21 +02:00
system.scm scripts: Remove 'max-silent-time' from the default options. 2017-09-01 10:29:39 +02:00
weather.scm weather: Show "-m" option in help message. 2017-07-27 11:47:50 +02:00