Archived
1
0
Fork 0

installer: Use define instead of let at top-level.

* gnu/installer.scm (installer-program): Improve readability by using
define at top-level.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
This commit is contained in:
Josselin Poiret 2022-01-15 14:49:54 +01:00 committed by Mathieu Othacehe
parent 0d37a5df7e
commit 4a68a00c8b
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -412,50 +412,50 @@ selected keymap."
;; verbose. ;; verbose.
(terminal-width 200) (terminal-width 200)
(let* ((current-installer newt-installer) (define current-installer newt-installer)
(steps (#$steps current-installer))) (define steps (#$steps current-installer))
((installer-init current-installer)) ((installer-init current-installer))
(catch #t (catch #t
(lambda () (lambda ()
(define results (define results
(run-installer-steps (run-installer-steps
#:rewind-strategy 'menu #:rewind-strategy 'menu
#:menu-proc (installer-menu-page current-installer) #:menu-proc (installer-menu-page current-installer)
#:steps steps)) #:steps steps))
(match (result-step results 'final) (match (result-step results 'final)
('success ('success
;; We did it! Let's reboot! ;; We did it! Let's reboot!
(sync) (sync)
(stop-service 'root)) (stop-service 'root))
(_ (_
;; The installation failed, exit so that it is restarted ;; The installation failed, exit so that it is restarted
;; by login. ;; by login.
#f))) #f)))
(const #f) (const #f)
(lambda (key . args) (lambda (key . args)
(syslog "crashing due to uncaught exception: ~s ~s~%" (syslog "crashing due to uncaught exception: ~s ~s~%"
key args) key args)
(let ((error-file "/tmp/last-installer-error") (let ((error-file "/tmp/last-installer-error")
(dump-archive "/tmp/dump.tgz")) (dump-archive "/tmp/dump.tgz"))
(call-with-output-file error-file (call-with-output-file error-file
(lambda (port) (lambda (port)
(display-backtrace (make-stack #t) port) (display-backtrace (make-stack #t) port)
(print-exception port (print-exception port
(stack-ref (make-stack #t) 1) (stack-ref (make-stack #t) 1)
key args))) key args)))
(make-dump dump-archive (make-dump dump-archive
#:result %current-result #:result %current-result
#:backtrace error-file) #:backtrace error-file)
(let ((report (let ((report
((installer-dump-page current-installer) ((installer-dump-page current-installer)
dump-archive))) dump-archive)))
((installer-exit-error current-installer) ((installer-exit-error current-installer)
error-file report key args))) error-file report key args)))
(primitive-exit 1))) (primitive-exit 1)))
((installer-exit current-installer))))))) ((installer-exit current-installer))))))
(program-file (program-file
"installer" "installer"