substitute: Add zstd support.

* guix/scripts/substitute.scm (%compression-methods): Add zstd.
(compresses-better?): "lzip" always wins.
This commit is contained in:
Ludovic Courtès 2020-12-27 12:34:27 +01:00
parent d288a4de7d
commit 016299d859
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

@ -944,6 +944,8 @@ authorized substitutes."
;; supported. See 'decompressed-port' in (guix utils).
`(("gzip" . ,(const #t))
("lzip" . ,(const #t))
("zstd" . ,(lambda ()
(resolve-module '(zstd) #t #f #:ensure #f)))
("xz" . ,(const #t))
("bzip2" . ,(const #t))
("none" . ,(const #t))))
@ -961,6 +963,7 @@ this is a rough approximation."
(match compression1
("none" #f)
("gzip" (string=? compression2 "none"))
("lzip" #t)
(_ (or (string=? compression2 "none")
(string=? compression2 "gzip")))))