summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-08-31 15:23:32 +0200
committerLudovic Courtès <ludo@gnu.org>2016-08-31 15:44:20 +0200
commitd4f8884fdb897e648fd7f4262b2142d8c363ac76 (patch)
tree8ded679c906151037b82937e26fa1fd664e1a531 /guix
parent6673bddc9ae8f8835a8676cfb3ca0f5b9eb29405 (diff)
guix system: Do not unload services depended on.
Reported by Mark H Weaver <mhw@netris.org> at <https://lists.gnu.org/archive/html/guix-devel/2016-08/msg01470.html>. * guix/scripts/system.scm (service-upgrade)[live-service-required?]: New procedure. [obsolete?]: Use it. * tests/system.scm ("service-upgrade: service depended on is not unloaded", "service-upgrade: obsolete services that depend on each other"): New tests.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/system.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 80f62fb109..bcf19dbb7e 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -298,9 +298,14 @@ needs to be loaded."
(service (and (not (live-service-running service))
service))))
+ (define live-service-dependents
+ (shepherd-service-back-edges live
+ #:provision live-service-provision
+ #:requirement live-service-requirement))
+
(define (obsolete? service)
(match (lookup-target (first (live-service-provision service)))
- (#f #t)
+ (#f (every obsolete? (live-service-dependents service)))
(_ #f)))
(define to-load