[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/08: services: shepherd: Parameterize 'shepherd-service-back-edges'.
From: |
Ludovic Courtès |
Subject: |
06/08: services: shepherd: Parameterize 'shepherd-service-back-edges'. |
Date: |
Wed, 31 Aug 2016 14:14:00 +0000 (UTC) |
civodul pushed a commit to branch master
in repository guix.
commit 6673bddc9ae8f8835a8676cfb3ca0f5b9eb29405
Author: Ludovic Courtès <address@hidden>
Date: Wed Aug 31 15:16:36 2016 +0200
services: shepherd: Parameterize 'shepherd-service-back-edges'.
* gnu/services/shepherd.scm (shepherd-service-back-edges): Add
#:provision and #:requirement parameter. Honor them.
---
gnu/services/shepherd.scm | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index 3cfca85..426b0e7 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -268,11 +268,17 @@ procedure that takes a service and returns the list of
symbols it provides."
((_ . service) service)
(#f #f)))))
-(define (shepherd-service-back-edges services)
+(define* (shepherd-service-back-edges services
+ #:key
+ (provision shepherd-service-provision)
+ (requirement
shepherd-service-requirement))
"Return a procedure that, when given a <shepherd-service> from SERVICES,
-returns the list of <shepherd-service> that depend on it."
+returns the list of <shepherd-service> that depend on it.
+
+Use PROVISION and REQUIREMENT as one-argument procedures that return the
+symbols provided/required by a service."
(define provision->service
- (shepherd-service-lookup-procedure services))
+ (shepherd-service-lookup-procedure services provision))
(define edges
(fold (lambda (service edges)
@@ -280,7 +286,7 @@ returns the list of <shepherd-service> that depend on it."
(vhash-consq (provision->service requirement) service
edges))
edges
- (shepherd-service-requirement service)))
+ (requirement service)))
vlist-null
services))
- branch master updated (c180533 -> 7b44cae), Ludovic Courtès, 2016/08/31
- 04/08: services: shepherd: Add 'shepherd-service-lookup-procedure'., Ludovic Courtès, 2016/08/31
- 06/08: services: shepherd: Parameterize 'shepherd-service-back-edges'.,
Ludovic Courtès <=
- 01/08: doc: Fix 'ntp-service' typo., Ludovic Courtès, 2016/08/31
- 08/08: services: shepherd: Add 'shepherd-service-upgrade', from 'guix system'., Ludovic Courtès, 2016/08/31
- 07/08: guix system: Do not unload services depended on., Ludovic Courtès, 2016/08/31
- 02/08: services: herd: Provide <live-service> objects., Ludovic Courtès, 2016/08/31
- 03/08: guix system: Extract and test the service upgrade procedure., Ludovic Courtès, 2016/08/31
- 05/08: guix system: Use 'shepherd-service-lookup-procedure' in 'service-upgrade'., Ludovic Courtès, 2016/08/31