guix-commits
[Top][All Lists]
Advanced

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

11/12: installer: Replace one usage of car with match.


From: John Darrington
Subject: 11/12: installer: Replace one usage of car with match.
Date: Sun, 15 Jan 2017 15:45:40 +0000 (UTC)

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

commit c4c569002effa8d5aee6b6b805bef59aadd3cf7b
Author: John Darrington <address@hidden>
Date:   Sun Jan 15 13:37:09 2017 +0100

    installer: Replace one usage of car with match.
    
    * gnu/system/installer/format.scm (device-fs-uuid): Replace car with match.
---
 gnu/system/installer/format.scm |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gnu/system/installer/format.scm b/gnu/system/installer/format.scm
index 1684b36..81483cf 100644
--- a/gnu/system/installer/format.scm
+++ b/gnu/system/installer/format.scm
@@ -38,10 +38,13 @@
 (define (device-fs-uuid dev)
   "Retrieve the UUID of the filesystem on DEV, where DEV is the name of the
 device such as /dev/sda1"
-  (car (assoc-ref
-        (slurp (string-append "blkid -o export " dev)
-               (lambda (x)
-                 (string-split x #\=))) "UUID")))
+  (match (assoc-ref
+          (slurp (string-append "blkid -o export " dev)
+                 (lambda (x)
+                   (string-split x #\=))) "UUID")
+         (() #f)
+         ((? list? l)
+          (car l))))
 
 (define (filesystems-are-current?)
   "Returns #t iff there is at least one mount point AND all mount-points' uuids



reply via email to

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