guix-commits
[Top][All Lists]
Advanced

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

01/01: installer: Validate mount point a little, too.


From: Danny Milosavljevic
Subject: 01/01: installer: Validate mount point a little, too.
Date: Fri, 7 Jul 2017 16:08:37 -0400 (EDT)

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

commit b45a1072509d8ffd766f253f1e0303f01f91fa00
Author: Danny Milosavljevic <address@hidden>
Date:   Fri Jul 7 22:07:50 2017 +0200

    installer: Validate mount point a little, too.
    
    * gnu/system/installer/mount-point.scm (validator): New variable.
    (my-fields): Use it here.
---
 gnu/system/installer/mount-point.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gnu/system/installer/mount-point.scm 
b/gnu/system/installer/mount-point.scm
index 204d3ad..c6ee4a4 100644
--- a/gnu/system/installer/mount-point.scm
+++ b/gnu/system/installer/mount-point.scm
@@ -32,7 +32,12 @@
 
 (include "i18n.scm")
 
-(define (my-fields) `((mount-point ,(M_ "Mount Point") 40)
+(define validator
+  (let ((regexp (make-regexp "^/")))
+    (lambda (text)
+      (regexp-exec regexp text))))
+
+(define (my-fields) `((mount-point ,(M_ "Mount Point") 40 ,validator)
                       (fs-type     ,(M_ "File System Type")
                                    ,(append valid-file-system-types (list 
"<unused>")))
                       (label       ,(M_ "Label") 16)))



reply via email to

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