guix-commits
[Top][All Lists]
Advanced

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

16/21: installer: Prevent the user specifying the same mount point twice


From: John Darrington
Subject: 16/21: installer: Prevent the user specifying the same mount point twice.
Date: Sat, 31 Dec 2016 14:54:18 +0000 (UTC)

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

commit db6428aafe23dcd599710a74ac7425933ee94216
Author: John Darrington <address@hidden>
Date:   Fri Dec 30 15:01:31 2016 +0100

    installer: Prevent the user specifying the same mount point twice.
    
    * gnu/system/installer/filesystems.scm (filesystem-task-incomplete): Add the
    condition that no mount point may appear more than once.
---
 gnu/system/installer/filesystems.scm |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gnu/system/installer/filesystems.scm 
b/gnu/system/installer/filesystems.scm
index 0f67342..4297ef3 100644
--- a/gnu/system/installer/filesystems.scm
+++ b/gnu/system/installer/filesystems.scm
@@ -51,6 +51,17 @@
    (and (not (find-mount-device "/" mount-points))
         (N_ "You must specify a mount point for the root (/)."))
 
+   (let loop ((ll mount-points)
+              (ac '()))
+     (match ll
+       ('() #f)
+       (((_ . directory) . rest)
+        (if (member directory ac)
+            (format #f
+                    (N_ "You have specified the mount point ~a more than 
once.")
+                    directory)
+            (loop rest (cons directory ac))))))
+
    (let ((partitions-without-filesystems
           (fold (lambda (x prev)
                   (if (not (string-prefix? "ext"



reply via email to

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