guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: installer: Fix crash in parameters menu.


From: guix-commits
Subject: branch master updated: installer: Fix crash in parameters menu.
Date: Tue, 12 Jan 2021 10:41:28 -0500

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new bb4e674  installer: Fix crash in parameters menu.
bb4e674 is described below

commit bb4e67415eb6d9871ee1b50b0a01e08c19f4809a
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Tue Jan 12 16:26:07 2021 +0100

    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.
---
 gnu/installer.scm             |  2 +-
 gnu/installer/newt/keymap.scm | 21 +++++++++++++--------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/gnu/installer.scm b/gnu/installer.scm
index 7863edb..d2be4b3 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -187,7 +187,7 @@ selected keymap."
                (lambda (models layouts)
                  ((installer-keymap-page current-installer)
                   layouts '#$context)))))
-        (#$apply-keymap result)
+        (and result (#$apply-keymap result))
         result)))
 
 (define (installer-steps)
diff --git a/gnu/installer/newt/keymap.scm b/gnu/installer/newt/keymap.scm
index 1b3af2f..92f7f46 100644
--- a/gnu/installer/newt/keymap.scm
+++ b/gnu/installer/newt/keymap.scm
@@ -56,7 +56,7 @@ different layout at any time from the parameters menu.")))
        (else (G_ "Exit")))
      #:button-callback-procedure
      (case context
-       ((param) (const #t))
+       ((param) (const #f))
        (else
         (lambda _
           (raise
@@ -183,7 +183,9 @@ options."
       (compute
        (lambda (result _)
          (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.
            (and (not (null? variants))
                 (run-variant-page
@@ -196,16 +198,19 @@ options."
                        (gettext (x11-keymap-layout-description layout)
                                 "xkeyboard-config")))))))))))
 
-  (define (format-result result)
-    (let ((layout (x11-keymap-layout-name
-                   (result-step result 'layout)))
-          (variant (and=> (result-step result 'variant)
+  (define (format-result layout variant)
+    (let ((layout (x11-keymap-layout-name layout))
+          (variant (and=> variant
                           (lambda (variant)
                             (gettext (x11-keymap-variant-name variant)
                                      "xkeyboard-config")))))
       (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)
   "Return the operating system configuration snippet to install KEYMAP."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]