installer: Skip the backtrace page on user abort.
When the user aborts the installation because a core dump is discovered or the installation command failed, displaying the abort backtrace doesn't make much sense. Hide it when the abort condition is &user-abort-error and skip directly to the dump page. * gnu/installer/steps.scm (&user-abort-error): New variable. (user-abort-error?): New procedure. * gnu/installer/newt/final.scm (run-install-failed-page): Raise a user-abort-error. * gnu/installer/newt/welcome.scm (run-welcome-page): Ditto. * gnu/installer.scm (installer-program): Hide the backtrace page and directly propose to dump the report when the a &user-abort-error is raised.
This commit is contained in:
		
							parent
							
								
									80387bc7c3
								
							
						
					
					
						commit
						62a3756bd9
					
				
					 4 changed files with 24 additions and 10 deletions
				
			
		|  | @ -453,11 +453,21 @@ selected keymap." | ||||||
|                                           key args) |                                           key args) | ||||||
|                       (define dump-dir |                       (define dump-dir | ||||||
|                         (prepare-dump key args #:result %current-result)) |                         (prepare-dump key args #:result %current-result)) | ||||||
|  | 
 | ||||||
|  |                       (define user-abort? | ||||||
|  |                         (match args | ||||||
|  |                           (((? user-abort-error? obj)) #t) | ||||||
|  |                           (_ #f))) | ||||||
|  | 
 | ||||||
|                       (define action |                       (define action | ||||||
|  |                         (if user-abort? | ||||||
|  |                             'dump | ||||||
|                             ((installer-exit-error current-installer) |                             ((installer-exit-error current-installer) | ||||||
|                              (get-string-all |                              (get-string-all | ||||||
|                               (open-input-file |                               (open-input-file | ||||||
|                            (string-append dump-dir "/installer-backtrace"))))) |                                (string-append dump-dir | ||||||
|  |                                               "/installer-backtrace")))))) | ||||||
|  | 
 | ||||||
|                       (match action |                       (match action | ||||||
|                         ('dump |                         ('dump | ||||||
|                          (let* ((dump-files |                          (let* ((dump-files | ||||||
|  |  | ||||||
|  | @ -93,8 +93,7 @@ a specific step, or restart the installer.")) | ||||||
|         #t) |         #t) | ||||||
|        (3 (raise |        (3 (raise | ||||||
|             (condition |             (condition | ||||||
|             (&message |              (&user-abort-error)))))) | ||||||
|              (message "User abort."))))))) |  | ||||||
|     (_ |     (_ | ||||||
|      (send-to-clients '(installation-failure)) |      (send-to-clients '(installation-failure)) | ||||||
|      #t))) |      #t))) | ||||||
|  |  | ||||||
|  | @ -145,8 +145,7 @@ first?")) | ||||||
|         (1 #t) |         (1 #t) | ||||||
|         (2 (raise |         (2 (raise | ||||||
|             (condition |             (condition | ||||||
|              (&message |              (&user-abort-error)))))) | ||||||
|               (message "User abort."))))))) |  | ||||||
|     (run-menu-page |     (run-menu-page | ||||||
|      (G_ "GNU Guix install") |      (G_ "GNU Guix install") | ||||||
|      (G_ "Welcome to GNU Guix system installer! |      (G_ "Welcome to GNU Guix system installer! | ||||||
|  |  | ||||||
|  | @ -28,7 +28,10 @@ | ||||||
|   #:use-module (srfi srfi-34) |   #:use-module (srfi srfi-34) | ||||||
|   #:use-module (srfi srfi-35) |   #:use-module (srfi srfi-35) | ||||||
|   #:use-module (rnrs io ports) |   #:use-module (rnrs io ports) | ||||||
|   #:export (<installer-step> |   #:export (&user-abort-error | ||||||
|  |             user-abort-error? | ||||||
|  | 
 | ||||||
|  |             <installer-step> | ||||||
|             installer-step |             installer-step | ||||||
|             make-installer-step |             make-installer-step | ||||||
|             installer-step? |             installer-step? | ||||||
|  | @ -50,6 +53,9 @@ | ||||||
| 
 | 
 | ||||||
|             %current-result)) |             %current-result)) | ||||||
| 
 | 
 | ||||||
|  | (define-condition-type &user-abort-error &error | ||||||
|  |   user-abort-error?) | ||||||
|  | 
 | ||||||
| ;; Hash table storing the step results. Use it only for logging and debug | ;; Hash table storing the step results. Use it only for logging and debug | ||||||
| ;; purposes. | ;; purposes. | ||||||
| (define %current-result (make-hash-table)) | (define %current-result (make-hash-table)) | ||||||
|  |  | ||||||
		Reference in a new issue