From 2e1bafb03438757c7cc34c16230b00623507ff84 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 8 Oct 2014 23:06:19 +0200 Subject: packages: Gracefully print packages whose 'location' is #f. * guix/packages.scm ( printer): Check whether LOC is #f. * tests/packages.scm ("printer with location", "printer without location"): New tests. --- guix/packages.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'guix/packages.scm') diff --git a/guix/packages.scm b/guix/packages.scm index 76e01f3f12..b397a24678 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -229,11 +229,14 @@ (define-record-type* (lambda (package port) (let ((loc (package-location package)) (format simple-format)) - (format port "#" + (format port "#" (package-name package) (package-version package) - (location-file loc) - (location-line loc) + (if loc + (format #f "~a:~a " + (location-file loc) + (location-line loc)) + "") (number->string (object-address package) 16))))) -- cgit v1.2.3