From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dze5A-0001bb-F5 for guix-patches@gnu.org; Wed, 04 Oct 2017 03:27:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dze59-00064b-Ih for guix-patches@gnu.org; Wed, 04 Oct 2017 03:27:04 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:38707) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dze59-00064Q-Fh for guix-patches@gnu.org; Wed, 04 Oct 2017 03:27:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dze59-0001uj-9Z for guix-patches@gnu.org; Wed, 04 Oct 2017 03:27:03 -0400 Subject: [bug#28696] [PATCH 4/5] uuid: Change "fat32" to "fat". Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Wed, 4 Oct 2017 09:25:53 +0200 Message-Id: <20171004072554.1377-4-ludo@gnu.org> In-Reply-To: <20171004072554.1377-1-ludo@gnu.org> References: <20171004072554.1377-1-ludo@gnu.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 28696@debbugs.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." ;;; -;;; 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)))) @@ -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