[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
47/68: installer: Display an eventual backtrace in a page.
From: |
guix-commits |
Subject: |
47/68: installer: Display an eventual backtrace in a page. |
Date: |
Thu, 17 Jan 2019 08:05:18 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 133c401f774d803f92933e9cadb6791641913beb
Author: Mathieu Othacehe <address@hidden>
Date: Thu Dec 6 11:11:04 2018 +0900
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.
---
gnu/installer.scm | 19 +++++++++----------
gnu/installer/newt.scm | 21 ++++++++++++++++++++-
2 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/gnu/installer.scm b/gnu/installer.scm
index 586ed29..2f01d39 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -333,16 +333,15 @@ selected keymap."
#:steps steps))
(const #f)
(lambda (key . args)
- ((installer-exit-error current-installer) key args)
-
- ;; Be sure to call newt-finish, to restore the terminal into
- ;; its original state before printing the error report.
- (call-with-output-file "/tmp/error"
- (lambda (port)
- (display-backtrace (make-stack #t) port)
- (print-exception port
- (stack-ref (make-stack #t) 1)
- key args)))
+ (let ((error-file "/tmp/last-installer-error"))
+ (call-with-output-file error-file
+ (lambda (port)
+ (display-backtrace (make-stack #t) port)
+ (print-exception port
+ (stack-ref (make-stack #t) 1)
+ key args)))
+ ((installer-exit-error current-installer)
+ error-file key args))
(primitive-exit 1)))
((installer-exit current-installer)))))))
diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm
index 9d92121..31329b5 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)
- 28/68: installer: Redirect to TTY3 root shell for unguided install., (continued)
- 28/68: installer: Redirect to TTY3 root shell for unguided install., guix-commits, 2019/01/17
- 58/68: installer: parted: Do not call BLKRRPART on loop devices., guix-commits, 2019/01/17
- 53/68: installer: Clear screen upon exit., guix-commits, 2019/01/17
- 49/68: installer: menu: Fix typo., guix-commits, 2019/01/17
- 43/68: installer: network: Do not show an empty technology list., guix-commits, 2019/01/17
- 50/68: installer: partition: Fix swaping and use syscalls., guix-commits, 2019/01/17
- 51/68: installer: partition: Fix typo., guix-commits, 2019/01/17
- 55/68: installer: parted: Use read-luks-partition-uuid instead of find-partition-by-luks-uuid., guix-commits, 2019/01/17
- 30/68: installer: Fix comments., guix-commits, 2019/01/17
- 59/68: installer: Rename "Ok" buttons to "OK"., guix-commits, 2019/01/17
- 47/68: installer: Display an eventual backtrace in a page.,
guix-commits <=
- 26/68: installer: Add hostname., guix-commits, 2019/01/17
- 10/68: guix: self: Do not install (gnu system install)., guix-commits, 2019/01/17
- 25/68: installer: Add services page., guix-commits, 2019/01/17
- 11/68: gnu: installer: Launch the installer as kmscon login-program., guix-commits, 2019/01/17
- 13/68: installer: Move everything to the build side., guix-commits, 2019/01/17
- 15/68: tests: Rename %test-encrypted-os to %test-encrypted-root-os., guix-commits, 2019/01/17
- 17/68: services: herd: Allow to pass arguments to start-service., guix-commits, 2019/01/17
- 19/68: gnu: Add guile-parted., guix-commits, 2019/01/17
- 16/68: build: syscalls: Add device-in-use?., guix-commits, 2019/01/17
- 18/68: gnu: guile-newt: Update to revision 4., guix-commits, 2019/01/17