all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: guix-devel@gnu.org
Subject: [PATCH 1/5] service: Rename 'services' variable to '%services'.
Date: Sun, 24 Jan 2016 18:33:07 +0300	[thread overview]
Message-ID: <1453649591-3478-2-git-send-email-alezost@gmail.com> (raw)
In-Reply-To: <1453649591-3478-1-git-send-email-alezost@gmail.com>

* modules/shepherd/service.scm (services): Rename to...
(%services): ... this.
(for-each-service, service-list, find-service, lookup-services,
register-services, deregister-service): Adjust accordingly.
---
 modules/shepherd/service.scm | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 64d56ef..808372c 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -806,7 +806,7 @@ given USER and/or GROUP to run COMMAND."
 ;;; Registered services.
 
 ;; All registered services.
-(define services (make-hash-table 75))
+(define %services (make-hash-table 75))
 
 ;;; Perform actions with services:
 
@@ -816,14 +816,14 @@ given USER and/or GROUP to run COMMAND."
 	       (and (eq? key (canonical-name (car value)))
 		    (proc (car value))))
 	     #f ;; Unused
-	     services))
+	     %services))
 
 (define (service-list)
   "Return the list of services currently defined."
   (hash-fold (lambda (key services result)
                (append services result))
              '()
-             services))
+             %services))
 
 (define (find-service pred)
   "Return the first service that matches PRED, or #f if none was found."
@@ -833,13 +833,13 @@ given USER and/or GROUP to run COMMAND."
                   (and=> (find pred services)
                          return))
                 #f
-                services)
+                %services)
      #f)))
 
 ;; Lookup the services that provide NAME.  Returns a (possibly empty)
 ;; list of those.
 (define (lookup-services name)
-  (hashq-ref services name '()))
+  (hashq-ref %services name '()))
 
 (define waitpid*
   (let ((waitpid (EINTR-safe waitpid)))
@@ -931,7 +931,7 @@ otherwise by updating its state."
     (for-each (lambda (name)
 		(let ((old (lookup-services name)))
 		  ;; Actually add the new service now.
-		  (hashq-set! services name (cons new old))))
+		  (hashq-set! %services name (cons new old))))
 	      (provided-by new)))
 
   (for-each register-single-service new-services))
@@ -953,9 +953,9 @@ requested to be removed."
        (let ((old (lookup-services name)))
          (if (= 1 (length old))
              ;; Only service provides this service; remove it.
-             (hashq-remove! services name)
+             (hashq-remove! %services name)
              ;; ELSE: remove service from providing services.
-             (hashq-set! services name
+             (hashq-set! %services name
                          (remove
                           (lambda (lk-service)
                             (eq? (canonical-name service)
@@ -973,7 +973,7 @@ requested to be removed."
                        (not (eq? key 'dmd))
                        (cons key service)))
                  (_ #f)))               ; all other cases: #f.
-             services)))
+             %services)))
 
   (let ((name (string->symbol service-name)))
     (cond ((eq? name 'all)
-- 
2.6.3

  reply	other threads:[~2016-01-24 15:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-24 15:33 [SHEPHERD] [PATCH 0/5] Replace 'dmd' service with 'root/shepherd' Alex Kost
2016-01-24 15:33 ` Alex Kost [this message]
2016-01-24 15:33 ` [PATCH 2/5] service: Improve style of 'for-each-service' Alex Kost
2016-01-24 15:33 ` [PATCH 3/5] service: 'service-list' returns unique services Alex Kost
2016-01-24 15:33 ` [PATCH 4/5] service: Add docstring to 'lookup-services' Alex Kost
2016-01-24 15:33 ` [PATCH 5/5] Rename 'dmd' service to 'root' Alex Kost
2016-01-25  8:55   ` Alex Kost
2016-01-24 21:20 ` [SHEPHERD] [PATCH 0/5] Replace 'dmd' service with 'root/shepherd' Ludovic Courtès
2016-01-24 21:45   ` Mathieu Lirzin
2016-01-25  8:39   ` [SHEPHERD] [PATCH] service: Improve 'service-list' Alex Kost
2016-01-25 15:06     ` Ludovic Courtès
2016-01-25 15:57       ` Alex Kost
2016-01-25 21:49         ` Ludovic Courtès
2016-01-26  9:42           ` Alex Kost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453649591-3478-2-git-send-email-alezost@gmail.com \
    --to=alezost@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.