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.
This commit is contained in:
Ludovic Courtès 2016-07-19 16:46:16 +02:00
parent 72fb1b24d9
commit 053fa76ae7
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

@ -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)))