aboutsummaryrefslogtreecommitdiff
path: root/nix/libutil
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-05-31 16:26:08 +0200
committerLudovic Courtès <ludo@gnu.org>2019-06-02 22:01:57 +0200
commitb90ae065b5a5fab4ed475bf2faa3a84476389a02 (patch)
tree306c6a49fbeb2e87d77dd2d023cc0c2a94a34afd /nix/libutil
parentb8fa86adfc01205f1d942af8cb57515eb3726c52 (diff)
downloadguix-b90ae065b5a5fab4ed475bf2faa3a84476389a02.tar
guix-b90ae065b5a5fab4ed475bf2faa3a84476389a02.tar.gz
substitute: Select the best compression methods.
When a server publishes several URLs with different compression methods, 'guix substitute' can now choose the best one among the compression methods that it supports. * guix/scripts/substitute.scm (<narinfo>)[uri]: Replace with... [uris]: ... this. [compression]: Replace with... [compressions]: ... this. [file-size]: Replace with... [file-sizes]: ... this. [file-hash]: Replace with... [file-hashes]: ... this. (narinfo-maker): Adjust accordingly. Ensure 'file-sizes' and 'file-hashes' have the right length. (assert-valid-signature, valid-narinfo?): Use the first element of 'narinfo-uris' in error messages. (read-narinfo): Expect "URL", "Compression", "FileSize", and "FileHash" to occur multiple times. (display-narinfo-data): Call 'select-uri' to determine the file size. (%compression-methods): New variable. (supported-compression?, compresses-better?, select-uri): New procedures. (process-substitution): Call 'select-uri' to select the URI and compression. * guix/scripts/weather.scm (report-server-coverage): Account for all the values returned by 'narinfo-file-sizes'. * tests/substitute.scm ("substitute, narinfo with several URLs"): New test.
Diffstat (limited to 'nix/libutil')
0 files changed, 0 insertions, 0 deletions