aboutsummaryrefslogtreecommitdiff
path: root/gnu/installer/newt.scm
diff options
context:
space:
mode:
authorMathieu Othacehe <m.othacehe@gmail.com>2018-12-06 11:11:04 +0900
committerLudovic Courtès <ludo@gnu.org>2019-01-17 14:04:25 +0100
commit133c401f774d803f92933e9cadb6791641913beb (patch)
tree061febdce714640ce2d26570f0d2c67c068f6fcf /gnu/installer/newt.scm
parent3d0f6a055c366a5414c35262bb4b31c0f602fcd3 (diff)
downloadpatches-133c401f774d803f92933e9cadb6791641913beb.tar
patches-133c401f774d803f92933e9cadb6791641913beb.tar.gz
installer: Display an eventual backtrace in a page.
* gnu/installer.scm (installer-program): Write the backtrace in "/tmp/last-installer-error" and pass the filename to installer-exit-error. * gnu/installer/newt.scm (exit-error): Display the file passed above in a textbox.
Diffstat (limited to 'gnu/installer/newt.scm')
-rw-r--r--gnu/installer/newt.scm21
1 files changed, 20 insertions, 1 deletions
diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm
index 9d9212173d..31329b5c0f 100644
--- a/gnu/installer/newt.scm
+++ b/gnu/installer/newt.scm
@@ -18,6 +18,7 @@
(define-module (gnu installer newt)
#:use-module (gnu installer record)
+ #:use-module (gnu installer utils)
#:use-module (gnu installer newt ethernet)
#:use-module (gnu installer newt final)
#:use-module (gnu installer newt hostname)
@@ -25,6 +26,7 @@
#:use-module (gnu installer newt locale)
#:use-module (gnu installer newt menu)
#:use-module (gnu installer newt network)
+ #:use-module (gnu installer newt page)
#:use-module (gnu installer newt partition)
#:use-module (gnu installer newt services)
#:use-module (gnu installer newt timezone)
@@ -32,6 +34,7 @@
#:use-module (gnu installer newt utils)
#:use-module (gnu installer newt welcome)
#:use-module (gnu installer newt wifi)
+ #:use-module (guix config)
#:use-module (guix discovery)
#:use-module (guix i18n)
#:use-module (srfi srfi-26)
@@ -46,7 +49,23 @@
(define (exit)
(newt-finish))
-(define (exit-error key . args)
+(define (exit-error file key args)
+ (newt-set-color COLORSET-ROOT "white" "red")
+ (let ((width (nearest-exact-integer
+ (* (screen-columns) 0.8)))
+ (height (nearest-exact-integer
+ (* (screen-rows) 0.7))))
+ (run-file-textbox-page
+ #:info-text (format #f (G_ "The installer has encountered an unexpected \
+problem. The backtrace is displayed below. Please report it by email to \
+<~a>.") %guix-bug-report-address)
+ #:title (G_ "Unexpected problem")
+ #:file file
+ #:exit-button? #f
+ #:info-textbox-width width
+ #:file-textbox-width width
+ #:file-textbox-height height))
+ (newt-set-color COLORSET-ROOT "white" "blue")
(newt-finish))
(define (final-page result prev-steps)