services: guix-publish: Remove 'compression-level' field.

* gnu/services/base.scm (<guix-publish-configuration>)[compression-level]: Remove field.
(guix-publish-configuration-compression-level): Remove procedure.
(default-compression): Remove compression-level helper code.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Bruno Victal 2023-02-27 00:11:40 +00:00 committed by Ludovic Courtès
parent 189d30d727
commit d442b77596
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -223,7 +223,6 @@ (define-module (gnu services base)
guix-publish-configuration-port guix-publish-configuration-port
guix-publish-configuration-host guix-publish-configuration-host
guix-publish-configuration-compression guix-publish-configuration-compression
guix-publish-configuration-compression-level ;deprecated
guix-publish-configuration-nar-path guix-publish-configuration-nar-path
guix-publish-configuration-cache guix-publish-configuration-cache
guix-publish-configuration-ttl guix-publish-configuration-ttl
@ -1986,10 +1985,7 @@ (define-record-type* <guix-publish-configuration>
(default #f)) (default #f))
(compression guix-publish-configuration-compression (compression guix-publish-configuration-compression
(thunked) (thunked)
(default (default-compression this-record (default (default-compression this-record)))
(current-source-location))))
(compression-level %guix-publish-configuration-compression-level ;deprecated
(default #f))
(nar-path guix-publish-configuration-nar-path ;string (nar-path guix-publish-configuration-nar-path ;string
(default "nar")) (default "nar"))
(cache guix-publish-configuration-cache ;#f | string (cache guix-publish-configuration-cache ;#f | string
@ -2003,25 +1999,14 @@ (define-record-type* <guix-publish-configuration>
(negative-ttl guix-publish-configuration-negative-ttl ;#f | integer (negative-ttl guix-publish-configuration-negative-ttl ;#f | integer
(default #f))) (default #f)))
(define-deprecated (guix-publish-configuration-compression-level config) (define (default-compression config)
"Return a compression level, the old way."
(match (guix-publish-configuration-compression config)
(((_ level) _ ...) level)))
(define (default-compression config properties)
"Return the default 'guix publish' compression according to CONFIG, and "Return the default 'guix publish' compression according to CONFIG, and
raise a deprecation warning if the 'compression-level' field was used." raise a deprecation warning if the 'compression-level' field was used."
(match (%guix-publish-configuration-compression-level config) ;; Default to low compression levels when there's no cache so that users
(#f ;; get good bandwidth by default.
;; Default to low compression levels when there's no cache so that users (if (guix-publish-configuration-cache config)
;; get good bandwidth by default. '(("gzip" 5) ("zstd" 19))
(if (guix-publish-configuration-cache config) '(("gzip" 3) ("zstd" 3)))) ;zstd compresses faster
'(("gzip" 5) ("zstd" 19))
'(("gzip" 3) ("zstd" 3)))) ;zstd compresses faster
(level
(warn-about-deprecation 'compression-level properties
#:replacement 'compression)
`(("gzip" ,level)))))
(define (guix-publish-shepherd-service config) (define (guix-publish-shepherd-service config)
(define (config->compression-options config) (define (config->compression-options config)