GNU bug report logs - #68357
[PATCH] service: fix `unload all` * modules/shepherd/service.scm: fix `unload all`

Previous Next

Package: guix-patches;

Reported by: "zero <at> fedora" <shinyzero0 <at> tilde.club>

Date: Wed, 10 Jan 2024 00:32:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "zero <at> fedora" <shinyzero0 <at> tilde.club>
To: guix-patches <at> gnu.org
Cc: "zero <at> fedora" <shinyzero0 <at> tilde.club>
Subject: [PATCH] service: fix `unload all` * modules/shepherd/service.scm: fix
 `unload all`
Date: Wed, 10 Jan 2024 03:29:22 +0300
---
 modules/shepherd/service.scm | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 5be78bd..54d3400 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -1136,11 +1136,6 @@ requests arriving on @var{channel}."
                  (length lst))
            (map service-canonical-name lst))
           (loop registered))))
-      (('unregister-all)                          ;no reply
-       (let ((root (cdr (vhash-assq 'root registered))))
-         (loop (fold (cut vhash-consq <> root <>)
-                     vlist-null
-                     (service-provision root)))))
       (('lookup name reply)
        ;; Look up NAME and return it, or #f, to REPLY.
        (put-message reply
@@ -2638,8 +2633,11 @@ requested to be removed."
   (let ((name (string->symbol service-name)))
     (cond ((eq? name 'all)
            ;; Special 'remove all' case.
-           (put-message (current-registry-channel) `(unregister-all))
-           #t)
+           (unregister-services
+             (filter
+               (lambda (sv)
+                 (not (eq? (service-canonical-name sv) 'root)))
+               (service-list))))
           (else
            ;; Removing only one service.
            (match (lookup-service name)
-- 
2.43.0





This bug report was last modified 1 year and 121 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.