[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/21: installer: Wrap installer in (catch #t ...)
From: |
John Darrington |
Subject: |
06/21: installer: Wrap installer in (catch #t ...) |
Date: |
Sat, 31 Dec 2016 14:54:17 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 492aa1606bed2df20e59b666b5e6cffbd8592597
Author: John Darrington <address@hidden>
Date: Wed Dec 28 09:30:32 2016 +0100
installer: Wrap installer in (catch #t ...)
* gnu/system/installer/new.scm (guixsd-installer): Close the curses
display before showing backtrace on exceptions.
---
gnu/system/installer/new.scm | 73 ++++++++++++++++++++++++------------------
1 file changed, 42 insertions(+), 31 deletions(-)
diff --git a/gnu/system/installer/new.scm b/gnu/system/installer/new.scm
index a1e6275..ca280f4 100644
--- a/gnu/system/installer/new.scm
+++ b/gnu/system/installer/new.scm
@@ -230,34 +230,45 @@
(define-public (guixsd-installer)
-
- (define stdscr (initscr)) ; Start curses
-
- ;; We don't want any nasty kernel messages damaging our beautifully
- ;; crafted display.
- (system* "dmesg" "--console-off")
-
- (cbreak!) ; Line buffering disabled
- (keypad! stdscr #t) ; Check for function keys
- (noecho!)
-
- (start-color!)
-
- (init-pair! livery-title COLOR_RED COLOR_BLACK)
-
- (curs-set 0)
-
- (let ((page (make-page
- stdscr (gettext "GuixSD Installer")
- main-page-refresh main-page-key-handler)))
-
- (set! page-stack (cons page page-stack))
- ((page-refresh page) (car page-stack))
- (let loop ((ch (getch stdscr)))
- (let ((current-page (car page-stack)))
- ((page-key-handler current-page) current-page ch)
- (base-page-key-handler current-page ch))
- ((page-refresh (car page-stack)) (car page-stack))
- (loop (getch stdscr)))
-
- (endwin)))
+ (catch #t
+ (lambda ()
+
+ (define stdscr (initscr)) ; Start curses
+
+ ;; We don't want any nasty kernel messages damaging our beautifully
+ ;; crafted display.
+ (system* "dmesg" "--console-off")
+
+ (cbreak!) ; Line buffering disabled
+ (keypad! stdscr #t) ; Check for function keys
+ (noecho!)
+
+ (start-color!)
+
+ (init-pair! livery-title COLOR_RED COLOR_BLACK)
+
+ (curs-set 0)
+
+ (let ((page (make-page
+ stdscr (gettext "GuixSD Installer")
+ main-page-refresh main-page-key-handler)))
+
+ (set! page-stack (cons page page-stack))
+ ((page-refresh page) (car page-stack))
+ (let loop ((ch (getch stdscr)))
+ (let ((current-page (car page-stack)))
+ ((page-key-handler current-page) current-page ch)
+ (base-page-key-handler current-page ch))
+ ((page-refresh (car page-stack)) (car page-stack))
+ (loop (getch stdscr)))
+
+ (endwin)))
+ (lambda (key . args)
+ (system* "dmesg" "--console-on")
+ (exit 2))
+ (lambda (key subr message args rest)
+ (let ((s (make-stack #t 3 primitive-load)))
+ (endwin)
+ (display-backtrace s (current-error-port))
+ (display-error (stack-ref s 0)
+ (current-error-port) subr message args rest)))))
- branch wip-installer updated (d654694 -> d5eb580), John Darrington, 2016/12/31
- 03/21: installer: Add inetutils bin directory to PATH., John Darrington, 2016/12/31
- 05/21: installer: Enable scrolling in the installation window., John Darrington, 2016/12/31
- 06/21: installer: Wrap installer in (catch #t ...),
John Darrington <=
- 16/21: installer: Prevent the user specifying the same mount point twice., John Darrington, 2016/12/31
- 04/21: installer: Turn off kernel ring messages to console., John Darrington, 2016/12/31
- 01/21: installer: Add wireless-tools bin directory to PATH., John Darrington, 2016/12/31
- 02/21: installer: Replace an instance of cdr with match., John Darrington, 2016/12/31
- 12/21: installer: Close unused ports in pipe-cmd., John Darrington, 2016/12/31
- 08/21: installer: Use consistent window heights., John Darrington, 2016/12/31
- 20/21: installer: Do not use /tmp for holding the configuration., John Darrington, 2016/12/31
- 14/21: installer: Issue message to user on failure of filesystems task., John Darrington, 2016/12/31
- 07/21: installer: Rename module "new" to "guixsd-installer"., John Darrington, 2016/12/31
- 13/21: installer: Replace spawned mount command with the mount syscall., John Darrington, 2016/12/31