mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
file-systems: Use creation time if modification time is unset for ISO9660.
* gnu/build/file-systems.scm (iso9660-superblock-uuid): Modify.
This commit is contained in:
parent
15df12beae
commit
c6aee77e29
1 changed files with 8 additions and 2 deletions
|
@ -268,12 +268,18 @@ (define (read-iso9660-superblock device)
|
|||
|
||||
(define (iso9660-superblock-uuid sblock)
|
||||
"Return the modification time of an iso9660 primary volume descriptor
|
||||
SBLOCK as a bytevector."
|
||||
SBLOCK as a bytevector. If that's not set, returns the creation time."
|
||||
;; 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))
|
||||
(let* ((creation-time (sub-bytevector sblock 813 17))
|
||||
(modification-time (sub-bytevector sblock 830 17))
|
||||
(unset-time (make-bytevector 17 0))
|
||||
(time (if (bytevector=? unset-time modification-time)
|
||||
creation-time
|
||||
modification-time)))
|
||||
(sub-bytevector time 0 16))) ; strips GMT offset.
|
||||
|
||||
(define (iso9660-uuid->string uuid)
|
||||
"Given an UUID bytevector, return its timestamp string."
|
||||
|
|
Loading…
Reference in a new issue