From f1dfb7c47c2cb7ca972d0379640838719af9a118 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 25 Sep 2013 00:13:06 +0200 Subject: gnu: guix: Rework 0.4 hack to gracefully handle lack of tarball. * gnu/packages/package-management.scm (guix-0.4): Fall back to the source of GIUX when the tarball doesn't exist. --- gnu/packages/package-management.scm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index e19ce04716..ccd15cef6f 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -107,10 +107,16 @@ Guix is based on the Nix package manager.") (define-public guix-0.4 ;; XXX: Hack to allow the use of a 0.4ish tarball. This assumes that you ;; have run 'make dist' in your build tree. Remove when 0.4 is out. - (package (inherit guix) - (version "0.4rc") - (source (let ((builddir (dirname - (canonicalize-path - (dirname (search-path %load-path - "guix/config.scm")))))) - (string-append builddir "/guix-0.4.tar.gz"))))) + (let* ((builddir (dirname + (canonicalize-path + (dirname (search-path %load-path + "guix/config.scm"))))) + (tarball (string-append builddir "/guix-0.4.tar.gz"))) + (package (inherit guix) + (version "0.4rc") + (source (if (file-exists? tarball) + tarball + (begin + (format (current-error-port) + "warning: 'guix-0.4.tar.gz' not found~%") + (package-source guix))))))) -- cgit v1.2.3