aboutsummaryrefslogtreecommitdiff
path: root/emacs/guix-main.scm
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2016-05-27 10:43:25 +0300
committerAlex Kost <alezost@gmail.com>2016-05-31 23:51:54 +0300
commitb097dd72c4ffab9622300db9950c5a0b1b1579f7 (patch)
tree8d71e56e0c8898d35607e0f2772797df72587072 /emacs/guix-main.scm
parente98316e69f2480bde709d92ec00db66fd8e66aea (diff)
downloadpatches-b097dd72c4ffab9622300db9950c5a0b1b1579f7.tar
patches-b097dd72c4ffab9622300db9950c5a0b1b1579f7.tar.gz
emacs: Add "Build Log" button to Package Info.
* emacs/guix-main.scm (package-build-log-file): New procedure. * emacs/guix-ui-package.el (guix-package-build-log-file) (guix-package-find-build-log) (guix-package-info-insert-build-log-button): New procedures. (guix-package-info-button-functions): Add 'guix-package-info-insert-build-log-button'.
Diffstat (limited to 'emacs/guix-main.scm')
-rw-r--r--emacs/guix-main.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm
index 8914933b4b..cbf7cdc474 100644
--- a/emacs/guix-main.scm
+++ b/emacs/guix-main.scm
@@ -1000,6 +1000,16 @@ GENERATIONS is a list of generation numbers."
(format #t "The source store path: ~a~%"
(package-source-derivation->store-path derivation))))))
+(define (package-build-log-file package-id)
+ "Return the build log file of a package PACKAGE-ID.
+Return #f if the build log is not found."
+ (and-let* ((package (package-by-id package-id)))
+ (with-store store
+ (let* ((derivation (package-derivation store package))
+ (file (derivation-file-name derivation)))
+ (or (log-file store file)
+ ((@@ (guix scripts build) log-url) store file))))))
+
;;; Executing guix commands