summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-06-06 15:29:50 +0200
committerLudovic Courtès <ludo@gnu.org>2017-06-21 11:05:52 +0200
commitb3a00885c0a420692ccc4c227252bb44619399d5 (patch)
tree3fcb8997ed451e5f8bc01d490db7b3da2e2e096a /tests
parent55b4715fd4c03e46501f123c5c9bc6072edf12a4 (diff)
downloadpatches-b3a00885c0a420692ccc4c227252bb44619399d5.tar
patches-b3a00885c0a420692ccc4c227252bb44619399d5.tar.gz
profiles: Manifest entries keep a reference to their parent entry.
* guix/profiles.scm (<manifest-entry>)[parent]: New field. (package->manifest-entry): Add #:parent parameter. Fill out the 'parent' field of <manifest-entry>; pass #:parent in recursive calls. * guix/profiles.scm (sexp->manifest)[sexp->manifest-entry]: New procedure. Use it for version 3. * tests/profiles.scm ("manifest-entry-parent"): New procedure. ("read-manifest")[entry->sexp]: Add 'manifest-entry-parent' to the result.
Diffstat (limited to 'tests')
-rw-r--r--tests/profiles.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/profiles.scm b/tests/profiles.scm
index e8b1bb832c..94759c05ef 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -301,6 +301,15 @@
(manifest-entry-dependencies
(package->manifest-entry packages:guile-2.2))))
+(test-assert "manifest-entry-parent"
+ (let ((entry (package->manifest-entry packages:guile-2.2)))
+ (match (manifest-entry-dependencies entry)
+ ((dependencies ..1)
+ (and (every (lambda (parent)
+ (eq? entry (force parent)))
+ (map manifest-entry-parent dependencies))
+ (not (force (manifest-entry-parent entry))))))))
+
(test-assertm "read-manifest"
(mlet* %store-monad ((manifest -> (packages->manifest
(list (package
@@ -316,7 +325,8 @@
(list (manifest-entry-name entry)
(manifest-entry-version entry)
(manifest-entry-search-paths entry)
- (manifest-entry-dependencies entry)))
+ (manifest-entry-dependencies entry)
+ (force (manifest-entry-parent entry))))
(mbegin %store-monad
(built-derivations (list drv))