diff options
| author | Josselin Poiret <dev@jpoiret.xyz> | 2022-01-15 14:49:54 +0100 |
|---|---|---|
| committer | Mathieu Othacehe <othacehe@gnu.org> | 2022-02-02 16:46:42 +0100 |
| commit | 4a68a00c8b86b999510b0cd3aaeb76c064fbcd34 (patch) | |
| tree | 4c25f896fecad07d0435143a0d71a03cd5f7c621 /gnu/installer.scm | |
| parent | 0d37a5df7e709cadca97cfbbf9c680dfe54b8302 (diff) | |
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>
Diffstat (limited to 'gnu/installer.scm')
| -rw-r--r-- | gnu/installer.scm | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/gnu/installer.scm b/gnu/installer.scm index d57b1d673a5..134fa2faaff 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm | |||
| @@ -412,50 +412,50 @@ selected keymap." | |||
| 412 | ;; verbose. | 412 | ;; verbose. |
| 413 | (terminal-width 200) | 413 | (terminal-width 200) |
| 414 | 414 | ||
| 415 | (let* ((current-installer newt-installer) | 415 | (define current-installer newt-installer) |
| 416 | (steps (#$steps current-installer))) | 416 | (define steps (#$steps current-installer)) |
| 417 | ((installer-init current-installer)) | 417 | ((installer-init current-installer)) |
| 418 | 418 | ||
| 419 | (catch #t | 419 | (catch #t |
| 420 | (lambda () | 420 | (lambda () |
| 421 | (define results | 421 | (define results |
| 422 | (run-installer-steps | 422 | (run-installer-steps |
| 423 | #:rewind-strategy 'menu | 423 | #:rewind-strategy 'menu |
| 424 | #:menu-proc (installer-menu-page current-installer) | 424 | #:menu-proc (installer-menu-page current-installer) |
| 425 | #:steps steps)) | 425 | #:steps steps)) |
| 426 | 426 | ||
| 427 | (match (result-step results 'final) | 427 | (match (result-step results 'final) |
| 428 | ('success | 428 | ('success |
| 429 | ;; We did it! Let's reboot! | 429 | ;; We did it! Let's reboot! |
| 430 | (sync) | 430 | (sync) |
| 431 | (stop-service 'root)) | 431 | (stop-service 'root)) |
| 432 | (_ | 432 | (_ |
| 433 | ;; The installation failed, exit so that it is restarted | 433 | ;; The installation failed, exit so that it is restarted |
| 434 | ;; by login. | 434 | ;; by login. |
| 435 | #f))) | 435 | #f))) |
| 436 | (const #f) | 436 | (const #f) |
| 437 | (lambda (key . args) | 437 | (lambda (key . args) |
| 438 | (syslog "crashing due to uncaught exception: ~s ~s~%" | 438 | (syslog "crashing due to uncaught exception: ~s ~s~%" |
| 439 | key args) | 439 | key args) |
| 440 | (let ((error-file "/tmp/last-installer-error") | 440 | (let ((error-file "/tmp/last-installer-error") |
| 441 | (dump-archive "/tmp/dump.tgz")) | 441 | (dump-archive "/tmp/dump.tgz")) |
| 442 | (call-with-output-file error-file | 442 | (call-with-output-file error-file |
| 443 | (lambda (port) | 443 | (lambda (port) |
| 444 | (display-backtrace (make-stack #t) port) | 444 | (display-backtrace (make-stack #t) port) |
| 445 | (print-exception port | 445 | (print-exception port |
| 446 | (stack-ref (make-stack #t) 1) | 446 | (stack-ref (make-stack #t) 1) |
| 447 | key args))) | 447 | key args))) |
| 448 | (make-dump dump-archive | 448 | (make-dump dump-archive |
| 449 | #:result %current-result | 449 | #:result %current-result |
| 450 | #:backtrace error-file) | 450 | #:backtrace error-file) |
| 451 | (let ((report | 451 | (let ((report |
| 452 | ((installer-dump-page current-installer) | 452 | ((installer-dump-page current-installer) |
| 453 | dump-archive))) | 453 | dump-archive))) |
| 454 | ((installer-exit-error current-installer) | 454 | ((installer-exit-error current-installer) |
| 455 | error-file report key args))) | 455 | error-file report key args))) |
| 456 | (primitive-exit 1))) | 456 | (primitive-exit 1))) |
| 457 | 457 | ||
| 458 | ((installer-exit current-installer))))))) | 458 | ((installer-exit current-installer)))))) |
| 459 | 459 | ||
| 460 | (program-file | 460 | (program-file |
| 461 | "installer" | 461 | "installer" |
