graph: reference/referrer node types work with graph traversal.
authorLudovic Courtès <ludo@gnu.org>
Sat, 9 May 2020 22:04:59 +0000 (00:04 +0200)
committerLudovic Courtès <ludo@gnu.org>
Mon, 11 May 2020 21:30:55 +0000 (23:30 +0200)
commit724020213664239ec5c92d04f5fee44c25408a7f
treef1c6d4c48b8be527b5900ab15a3e60bca2833980
parentc2b2c19a7b8b75ef6dd153ca121dd8765cdcd746
graph: reference/referrer node types work with graph traversal.

The graph traversal procedures in (guix graph) assume that nodes can be
compared with 'eq?', which was not the case for nodes of
%REFERENCE-NODE-TYPE and %REFERRER-NODE-TYPE (strings).

* guix/scripts/graph.scm (intern): New procedure.
(ensure-store-items, references*)
(%reference-node-type, non-derivation-referrers)
(%referrer-node-type): Use it on all store items.
* tests/graph.scm ("node-transitive-edges, references"): New test.
guix/scripts/graph.scm
tests/graph.scm