From f1096964735512beacde6ff178a6ada1a14b91d3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 11 Jul 2014 13:59:54 +0200 Subject: packages: Add printer for . * guix/packages.scm (print-origin): New procedure. (): Add it as record type printer. --- guix/packages.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/guix/packages.scm b/guix/packages.scm index b413e58b19..985a573fd3 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -125,6 +125,17 @@ (patch-guile origin-patch-guile ; package or #f (default #f))) +(define (print-origin origin port) + "Write a concise representation of ORIGIN to PORT." + (match origin + (($ uri method sha256 file-name patches) + (simple-format port "#" + uri (bytevector->base32-string sha256) + patches + (number->string (object-address origin) 16))))) + +(set-record-type-printer! print-origin) + (define-syntax base32 (lambda (s) "Return the bytevector corresponding to the given Nix-base32 -- cgit v1.2.3