summaryrefslogtreecommitdiff
path: root/guix/scripts/publish.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-07-19 16:46:16 +0200
committerLudovic Courtès <ludo@gnu.org>2016-07-19 16:47:19 +0200
commit053fa76ae7bb579fe5fc9dedfc492411e6804cf0 (patch)
tree954911a5d1e748aee3b49c8d6766a110df44e165 /guix/scripts/publish.scm
parent72fb1b24d904ad63a11c3850899cfd5e157b76e2 (diff)
publish: Keep compression disabled when zlib is missing.
Reported by David Thompson. * guix/scripts/publish.scm (%options)[--compression]: Warn if LEVEL > 0 and zlib is missing, and return RESULT.
Diffstat (limited to 'guix/scripts/publish.scm')
-rw-r--r--guix/scripts/publish.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
index 3e1ecb9d1b..3baceaf645 100644
--- a/guix/scripts/publish.scm
+++ b/guix/scripts/publish.scm
@@ -127,8 +127,14 @@ Publish ~a over HTTP.\n") %store-directory)
(0
(alist-cons 'compression %no-compression result))
(level
- (alist-cons 'compression (compression 'gzip level)
- result)))))
+ (if (zlib-available?)
+ (alist-cons 'compression
+ (compression 'gzip level)
+ result)
+ (begin
+ (warning (_ "zlib support is missing; \
+compression disabled~%"))
+ result))))))
(option '("ttl") #t #f
(lambda (opt name arg result)
(let ((duration (string->duration arg)))