From a9d2a10546b128c3d6df5665ef6dab929cb3db39 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 12 Apr 2014 22:32:10 +0200 Subject: store: Add 'add-permanent-root' and 'remove-permanent-root'. * guix/store.scm (add-indirect-root): Improve docstring. (%gc-roots-directory): New variable. (add-permanent-root, remove-permanent-root): New procedures. * tests/store.scm ("permanent root"): New test. --- tests/store.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/store.scm b/tests/store.scm index 3932a8eb45..90137b9754 100644 --- a/tests/store.scm +++ b/tests/store.scm @@ -147,6 +147,18 @@ ;; (valid-path? %store p1) ;; (member (pk p2) (live-paths %store))))) +(test-assert "permanent root" + (let* ((p (with-store store + (let ((p (add-text-to-store store "random-text" + (random-text)))) + (add-permanent-root p) + (add-permanent-root p) ; should not throw + p)))) + (and (member p (live-paths %store)) + (begin + (remove-permanent-root p) + (->bool (member p (dead-paths %store))))))) + (test-assert "dead path can be explicitly collected" (let ((p (add-text-to-store %store "random-text" (random-text) '()))) -- cgit 1.4.1