>From 9ce0f8b9ba720d21eca43fdb9b2ce749079a305b Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Tue, 26 Jan 2016 12:12:41 +0300 Subject: [PATCH] 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 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm index 94f2aae..f8eb76c 100644 --- a/modules/shepherd/service.scm +++ b/modules/shepherd/service.scm @@ -277,7 +277,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 @@ -445,21 +446,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 )) (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 )) (filter running? (conflicts-with obj))) -- 2.6.3