[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: graph: %BAG-WITH-ORIGINS-NODE-TYPE includes the origin's guile.
From: |
Ludovic Courtès |
Subject: |
02/02: graph: %BAG-WITH-ORIGINS-NODE-TYPE includes the origin's guile. |
Date: |
Sat, 02 Jan 2016 21:25:48 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 51385362f76e2f823ac8d8cf720d06c386504069
Author: Ludovic Courtès <address@hidden>
Date: Sat Jan 2 22:22:57 2016 +0100
graph: %BAG-WITH-ORIGINS-NODE-TYPE includes the origin's guile.
Before that it would include #f for most origins since that the default
value of 'origin-patch-guile'.
* guix/scripts/graph.scm (bag-node-edges): When 'origin-patch-guile'
returns #f, use (default-guile).
* tests/graph.scm ("bag DAG, including origins"): Check for an edge from
O to (default-guile).
---
guix/scripts/graph.scm | 2 +-
tests/graph.scm | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/guix/scripts/graph.scm b/guix/scripts/graph.scm
index 9d9eb22..dcc4701 100644
--- a/guix/scripts/graph.scm
+++ b/guix/scripts/graph.scm
@@ -113,7 +113,7 @@ Dependencies may include packages, origin, and file names."
(((labels things . outputs) ...)
things)))
((origin? thing)
- (cons (origin-patch-guile thing)
+ (cons (or (origin-patch-guile thing) (default-guile))
(if (or (pair? (origin-patches thing))
(origin-snippet thing))
(match (origin-patch-inputs thing)
diff --git a/tests/graph.scm b/tests/graph.scm
index daf64dc..4f85432 100644
--- a/tests/graph.scm
+++ b/tests/graph.scm
@@ -150,7 +150,8 @@ edges."
(let-values (((nodes edges) (nodes+edges)))
(run-with-store %store
(mlet %store-monad ((o* (lower-object o))
- (p* (lower-object p)))
+ (p* (lower-object p))
+ (g (lower-object (default-guile))))
(return
(and (find (match-lambda
((file "the-uri") #t)
@@ -160,6 +161,13 @@ edges."
((source target)
(and (string=? source (derivation-file-name p*))
(string=? target o*))))
+ edges)
+
+ ;; There must also be an edge from O to G.
+ (find (match-lambda
+ ((source target)
+ (and (string=? source o*)
+ (string=? target (derivation-file-name g)))))
edges)))))))))
(test-assert "derivation DAG"