guix-commits
[Top][All Lists]
Advanced

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

09/21: installer: Clear the mount point field for swap file systems.


From: John Darrington
Subject: 09/21: installer: Clear the mount point field for swap file systems.
Date: Sun, 29 Jan 2017 07:35:02 +0000 (UTC)

jmd pushed a commit to branch wip-installer
in repository guix.

commit 39b613862b6022b724415b7ab868c3eb36d2c7b7
Author: John Darrington <address@hidden>
Date:   Tue Jan 24 15:54:44 2017 +0100

    installer: Clear the mount point field for swap file systems.
    
    * gnu/system/installer/mount-point.scm (mount-point-page-init): Clear mount
    point field for swap file systems or unused file systems.
---
 gnu/system/installer/mount-point.scm |   21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/gnu/system/installer/mount-point.scm 
b/gnu/system/installer/mount-point.scm
index 62cdbcc..794ec9f 100644
--- a/gnu/system/installer/mount-point.scm
+++ b/gnu/system/installer/mount-point.scm
@@ -37,7 +37,7 @@
 
 (define (my-fields) `((mount-point ,(M_ "Mount Point") 40)
                       (fs-type     ,(M_ "File System Type")
-                                   ,valid-file-system-types)
+                                   ,(append valid-file-system-types (list 
"<unused>")))
                       (label       ,(M_ "Label") 16)))
 
 (define (mount-point-refresh page)
@@ -124,11 +124,20 @@
                 (my-fields)
                 (lambda (f)
                   (let ((field (get-current-field f)))
-                    (if (eq? (field-symbol field) 'mount-point)
-                        (form-set-value! f 'label
-                                         (string-append
-                                          host-name "-"
-                                          (form-get-value f 
'mount-point)))))))))
+                    (case (field-symbol field)
+                      ((mount-point)
+                       (form-set-value! f 'label
+                                        (string-append
+                                         host-name "-"
+                                         (form-get-value f 'mount-point))))
+                      ((fs-type)
+                       (cond
+                        ((equal? "swap" (form-get-value f 'fs-type))
+                         (form-set-value! f 'label "swap-space")
+                         (form-set-value! f 'mount-point ""))
+                        ((equal? "<unused>" (form-get-value f 'fs-type))
+                         (form-set-value! f 'label "")
+                         (form-set-value! f 'mount-point ""))))))))))
 
     (page-set-datum! p 'navigation nav)
     (let ((dev (page-datum p 'device)))



reply via email to

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