[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 01/01: service: 'conflicts-with' returns a list of services.
From: |
Alex Kost |
Subject: |
[shepherd] 01/01: service: 'conflicts-with' returns a list of services. |
Date: |
Wed, 27 Jan 2016 08:51:26 +0000 |
alezost pushed a commit to branch master
in repository shepherd.
commit 88c6a20b895c41b8998ee298165e82dcba2d16e8
Author: Alex Kost <address@hidden>
Date: Tue Jan 26 12:12:41 2016 +0300
service: 'conflicts-with' returns a list of services.
This fixes a regression introduced in commit
cb168150d4581ffbc357ab6cdcd45d59051ee821.
If 'conflicts-with' returns a list of names, 'conflicts-with-running'
fails because 'running?' cannot be applied to a symbol.
* modules/shepherd/service.scm (conflicts-with): Return a list of
services instead of names.
(start): Adjust accordingly.
---
modules/shepherd/service.scm | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 467e5eb..1b37d96 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -287,7 +287,8 @@ wire."
((let ((conflicts (conflicts-with-running obj)))
(or (null? conflicts)
(local-output "Service ~a conflicts with running services ~a."
- (canonical-name obj) conflicts))
+ (canonical-name obj)
+ (map canonical-name conflicts)))
(not (null? conflicts)))
#f) ;; Dummy.
(else
@@ -451,21 +452,20 @@ wire."
;; FIXME: Implement doc-help.
(local-output "Unknown keyword. Try 'doc root help'.")))))
-;; Return a list of canonical names of the services that conflict with
-;; OBJ.
+;; Return a list of services that conflict with OBJ.
(define-method (conflicts-with (obj <service>))
(delete-duplicates
(append-map (lambda (sym)
(filter-map (lambda (service)
(and (not (eq? service obj))
- (canonical-name service)))
+ service))
(lookup-services sym)))
(provided-by obj))
eq?))
;; Check if this service provides a symbol that is already provided
-;; by any other running services. If so, return the canonical names
-;; of the other services. Otherwise, return the empty list.
+;; by any other running services. If so, return these services.
+;; Otherwise, return the empty list.
(define-method (conflicts-with-running (obj <service>))
(filter running? (conflicts-with obj)))