[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#53063] [PATCH v2 wip-harden-installer 01/18] installer: Use define
From: |
Josselin Poiret |
Subject: |
[bug#53063] [PATCH v2 wip-harden-installer 01/18] installer: Use define instead of let at top-level. |
Date: |
Sat, 15 Jan 2022 14:49:54 +0100 |
* gnu/installer.scm (installer-program): Improve readability by using
define at top-level.
---
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 @@ (define installer-builder
;; 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"
--
2.34.0
- [bug#53063] [PATCH v2 wip-harden-installer 12/18] installer: Replace run-command by invoke in newt/page.scm., (continued)
- [bug#53063] [PATCH v2 wip-harden-installer 12/18] installer: Replace run-command by invoke in newt/page.scm., Josselin Poiret, 2022/01/15
- [bug#53063] [PATCH v2 wip-harden-installer 09/18] installer: Use run-command-in-installer in (gnu installer parted)., Josselin Poiret, 2022/01/15
- [bug#53063] [PATCH v2 wip-harden-installer 02/18] installer: Generalize logging facility., Josselin Poiret, 2022/01/15
- [bug#53063] [PATCH v2 wip-harden-installer 07/18] installer: Capture external commands output., Josselin Poiret, 2022/01/15
- [bug#53063] [PATCH v2 wip-harden-installer 05/18] installer: Keep PATH inside the install container., Josselin Poiret, 2022/01/15
- [bug#53063] [PATCH v2 wip-harden-installer 10/18] installer: Raise condition when mklabel fails., Josselin Poiret, 2022/01/15
- [bug#53063] [PATCH v2 wip-harden-installer 11/18] installer: Fix run-file-textbox-page when edit-button is #f., Josselin Poiret, 2022/01/15
- [bug#53063] [PATCH v2 wip-harden-installer 14/18] installer: Use named prompt to abort or break installer steps., Josselin Poiret, 2022/01/15
- [bug#53063] [PATCH v2 wip-harden-installer 15/18] installer: Add error page when running external commands., Josselin Poiret, 2022/01/15
- [bug#53063] [PATCH v2 wip-harden-installer 18/18] installer: Make dump archive creation optional and selective., Josselin Poiret, 2022/01/15
- [bug#53063] [PATCH v2 wip-harden-installer 01/18] installer: Use define instead of let at top-level.,
Josselin Poiret <=
- [bug#53063] [PATCH v2 wip-harden-installer 16/18] installer: Use dynamic-wind to setup installer., Josselin Poiret, 2022/01/15
- [bug#53063] [PATCH v2 wip-harden-installer 17/18] installer: Turn passwords into opaque records., Josselin Poiret, 2022/01/15
- [bug#53063] [PATCH wip-harden-installer 00/14] General improvements to the installer, Mathieu Othacehe, 2022/01/17
- [bug#53063] [PATCH] installer: Use system-wide guix for system init., Josselin Poiret, 2022/01/31
[bug#53063] [PATCH wip-harden-installer 10/14] installer: Raise condition when mklabel fails., Josselin Poiret, 2022/01/06
[bug#53063] [PATCH wip-harden-installer 09/14] installer: Use the command capturing facility for guix init., Josselin Poiret, 2022/01/06
[bug#53063] [PATCH wip-harden-installer 12/14] installer: Replace run-command by invoke in newt/page.scm., Josselin Poiret, 2022/01/06
[bug#53063] [PATCH wip-harden-installer 11/14] installer: Fix run-file-textbox-page when edit-button is #f., Josselin Poiret, 2022/01/06
[bug#53063] [PATCH wip-harden-installer 14/14] installer: Add confirmation page when running external commands., Josselin Poiret, 2022/01/06
[bug#53063] [PATCH wip-harden-installer 13/14] installer: Use named prompt to abort or break installer steps., Josselin Poiret, 2022/01/06