all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 28696@debbugs.gnu.org
Subject: [bug#28696] [PATCH 4/5] uuid: Change "fat32" to "fat".
Date: Wed,  4 Oct 2017 09:25:53 +0200	[thread overview]
Message-ID: <20171004072554.1377-4-ludo@gnu.org> (raw)
In-Reply-To: <20171004072554.1377-1-ludo@gnu.org>

* gnu/system/uuid.scm (%fat32-endianness): Rename to...
(%fat-endianness): ... this.
(fat32-uuid->string): Rename to...
(fat-uuid->string): ... this.
(%fat32-uuid-rx): Rename to..
(%fat-uuid-rx): ... this.
(string->fat32-uuid): Rename to...
(string->fat-uuid): ... this.
(%uuid-parsers, %uuid-printers): Add 'fat16.
---
 gnu/system/uuid.scm | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/gnu/system/uuid.scm b/gnu/system/uuid.scm
index 6470abb8c..26953a9a9 100644
--- a/gnu/system/uuid.scm
+++ b/gnu/system/uuid.scm
@@ -41,7 +41,7 @@
             string->ext3-uuid
             string->ext4-uuid
             string->btrfs-uuid
-            string->fat32-uuid
+            string->fat-uuid
             iso9660-uuid->string
 
             ;; XXX: For lack of a better place.
@@ -163,25 +163,25 @@ ISO9660 UUID representation."
 
 \f
 ;;;
-;;; FAT32.
+;;; FAT32/FAT16.
 ;;;
 
-(define-syntax %fat32-endianness
-  ;; Endianness of FAT file systems.
+(define-syntax %fat-endianness
+  ;; Endianness of FAT32/FAT16 file systems.
   (identifier-syntax (endianness little)))
 
-(define (fat32-uuid->string uuid)
-  "Convert fat32 UUID, a 4-byte bytevector, to its string representation."
-  (let ((high  (bytevector-uint-ref uuid 0 %fat32-endianness 2))
-        (low (bytevector-uint-ref uuid 2 %fat32-endianness 2)))
+(define (fat-uuid->string uuid)
+  "Convert FAT32/FAT16 UUID, a 4-byte bytevector, to its string representation."
+  (let ((high  (bytevector-uint-ref uuid 0 %fat-endianness 2))
+        (low (bytevector-uint-ref uuid 2 %fat-endianness 2)))
     (format #f "~:@(~x-~x~)" low high)))
 
-(define %fat32-uuid-rx
+(define %fat-uuid-rx
   (make-regexp "^([[:xdigit:]]{4})-([[:xdigit:]]{4})$"))
 
-(define (string->fat32-uuid str)
-  "Parse STR, which is in FAT32 format, and return a bytevector or #f."
-  (match (regexp-exec %fat32-uuid-rx str)
+(define (string->fat-uuid str)
+  "Parse STR, which is in FAT32/FAT16 format, and return a bytevector or #f."
+  (match (regexp-exec %fat-uuid-rx str)
     (#f
      #f)
     (rx-match
@@ -189,7 +189,7 @@ ISO9660 UUID representation."
                                    (match:substring rx-match 2) 16)
                                   (string->number
                                    (match:substring rx-match 1) 16))
-                            %fat32-endianness
+                            %fat-endianness
                             2))))
 
 \f
@@ -215,14 +215,14 @@ ISO9660 UUID representation."
 (define %uuid-parsers
   (vhashq
    ('dce 'ext2 'ext3 'ext4 'btrfs 'luks => string->dce-uuid)
-   ('fat32 'fat => string->fat32-uuid)
+   ('fat32 'fat16 'fat => string->fat-uuid)
    ('iso9660 => string->iso9660-uuid)))
 
 (define %uuid-printers
   (vhashq
    ('dce 'ext2 'ext3 'ext4 'btrfs 'luks => dce-uuid->string)
    ('iso9660 => iso9660-uuid->string)
-   ('fat32 'fat => fat32-uuid->string)))
+   ('fat32 'fat16 'fat => fat-uuid->string)))
 
 (define* (string->uuid str #:optional (type 'dce))
   "Parse STR as a UUID of the given TYPE.  On success, return the
-- 
2.14.2

  parent reply	other threads:[~2017-10-04  7:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04  7:24 [bug#28696] [PATCH 0/5] Support UUIDs for the EFI System Partition (FAT) Ludovic Courtès
2017-10-04  7:25 ` [bug#28696] [PATCH 1/5] file-systems: 'mount-file-system' now takes a <file-system> object Ludovic Courtès
2017-10-04  7:25   ` [bug#28696] [PATCH 2/5] file-systems: Preserve UUID types when serializing Ludovic Courtès
2017-10-04  7:25   ` [bug#28696] [PATCH 3/5] file-systems: Add support for FAT16 Ludovic Courtès
2017-10-04  7:25   ` Ludovic Courtès [this message]
2017-10-04  7:25   ` [bug#28696] [PATCH 5/5] doc: Give an example with a FAT UUID Ludovic Courtès
2017-10-09 20:54 ` [bug#28696] [PATCH 0/5] Support UUIDs for the EFI System Partition (FAT) Roel Janssen
2017-10-11 19:49   ` Ludovic Courtès
2017-10-11  9:13 ` bug#28696: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171004072554.1377-4-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=28696@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.