diff --git a/guix/packages.scm b/guix/packages.scm index b413e58b19c19cdf8799844d033e2a29d1564c5b..985a573fd39086fbc184983da80eee21723c2554 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -125,6 +125,17 @@ (define-record-type* <origin> (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 + (($ <origin> uri method sha256 file-name patches) + (simple-format port "#<origin ~s ~a ~s ~a>" + uri (bytevector->base32-string sha256) + patches + (number->string (object-address origin) 16))))) + +(set-record-type-printer! <origin> print-origin) + (define-syntax base32 (lambda (s) "Return the bytevector corresponding to the given Nix-base32