GNU bug report logs -
#26751
[PATCH] gnu: build: file-systems: Add ISO-9660.
Previous Next
Full log
Message #11 received at 26751 <at> debbugs.gnu.org (full text, mbox):
Danny Milosavljevic <dannym <at> scratchpost.org> skribis:
> * gnu/build/file-systems.scm (iso9660-superblock?,
> read-iso9660-primary-volume-descriptor, read-iso9660-superblock,
> iso9660-superblock-uuid, iso9660-uuid->string,
> iso9660-superblock-volume-name): New variables.
> (%partition-label-readers): Add iso9660.
> (%partition-uuid-readers): Add iso9660.
[...]
> +(define (iso9660-superblock-uuid sblock)
> + "Return the modification time of a iso9660 superblock SBLOCK as a bytevector."
> + ;; FIXME Use only certain parts (See grub).
> + ;; FIXME treat "all 0" as invalid.
Please expound these two comments, as discussed on guix-devel.
> + ;; Drops GMT offset for compatibility with Grub, blkid and /dev/disk/by-uuid.
> + ;; Compare Grub: "2014-12-02-19-30-23-00".
> + ;; Compare blkid result: "2014-12-02-19-30-23-00".
> + ;; Compare /dev/disk/by-uuid entry: "2014-12-02-19-30-23-00".
> + (sub-bytevector sblock 830 16))
> +
> +(define (iso9660-uuid->string uuid)
> + (define digits->string latin1->string)
> + (let* ((year (sub-bytevector uuid 0 4))
> + (month (sub-bytevector uuid 4 2))
> + (day (sub-bytevector uuid 6 2))
> + (hour (sub-bytevector uuid 8 2))
> + (minute (sub-bytevector uuid 10 2))
> + (second (sub-bytevector uuid 12 2))
> + (hundreths (sub-bytevector uuid 14 2))
> + (parts (list year month day hour minute second hundreths)))
> + (string-append (string-join (map digits->string parts)))))
Neat! Please add a docstring.
> +(define (iso9660-superblock-volume-name sblock)
> + "Return the volume name of SBLOCK as a string. The volume name is an ASCII
> +string. Trailing spaces are trimmed."
> + (string-trim-right (latin1->string (sub-bytevector sblock 40 32) (lambda (c) #f)) #\space))
Please trim to 80 columns. :-)
OK with these changes, thank you!
Ludo’.
This bug report was last modified 8 years and 19 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.