installer: Fix crash in parameters menu.
Fixes: <https://issues.guix.gnu.org/45378>. * gnu/installer/newt/keymap.scm (run-layout-page): Return false when "Continue" button is pressed. (run-keymap-page): Do not try to compute variants if layout is false. Also do not try to format the result if layout is false. * gnu/installer.scm (compute-keymap-step): Do not apply keymap if "run-keymap-page" returns false.master
parent
55157c9071
commit
bb4e67415e
|
@ -187,7 +187,7 @@ selected keymap."
|
||||||
(lambda (models layouts)
|
(lambda (models layouts)
|
||||||
((installer-keymap-page current-installer)
|
((installer-keymap-page current-installer)
|
||||||
layouts '#$context)))))
|
layouts '#$context)))))
|
||||||
(#$apply-keymap result)
|
(and result (#$apply-keymap result))
|
||||||
result)))
|
result)))
|
||||||
|
|
||||||
(define (installer-steps)
|
(define (installer-steps)
|
||||||
|
|
|
@ -56,7 +56,7 @@ different layout at any time from the parameters menu.")))
|
||||||
(else (G_ "Exit")))
|
(else (G_ "Exit")))
|
||||||
#:button-callback-procedure
|
#:button-callback-procedure
|
||||||
(case context
|
(case context
|
||||||
((param) (const #t))
|
((param) (const #f))
|
||||||
(else
|
(else
|
||||||
(lambda _
|
(lambda _
|
||||||
(raise
|
(raise
|
||||||
|
@ -183,7 +183,9 @@ options."
|
||||||
(compute
|
(compute
|
||||||
(lambda (result _)
|
(lambda (result _)
|
||||||
(let* ((layout (result-step result 'layout))
|
(let* ((layout (result-step result 'layout))
|
||||||
(variants (x11-keymap-layout-variants layout)))
|
(variants (if layout
|
||||||
|
(x11-keymap-layout-variants layout)
|
||||||
|
'())))
|
||||||
;; Return #f if the layout does not have any variant.
|
;; Return #f if the layout does not have any variant.
|
||||||
(and (not (null? variants))
|
(and (not (null? variants))
|
||||||
(run-variant-page
|
(run-variant-page
|
||||||
|
@ -196,16 +198,19 @@ options."
|
||||||
(gettext (x11-keymap-layout-description layout)
|
(gettext (x11-keymap-layout-description layout)
|
||||||
"xkeyboard-config")))))))))))
|
"xkeyboard-config")))))))))))
|
||||||
|
|
||||||
(define (format-result result)
|
(define (format-result layout variant)
|
||||||
(let ((layout (x11-keymap-layout-name
|
(let ((layout (x11-keymap-layout-name layout))
|
||||||
(result-step result 'layout)))
|
(variant (and=> variant
|
||||||
(variant (and=> (result-step result 'variant)
|
|
||||||
(lambda (variant)
|
(lambda (variant)
|
||||||
(gettext (x11-keymap-variant-name variant)
|
(gettext (x11-keymap-variant-name variant)
|
||||||
"xkeyboard-config")))))
|
"xkeyboard-config")))))
|
||||||
(toggleable-latin-layout layout variant)))
|
(toggleable-latin-layout layout variant)))
|
||||||
(format-result
|
|
||||||
(run-installer-steps #:steps keymap-steps)))
|
(let* ((result (run-installer-steps #:steps keymap-steps))
|
||||||
|
(layout (result-step result 'layout))
|
||||||
|
(variant (result-step result 'variant)))
|
||||||
|
(and layout
|
||||||
|
(format-result layout variant))))
|
||||||
|
|
||||||
(define (keyboard-layout->configuration keymap)
|
(define (keyboard-layout->configuration keymap)
|
||||||
"Return the operating system configuration snippet to install KEYMAP."
|
"Return the operating system configuration snippet to install KEYMAP."
|
||||||
|
|
Reference in New Issue