summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-01-08 19:23:33 +0100
committerLudovic Courtès <ludo@gnu.org>2014-01-08 19:23:33 +0100
commit021a201f2967e5a5afdabb03148f225f94c58403 (patch)
treea66054adb82ca5daadceb17443c25850e994c44e
parent87236aed77bd57ecd143d84acf864fb112842118 (diff)
downloadguix-021a201f2967e5a5afdabb03148f225f94c58403.tar.gz
store: Fix 'log-file' to support uncompressed logs.
* guix/store.scm (log-file): Report the file without '.bz2' if it
  exists.
-rw-r--r--guix/store.scm17
1 files changed, 10 insertions, 7 deletions
diff --git a/guix/store.scm b/guix/store.scm
index 4ceca0daa2..159b5dc396 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -753,12 +753,15 @@ must be an absolute store file name, or a derivation file name."
     (or (getenv "NIX_STATE_DIR") %state-directory))
 
   (cond ((derivation-path? file)
-         (let* ((base (basename file))
-                (log  (string-append (dirname state-dir) ; XXX: ditto
-                                     "/log/nix/drvs/"
-                                     (string-take base 2) "/"
-                                     (string-drop base 2) ".bz2")))
-           (and (file-exists? log) log)))
+         (let* ((base    (basename file))
+                (log     (string-append (dirname state-dir) ; XXX: ditto
+                                        "/log/nix/drvs/"
+                                        (string-take base 2) "/"
+                                        (string-drop base 2)))
+                (log.bz2 (string-append log ".bz2")))
+           (cond ((file-exists? log.bz2) log.bz2)
+                 ((file-exists? log) log)
+                 (else #f))))
         (else
          (match (valid-derivers store file)
            ((derivers ...)