diff options
author | Leo Famulari <leo@famulari.name> | 2021-01-25 15:21:09 -0500 |
---|---|---|
committer | Leo Famulari <leo@famulari.name> | 2021-01-25 15:40:55 -0500 |
commit | 68dd78e2e47248b3e1e7ba1807a92a8374b39097 (patch) | |
tree | d38564293f285d688a55b23e8a6424c6b26213b1 /guix/utils.scm | |
parent | 8b55544212a90b0276df49596a3d373e5c2e8f5c (diff) | |
parent | 3f0af15131e524891df8c9f013f1be1597fe2d7e (diff) | |
download | guix-patches-68dd78e2e47248b3e1e7ba1807a92a8374b39097.tar guix-patches-68dd78e2e47248b3e1e7ba1807a92a8374b39097.tar.gz |
Merge branch 'master' into staging
Diffstat (limited to 'guix/utils.scm')
-rw-r--r-- | guix/utils.scm | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/guix/utils.scm b/guix/utils.scm index 0df46f1062..f8b05e7e80 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -110,7 +110,6 @@ edit-expression filtered-port - compressed-port decompressed-port call-with-decompressed-port compressed-output-port @@ -211,7 +210,13 @@ buffered data is lost." "Return the lzip port produced by calling PROC (a symbol) on PORT and ARGS. Raise an error if lzlib support is missing." (let ((make-port (module-ref (resolve-interface '(lzlib)) proc))) - (values (make-port port) '()))) + (make-port port))) + +(define (zstd-port proc port . args) + "Return the zstd port produced by calling PROC (a symbol) on PORT and ARGS. +Raise an error if zstd support is missing." + (let ((make-port (module-ref (resolve-interface '(zstd)) proc))) + (make-port port))) (define (decompressed-port compression input) "Return an input port where INPUT is decompressed according to COMPRESSION, @@ -223,17 +228,7 @@ a symbol such as 'xz." ('gzip (filtered-port `(,%gzip "-dc") input)) ('lzip (values (lzip-port 'make-lzip-input-port input) '())) - (_ (error "unsupported compression scheme" compression)))) - -(define (compressed-port compression input) - "Return an input port where INPUT is compressed according to COMPRESSION, -a symbol such as 'xz." - (match compression - ((or #f 'none) (values input '())) - ('bzip2 (filtered-port `(,%bzip2 "-c") input)) - ('xz (filtered-port `(,%xz "-c") input)) - ('gzip (filtered-port `(,%gzip "-c") input)) - ('lzip (values (lzip-port 'make-lzip-input-port/compressed input) + ('zstd (values (zstd-port 'make-zstd-input-port input) '())) (_ (error "unsupported compression scheme" compression)))) @@ -294,6 +289,8 @@ program--e.g., '(\"--fast\")." ('gzip (filtered-output-port `(,%gzip "-c" ,@options) output)) ('lzip (values (lzip-port 'make-lzip-output-port output) '())) + ('zstd (values (zstd-port 'make-zstd-output-port output) + '())) (_ (error "unsupported compression scheme" compression)))) (define* (call-with-compressed-output-port compression port proc |