mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
services: herd: Remove workaround for Shepherd < 0.5.0.
* gnu/services/herd.scm (load-services/safe): Remove workaround for Shepherd < 0.5.0, released in 2018.
This commit is contained in:
parent
67a7eaa13d
commit
547965aa27
1 changed files with 7 additions and 17 deletions
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2016-2019, 2022 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2016-2019, 2022-2023 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2017, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
|
;;; Copyright © 2017, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
|
@ -284,22 +284,12 @@ (define (load-services files)
|
||||||
|
|
||||||
(define (load-services/safe files)
|
(define (load-services/safe files)
|
||||||
"This is like 'load-services', but make sure only the subset of FILES that
|
"This is like 'load-services', but make sure only the subset of FILES that
|
||||||
can be safely reloaded is actually reloaded.
|
can be safely reloaded is actually reloaded."
|
||||||
|
(eval-there `(let ((services (map primitive-load ',files)))
|
||||||
This is done to accommodate the Shepherd < 0.15.0 where services lacked the
|
;; Since version 0.5.0 of the Shepherd, registering a service
|
||||||
'replacement' slot, and where 'register-services' would throw an exception
|
;; that has the same name as an already-registered service
|
||||||
when passed a service with an already-registered name."
|
;; makes it a "replacement" of that previous service.
|
||||||
(eval-there `(let* ((services (map primitive-load ',files))
|
(apply register-services services))))
|
||||||
(slots (map slot-definition-name
|
|
||||||
(class-slots <service>)))
|
|
||||||
(can-replace? (memq 'replacement slots)))
|
|
||||||
(define (registered? service)
|
|
||||||
(not (null? (lookup-services (canonical-name service)))))
|
|
||||||
|
|
||||||
(apply register-services
|
|
||||||
(if can-replace?
|
|
||||||
services
|
|
||||||
(remove registered? services))))))
|
|
||||||
|
|
||||||
(define* (start-service name #:optional (arguments '()))
|
(define* (start-service name #:optional (arguments '()))
|
||||||
(invoke-action name 'start arguments
|
(invoke-action name 'start arguments
|
||||||
|
|
Loading…
Reference in a new issue