From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIACf-0004XK-Oq for guix-patches@gnu.org; Tue, 06 Jun 2017 04:51:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIACc-0002rZ-Lw for guix-patches@gnu.org; Tue, 06 Jun 2017 04:51:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:55797) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dIACc-0002r4-IH for guix-patches@gnu.org; Tue, 06 Jun 2017 04:51:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dIACc-0001r6-8P for guix-patches@gnu.org; Tue, 06 Jun 2017 04:51:02 -0400 Subject: bug#27265: [PATCH] file-systems: Use creation time if modification time is unset for ISO9660. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIACP-0004Wl-6L for guix-patches@gnu.org; Tue, 06 Jun 2017 04:50:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIACM-0002eG-3C for guix-patches@gnu.org; Tue, 06 Jun 2017 04:50:49 -0400 Received: from dd1012.kasserver.com ([85.13.128.8]:40134) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIACL-0002d6-TU for guix-patches@gnu.org; Tue, 06 Jun 2017 04:50:46 -0400 From: Danny Milosavljevic Date: Tue, 6 Jun 2017 10:50:37 +0200 Message-Id: <20170606085037.28353-1-dannym@scratchpost.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: 27265@debbugs.gnu.org * gnu/build/file-systems.scm (iso9660-superblock-uuid): Modify. --- gnu/build/file-systems.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 10be0dc83..7737de3d0 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm @@ -268,12 +268,18 @@ as a bytevector, or #f if DEVICE does not contain an iso9660 file system." (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."