From nobody Sat Oct 30 18:31:31 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6DCB418331A9 for ; Sat, 30 Oct 2021 18:31:35 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HhSYg2Jwlz4dY1; Sat, 30 Oct 2021 18:31:35 +0000 (UTC) (envelope-from se@freebsd.org) Received: from [IPV6:2003:cd:5f11:ee00:fd88:d6c6:43fd:9b20] (p200300cd5f11ee00fd88d6c643fd9b20.dip0.t-ipconnect.de [IPv6:2003:cd:5f11:ee00:fd88:d6c6:43fd:9b20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 9C72126A6; Sat, 30 Oct 2021 18:31:34 +0000 (UTC) (envelope-from se@freebsd.org) Message-ID: <6f3d4cfe-23aa-24ae-f027-aa8b7c7cd19c@freebsd.org> Date: Sat, 30 Oct 2021 20:31:31 +0200 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: stat(1) isn't honouring locale Content-Language: en-US To: Jamie Landeg-Jones Cc: re@freebsd.org, freebsd-current@freebsd.org References: <202110291815.19TIFARt072516@donotpassgo.dyslexicfish.net> <6d01974e-216f-b218-06e8-83d055fdc33a@freebsd.org> <202110301212.19UCCr9V048037@donotpassgo.dyslexicfish.net> From: Stefan Esser In-Reply-To: <202110301212.19UCCr9V048037@donotpassgo.dyslexicfish.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------HDZ9TdMNUPRRcnCLKXcFOW4b" X-ThisMailContainsUnwantedMimeParts: N This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------HDZ9TdMNUPRRcnCLKXcFOW4b Content-Type: multipart/mixed; boundary="------------09F7jSZkwMKC7x6kfSfI8Yug"; protected-headers="v1" From: Stefan Esser To: Jamie Landeg-Jones 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 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--