summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-04-02 15:44:42 +0200
committerLudovic Courtès <ludo@gnu.org>2014-04-02 16:07:40 +0200
commitd2952326ae18f50f6b3abefe0b12547556f9a1b8 (patch)
tree45928db066d891ee86fb5796497bc5d3f2c4cf01 /guix
parent0d55c3563c963f457cc67a728b937a67302ca731 (diff)
downloadguix-patches-d2952326ae18f50f6b3abefe0b12547556f9a1b8.tar
guix-patches-d2952326ae18f50f6b3abefe0b12547556f9a1b8.tar.gz
guix package: Register non-default profiles as GC roots.
* guix/scripts/package.scm (maybe-register-gc-root): New procedure. * tests/guix-package.sh (profile): Grep the output of "guix gc --list-live" in a couple of places.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/package.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 6069b203de..36d47348f1 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -723,6 +723,11 @@ removed from MANIFEST."
(_ #f))
options))
+(define (maybe-register-gc-root store profile)
+ "Register PROFILE as a GC root, unless it doesn't need it."
+ (unless (string=? profile %current-profile)
+ (add-indirect-root store (canonicalize-path profile))))
+
;;;
;;; Entry point.
@@ -915,6 +920,7 @@ more information.~%"))
(let ((count (length entries)))
(switch-symlinks name prof)
(switch-symlinks profile name)
+ (maybe-register-gc-root (%store) profile)
(format #t (N_ "~a package in profile~%"
"~a packages in profile~%"
count)