guix-commits
[Top][All Lists]
Advanced

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

128/197: installer: Remove redundant list of file system types.


From: Danny Milosavljevic
Subject: 128/197: installer: Remove redundant list of file system types.
Date: Mon, 3 Jul 2017 20:37:12 -0400 (EDT)

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

commit 0a5484b1dd2537d040d418805e47726e8915677e
Author: John Darrington <address@hidden>
Date:   Fri Jan 20 13:25:31 2017 +0100

    installer: Remove redundant list of file system types.
    
    * gnu/system/installer/filesystems.scm (valid-file-system-types) : Export
    * gnu/system/installer/mount-point.scm (my-fields): Change from variable to 
procedure.
---
 gnu/system/installer/filesystems.scm |  5 +++--
 gnu/system/installer/mount-point.scm | 10 +++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/gnu/system/installer/filesystems.scm 
b/gnu/system/installer/filesystems.scm
index a7fc4a4..0e69fdb 100644
--- a/gnu/system/installer/filesystems.scm
+++ b/gnu/system/installer/filesystems.scm
@@ -33,6 +33,7 @@
   #:use-module (srfi srfi-9)
 
   #:export (make-file-system-spec)
+  #:export (valid-file-system-types)
   #:export (<file-system-spec>)
   #:export (file-system-spec?)
   #:export (file-system-spec-mount-point)
@@ -59,10 +60,10 @@
   (type             file-system-spec-type)  ; symbol
   (uuid             file-system-spec-uuid))
 
-(define valid-file-system-types `(ext2 ext3 ext4 btrfs swap))
+(define valid-file-system-types `("ext2" "ext3" "ext4" "btrfs" "swap"))
 
 (define (make-file-system-spec mount-point label type)
-  (if (memq (string->symbol type) valid-file-system-types)
+  (if (member type valid-file-system-types)
       (let ((uuid (slurp "uuidgen" identity)))
         (make-file-system-spec' mount-point label
                                 (string->symbol type)
diff --git a/gnu/system/installer/mount-point.scm 
b/gnu/system/installer/mount-point.scm
index b7a1876..62cdbcc 100644
--- a/gnu/system/installer/mount-point.scm
+++ b/gnu/system/installer/mount-point.scm
@@ -35,10 +35,10 @@
     ((M_ str)
      str)))
 
-(define my-fields `((mount-point ,(M_ "Mount Point") 40)
-                    (fs-type     ,(M_ "File System Type")
-                                  ("ext2" "ext3" "ext4" "btrfs" "swap"))
-                    (label       ,(M_ "Label") 16)))
+(define (my-fields) `((mount-point ,(M_ "Mount Point") 40)
+                      (fs-type     ,(M_ "File System Type")
+                                   ,valid-file-system-types)
+                      (label       ,(M_ "Label") 16)))
 
 (define (mount-point-refresh page)
   (when (not (page-initialised? page))
@@ -121,7 +121,7 @@
 
 
         (form (make-form
-                my-fields
+                (my-fields)
                 (lambda (f)
                   (let ((field (get-current-field f)))
                     (if (eq? (field-symbol field) 'mount-point)



reply via email to

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