guix-commits
[Top][All Lists]
Advanced

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

101/197: installer: Replace one usage of car with match.


From: Danny Milosavljevic
Subject: 101/197: installer: Replace one usage of car with match.
Date: Mon, 3 Jul 2017 20:37:07 -0400 (EDT)

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

commit f0a4412fbafc573bcb6c2e952b7cc9e73427ee8a
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]