All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Schmitt" <scdbackup@gmx.net>
To: grub-devel@gnu.org
Cc: development@efficientek.com
Subject: Re: [PATCH v2 1/8] tests: Make sure LANG is set properly for iso9660_test
Date: Thu, 26 Aug 2021 23:28:04 +0200	[thread overview]
Message-ID: <7863361573464381110@scdbackup.webframe.org> (raw)
In-Reply-To: <20210826151640.45f9fe81@crass-HP-ZBook-15-G2>

Hi,

i wrote:
> >   xorriso ... -as mkisofs -input-charset UTF-8 -output-charset UTF-8

Glenn Washburn wrote:
> Do there need to be any UTF-8 locales installed (or any locales for
> that matter) for this to work? My guess is no.

I expect the same. It's not easy to test, though.

In theory it is essentially a matter of iconv_open(3) and iconv(3) whether
conversion works.
The installed locale only gives the default values for parameters of
  iconv_t iconv_open(const char *tocode, const char *fromcode);
The options -input-charset and -output-charset override the locale
setting, whatever it is.
(Actually xorriso stumbled over the hardcoded output character set of
Joliet, which is UCS-2.)


> Correct me if I'm wrong, but this logic about defaulting LANG is more
> general than the iso9660_test. Would you agree that this should be
> applied to the tests a a whole?

The comments in grub-fs-tester talk of UTF-8 as expected character set
and the text constants look like UTF-8, too. So it would not be wrong
to enforce a UTF-8 locale.

It might be peculiar to xorriso to look at the locale when interpreting
the meaning of bytes which represent characters.
But this interpretation is inevitable if the target filesystem specs
prescribe a particular character set, as Joliet does, and if we aim for
dealing with UTF-8 names.


> If yes, then I should probably remove this patch altogether and put
> this code elsewhere.

I think it can be justified to hardcode UTF-8 in grub-fs-tester regardless
whether higher levels of the test empire or the user have own interests
in locale settings.
The code in grub-fs-tester is a good example for the situation that the
file names on disk might belong to users with differing locales. We expect
UTF-8 to be the common base of all those nowadays.

So i'd vote for something like

  if [ -n "${LANG##*UTF*}" ]; then
     echo "NOTE: LANG=$LANG appears to not be UTF-8."
     echo "NOTE: Setting LANG=en_US.UTF-8 to match the test file names."
     export LANG=en_US.UTF-8
  fi

at the start of grub-fs-tester.in.


> > How can i force "make check" to do something at its second run ?

> However, "make check" should still be running the test.

I obviously got misled by the many make messages and the silence of the
iso9660_test run.


> Would you submit a patch with the changes you've
> outlined that would fix this issue for when LANG is empty?

I'd go farer and smack down everything that does not claim to be UTF-8.

Is a git diff enough or has it to be git format-patch from a local commit ?
Is git send-email necessary ?
(My relation to git based interaction with projects is best illustrated by
  https://upload.wikimedia.org/wikipedia/commons/thumb/1/17/Laocoon_Pio-Clementino_Inv1059-1064-1067.jpg/564px-Laocoon_Pio-Clementino_Inv1059-1064-1067.jpg
)


Have a nice day :)

Thomas



  reply	other threads:[~2021-08-26 21:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  7:03 [PATCH v2 0/8] Various fixes/improvements for tests Glenn Washburn
2021-08-25  7:03 ` [PATCH v2 1/8] tests: Make sure LANG is set properly for iso9660_test Glenn Washburn
2021-08-25  9:34   ` Thomas Schmitt
2021-08-25 19:49     ` Glenn Washburn
2021-08-26  6:53       ` Thomas Schmitt
2021-08-26 17:06         ` Glenn Washburn
2021-08-26 17:49         ` Thomas Schmitt
2021-08-26 20:16           ` Glenn Washburn
2021-08-26 21:28             ` Thomas Schmitt [this message]
2021-08-26 22:30               ` Glenn Washburn
2021-08-27 19:13                 ` Thomas Schmitt
2021-08-27 20:03                   ` Glenn Washburn
2021-08-27 21:23                     ` Thomas Schmitt
2021-08-25  7:03 ` [PATCH v2 2/8] tests: Fix partmap_test for arm*-efi, disk numbering has changed Glenn Washburn
2021-10-06 13:45   ` Daniel Kiper
2021-08-25  7:03 ` [PATCH v2 3/8] tests: When checking squashfs fstime, use superblock last modified time Glenn Washburn
2021-10-06 13:46   ` Daniel Kiper
2021-08-25  7:03 ` [PATCH v2 4/8] tests: Fail immediately when grub-shell fails and do not occlude the error code Glenn Washburn
2021-10-06 13:57   ` Daniel Kiper
2021-10-06 20:05     ` Glenn Washburn
2021-10-07 12:37       ` Daniel Kiper
2021-10-07 15:35         ` Glenn Washburn
2021-08-25  7:03 ` [PATCH v2 5/8] tests: Make setup errors in grub-fs-tester hard errors Glenn Washburn
2021-10-06 15:26   ` Daniel Kiper
2021-08-25  7:04 ` [PATCH v2 6/8] tests: A failure of mktemp should cause the test script to exit with code 99 Glenn Washburn
2021-10-06 15:28   ` Daniel Kiper
2021-08-25  7:04 ` [PATCH v2 7/8] tests: Exit with skipped exit code when test not performed Glenn Washburn
2021-09-17 21:42   ` Glenn Washburn
2021-10-06 15:34     ` Daniel Kiper
2021-08-25  7:04 ` [PATCH v2 8/8] tests: Use @BUILD_SHEBANG@ autoconf var instead of literal shell Glenn Washburn
2021-10-06 15:37   ` Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7863361573464381110@scdbackup.webframe.org \
    --to=scdbackup@gmx.net \
    --cc=development@efficientek.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.