From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dINlg-0006rC-DD for guix-patches@gnu.org; Tue, 06 Jun 2017 19:20:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dINla-0006B8-8i for guix-patches@gnu.org; Tue, 06 Jun 2017 19:20:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:57369) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dINla-0006B2-4Y for guix-patches@gnu.org; Tue, 06 Jun 2017 19:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dINlZ-0003Ui-VQ for guix-patches@gnu.org; Tue, 06 Jun 2017 19:20:01 -0400 Subject: bug#27265: [PATCH] file-systems: Use creation time if modification time is unset for ISO9660. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170606085037.28353-1-dannym@scratchpost.org> Date: Wed, 07 Jun 2017 01:19:34 +0200 In-Reply-To: <20170606085037.28353-1-dannym@scratchpost.org> (Danny Milosavljevic's message of "Tue, 6 Jun 2017 10:50:37 +0200") Message-ID: <87o9u066wp.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Danny Milosavljevic Cc: 27265@debbugs.gnu.org Danny Milosavljevic skribis: > * 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 a= n iso9660 file system." >=20=20 > (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/b= y-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=3D? unset-time modification-time) > + creation-time > + modification-time))) > + (sub-bytevector time 0 16))) ; strips GMT offset. LGTM. I suppose this makes those UUIDs a bit more unique, right? Thank you, Ludo=E2=80=99.