Date: Sat, 30 Oct 2021 20:31:31 +0200 From: Stefan Esser <se@freebsd.org> To: Jamie Landeg-Jones <jamie@catflap.org> Cc: re@freebsd.org, freebsd-current@freebsd.org Subject: Re: stat(1) isn't honouring locale Message-ID: <6f3d4cfe-23aa-24ae-f027-aa8b7c7cd19c@freebsd.org> In-Reply-To: <202110301212.19UCCr9V048037@donotpassgo.dyslexicfish.net> References: <202110291815.19TIFARt072516@donotpassgo.dyslexicfish.net> <6d01974e-216f-b218-06e8-83d055fdc33a@freebsd.org> <202110301212.19UCCr9V048037@donotpassgo.dyslexicfish.net>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------HDZ9TdMNUPRRcnCLKXcFOW4b Content-Type: multipart/mixed; boundary="------------09F7jSZkwMKC7x6kfSfI8Yug"; protected-headers="v1" From: Stefan Esser <se@freebsd.org> To: Jamie Landeg-Jones <jamie@catflap.org> Cc: re@freebsd.org, freebsd-current@freebsd.org Message-ID: <6f3d4cfe-23aa-24ae-f027-aa8b7c7cd19c@freebsd.org> Subject: Re: stat(1) isn't honouring locale References: <202110291815.19TIFARt072516@donotpassgo.dyslexicfish.net> <6d01974e-216f-b218-06e8-83d055fdc33a@freebsd.org> <202110301212.19UCCr9V048037@donotpassgo.dyslexicfish.net> In-Reply-To: <202110301212.19UCCr9V048037@donotpassgo.dyslexicfish.net> --------------09F7jSZkwMKC7x6kfSfI8Yug Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 30.10.21 um 14:12 schrieb Jamie Landeg-Jones:> Stefan Esser <se@freebs= d.org> wrote: > >>> % date +%+ >>> Fri 29 Oct 2021 00:15:05 BST >>> >>> % stat -t%+ -f '%Sm' . >>> Fri Oct 29 00:13:38 BST 2021 >>> ----------------------------- > >> thank you for reporting this issue and suggesting a fix. >> >> I have committed your proposed fix to -CURRENT as Git commit >> 20f8331aca892ff8 >> and plan to MFC it to 13-STABLE in a few days. >> >> I'm CCing to the release engineer, since this might be a change that >> we want to include in the upcoming 12.3 release (currently in beta). > > Thanks, and thanks for the quick response! I wasn't sure if it was an > oversight,> or if there was something I missed. The man page does not mention a locale dependency, and strftime() without setting a locale just returns the date for the POSIX locale. But I think that it was an oversight, since the date command respects the locale by default and with the change you suggested, it is possible to get the stat output in the locale specific format but also in the format previously displayed. This might be a change that violates POLA, since a format changes in an existing application, and I'm not sure whether a MFC to 12.3 might be too large a change at that time of the release cycle. If it is merged to 13-STABLE I'll add a "add to release notes" marker. But I do think that this is a worthwhile change that has just been forgotten when other utilities have been made locale aware. Regards, STefan --------------09F7jSZkwMKC7x6kfSfI8Yug-- --------------HDZ9TdMNUPRRcnCLKXcFOW4b Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmF9j4MFAwAAAAAACgkQR+u171r99UTZ ZAgAq+0EyopfBELD2GqTaacNa1FnE8EpJfGeuXo413SJzV9iWVeBExUeinB+FfiIRPLG1wAcCak7 rgDPid+FgKHMvYd0gkx/BbdhsWuWJ6wgdOQUoy+Tb2vkHV5AC+sCuS8O03P2l/TU05L5OnkTV992 QEKPSsFILkDW1HRheQlxCtL//ngWESCKmK3n69j3P8cyBLEFCQvzLsiCKaKrRz49VR1gsIgeIE2/ KKz1I++U8mRU8WTZhm1ResgjBDBANm9sl/8v+70mY3Twvk9LIuR9fj9vgwJxvD6U7fumzYTBhm5w 4dmknVfm1n3NHWZ1EoyhTgzBM5PE8SBW+NekYoRuQA== =QyXl -----END PGP SIGNATURE----- --------------HDZ9TdMNUPRRcnCLKXcFOW4b--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6f3d4cfe-23aa-24ae-f027-aa8b7c7cd19c>