diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-03-12 14:38:10 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-03-12 15:59:46 +0100 |
commit | a04aef2430645357d7796969d4b6453478ff8a3f (patch) | |
tree | bb6154a00c10ab3690ddace7987f6133a375c4f0 /guix | |
parent | 97b45977f49470d70070b2ae4c66c5b802b172a1 (diff) |
utils: Use Guile-zlib for gzip compression and decompression.
Fixes <https://bugs.gnu.org/46967>.
* guix/utils.scm (decompressed-port): Call 'make-zlib-input-port'
instead of invoking %GZIP.
(compressed-output-port): Call 'make-zlib-output-port' instead of
invoking %GZIP.
* doc/guix.texi (Requirements): Require Guile-zlib >= 0.1.0.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/utils.scm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/guix/utils.scm b/guix/utils.scm index 1625cab19b..21e3460b2c 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -45,6 +45,7 @@ #:use-module (ice-9 match) #:use-module (ice-9 format) #:use-module ((ice-9 iconv) #:prefix iconv:) + #:autoload (zlib) (make-zlib-input-port make-zlib-output-port) #:use-module (system foreign) #:re-export (<location> ;for backwards compatibility location @@ -231,7 +232,8 @@ a symbol such as 'xz." ((or #f 'none) (values input '())) ('bzip2 (filtered-port `(,%bzip2 "-dc") input)) ('xz (filtered-port `(,%xz "-dc") input)) - ('gzip (filtered-port `(,%gzip "-dc") input)) + ('gzip (values (make-zlib-input-port input #:format 'gzip) + '())) ('lzip (values (lzip-port 'make-lzip-input-port input) '())) ('zstd (values (zstd-port 'make-zstd-input-port input) @@ -292,7 +294,8 @@ program--e.g., '(\"--fast\")." ((or #f 'none) (values output '())) ('bzip2 (filtered-output-port `(,%bzip2 "-c" ,@options) output)) ('xz (filtered-output-port `(,%xz "-c" ,@options) output)) - ('gzip (filtered-output-port `(,%gzip "-c" ,@options) output)) + ('gzip (values (make-zlib-output-port output #:format 'gzip) + '())) ('lzip (values (lzip-port 'make-lzip-output-port output) '())) ('zstd (values (zstd-port 'make-zstd-output-port output) |