[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/18: installer: Use define instead of let at top-level.
From: |
guix-commits |
Subject: |
01/18: installer: Use define instead of let at top-level. |
Date: |
Mon, 17 Jan 2022 05:04:51 -0500 (EST) |
mothacehe pushed a commit to branch wip-harden-installer
in repository guix.
commit 76c27a5792a5c075c307e005c50182a3452102ef
Author: Josselin Poiret <dev@jpoiret.xyz>
AuthorDate: Sat Jan 15 14:49:54 2022 +0100
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>
---
gnu/installer.scm | 88 +++++++++++++++++++++++++++----------------------------
1 file changed, 44 insertions(+), 44 deletions(-)
diff --git a/gnu/installer.scm b/gnu/installer.scm
index d57b1d673a..134fa2faaf 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -412,50 +412,50 @@ selected keymap."
;; verbose.
(terminal-width 200)
- (let* ((current-installer newt-installer)
- (steps (#$steps current-installer)))
- ((installer-init current-installer))
-
- (catch #t
- (lambda ()
- (define results
- (run-installer-steps
- #:rewind-strategy 'menu
- #:menu-proc (installer-menu-page current-installer)
- #:steps steps))
-
- (match (result-step results 'final)
- ('success
- ;; We did it! Let's reboot!
- (sync)
- (stop-service 'root))
- (_
- ;; The installation failed, exit so that it is restarted
- ;; by login.
- #f)))
- (const #f)
- (lambda (key . args)
- (syslog "crashing due to uncaught exception: ~s ~s~%"
- key args)
- (let ((error-file "/tmp/last-installer-error")
- (dump-archive "/tmp/dump.tgz"))
- (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)))
- (make-dump dump-archive
- #:result %current-result
- #:backtrace error-file)
- (let ((report
- ((installer-dump-page current-installer)
- dump-archive)))
- ((installer-exit-error current-installer)
- error-file report key args)))
- (primitive-exit 1)))
-
- ((installer-exit current-installer)))))))
+ (define current-installer newt-installer)
+ (define steps (#$steps current-installer))
+ ((installer-init current-installer))
+
+ (catch #t
+ (lambda ()
+ (define results
+ (run-installer-steps
+ #:rewind-strategy 'menu
+ #:menu-proc (installer-menu-page current-installer)
+ #:steps steps))
+
+ (match (result-step results 'final)
+ ('success
+ ;; We did it! Let's reboot!
+ (sync)
+ (stop-service 'root))
+ (_
+ ;; The installation failed, exit so that it is restarted
+ ;; by login.
+ #f)))
+ (const #f)
+ (lambda (key . args)
+ (syslog "crashing due to uncaught exception: ~s ~s~%"
+ key args)
+ (let ((error-file "/tmp/last-installer-error")
+ (dump-archive "/tmp/dump.tgz"))
+ (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)))
+ (make-dump dump-archive
+ #:result %current-result
+ #:backtrace error-file)
+ (let ((report
+ ((installer-dump-page current-installer)
+ dump-archive)))
+ ((installer-exit-error current-installer)
+ error-file report key args)))
+ (primitive-exit 1)))
+
+ ((installer-exit current-installer))))))
(program-file
"installer"
- branch wip-harden-installer updated (84d0d8ad3d -> 1e2f0cca1a), guix-commits, 2022/01/17
- 01/18: installer: Use define instead of let at top-level.,
guix-commits <=
- 07/18: installer: Capture external commands output., guix-commits, 2022/01/17
- 05/18: installer: Keep PATH inside the install container., guix-commits, 2022/01/17
- 18/18: installer: Make dump archive creation optional and selective., guix-commits, 2022/01/17
- 06/18: installer: Remove specific logging code., guix-commits, 2022/01/17
- 03/18: installer: Use new installer-log-line everywhere., guix-commits, 2022/01/17
- 04/18: installer: Un-export syslog syntax., guix-commits, 2022/01/17
- 08/18: installer: Add installer-specific run command process., guix-commits, 2022/01/17
- 09/18: installer: Use run-command-in-installer in (gnu installer parted)., guix-commits, 2022/01/17
- 10/18: installer: Raise condition when mklabel fails., guix-commits, 2022/01/17
- 14/18: installer: Use named prompt to abort or break installer steps., guix-commits, 2022/01/17