guix-commits
[Top][All Lists]
Advanced

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

05/05: file-systems: Leave room for extension in serialized specs.


From: guix-commits
Subject: 05/05: file-systems: Leave room for extension in serialized specs.
Date: Mon, 3 Aug 2020 11:46:18 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 86c926d7f2dd4906d51dbcd7d39474116768a68d
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Aug 3 17:44:38 2020 +0200

    file-systems: Leave room for extension in serialized specs.
    
    * gnu/system/file-systems.scm (spec->file-system): Ignore extra fields.
    (file-system->spec): Add comment.
---
 gnu/system/file-systems.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index a62cf90..5c02dfa 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -307,6 +307,7 @@ initrd code."
   (match fs
     (($ <file-system> device mount-point type flags options mount?
                       mount-may-fail? needed-for-boot? check?)
+     ;; Note: Add new fields towards the end for compatibility.
      (list (cond ((uuid? device)
                   `(uuid ,(uuid-type device) ,(uuid-bytevector device)))
                  ((file-system-label? device)
@@ -317,7 +318,8 @@ initrd code."
 (define (spec->file-system sexp)
   "Deserialize SEXP, a list, to the corresponding <file-system> object."
   (match sexp
-    ((device mount-point type flags options mount-may-fail? check?)
+    ((device mount-point type flags options mount-may-fail? check?
+             _ ...)                               ;placeholder for new fields
      (file-system
        (device (match device
                  (('uuid (? symbol? type) (? bytevector? bv))



reply via email to

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