>From 0243051f4a650f729e20645606d45d7138f2aa8c Mon Sep 17 00:00:00 2001 From: Roel Janssen
Date: Tue, 1 Aug 2017 16:30:02 +0200 Subject: [PATCH] graph: Provide access to the package record in the emit functions. * guix/graph.scm (export-graph): Pass the node to the emit functions, instead of the node's label. --- guix/graph.scm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/guix/graph.scm b/guix/graph.scm index d7fd5f3..0219787 100644 --- a/guix/graph.scm +++ b/guix/graph.scm @@ -22,6 +22,7 @@ #:use-module (guix monads) #:use-module (guix records) #:use-module (guix sets) + #:use-module (guix packages) #:use-module (rnrs io ports) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) @@ -170,9 +171,9 @@ typically returned by 'node-edges' or 'node-back-edges'." name)) (define (emit-epilogue port) (display "\n}\n" port)) -(define (emit-node id label port) +(define (emit-node id node port) (format port " \"~a\" [label = \"~a\", shape = box, fontname = Helvetica];~%" - id label)) + id (package-full-name node))) (define (emit-edge id1 id2 port) (format port " \"~a\" -> \"~a\" [color = ~a];~%" id1 id2 (pop-color id1))) @@ -213,11 +214,11 @@ var nodes = {}, (format port "