installer: keymap: Fix keymap selection of layouts with not variant.

* gnu/installer/newt/keymap.scm (run-keymap-page): Test if the layout has no
variant at 'variant step, instead of raising a condition at 'layout step.
This commit is contained in:
Mathieu Othacehe 2018-12-05 21:55:51 +09:00 committed by Ludovic Courtès
parent 479414e1c9
commit 9e58d4e90e
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 12 additions and 16 deletions

View File

@ -66,28 +66,24 @@ names of the selected keyboard layout and variant."
(id 'layout)
(compute
(lambda _
(let* ((layout (run-layout-page
layouts
(lambda (layout)
(x11-keymap-layout-description layout)))))
(if (null? (x11-keymap-layout-variants layout))
;; Break if this layout does not have any variant.
(raise
(condition
(&installer-step-break)))
layout)))))
(run-layout-page
layouts
(lambda (layout)
(x11-keymap-layout-description layout))))))
;; Propose the user to select a variant among those supported by the
;; previously selected layout.
(installer-step
(id 'variant)
(compute
(lambda (result _)
(let ((variants (x11-keymap-layout-variants
(result-step result 'layout))))
(run-variant-page variants
(lambda (variant)
(x11-keymap-variant-description
variant)))))))))
(let* ((layout (result-step result 'layout))
(variants (x11-keymap-layout-variants layout)))
;; Return #f if the layout does not have any variant.
(and (not (null? variants))
(run-variant-page variants
(lambda (variant)
(x11-keymap-variant-description
variant))))))))))
(define (format-result result)
(let ((layout (x11-keymap-layout-name