Re: [PATCH v2 6/8] travis-ci: don't install 'language-pack-is' package
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Dec 19, 2017, 12:22 UTC
- Message-ID
- <CAM0VKjnctWRatbjB7EPHH+5zLjZLY+1umgFwz=bcV=g25eTD4w@mail.gmail.com>
- In-Reply-To
- <CAM0VKj=xVfCd5qR4jXwFGDxSABgyAeZY5qJxUP3GHvUE7gjw6A@mail.gmail.com>
On Mon, Dec 18, 2017 at 11:04 PM, SZEDER Gábor <szeder.dev@gmail.com> wrote:
Show 24 quoted lines
> $ sudo apt-get install language-pack-is > [...] > $ ./t0204-gettext-reencode-sanity.sh > # lib-gettext: Found 'is_IS.utf8' as an is_IS UTF-8 locale > # lib-gettext: No is_IS ISO-8859-1 locale available > ok 1 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic > ok 2 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes > ok 3 # skip gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / > Icelandic (missing GETTEXT_ISO_LOCALE) > ok 4 # skip gettext: impossible ISO-8859-1 output (missing GETTEXT_ISO_LOCALE) > ok 5 - gettext: Fetching a UTF-8 msgid -> UTF-8 > ok 6 # skip gettext: Fetching a UTF-8 msgid -> ISO-8859-1 (missing > GETTEXT_ISO_LOCALE) > ok 7 - gettext.c: git init UTF-8 -> UTF-8 > ok 8 # skip gettext.c: git init UTF-8 -> ISO-8859-1 (missing > GETTEXT_ISO_LOCALE) > # passed all 8 test(s) > 1..8 > > I'd expect something like this in the Travis CI build jobs as well, but > prove hides the detailed output. > > It seems we would loose coverage with this patch, so it should be > dropped.
Not so fast!
Notice how there are still a few tests skipped above, because of missing GETTEXT_ISO_LOCALE.
# grep is_IS /etc/locale.gen # is_IS ISO-8859-1 # is_IS.UTF-8 UTF-8 # sed -i -e 's/^# is_IS/is_IS/' /etc/locale.gen # locale-gen Generating locales (this might take a while)... [...] is_IS.ISO-8859-1... done is_IS.UTF-8... done Generation complete.
Both UTF-8 and ISO Icelandic locales are generated, good.
$ $ ./t0204-gettext-reencode-sanity.sh # lib-gettext: Found 'is_IS.utf8' as an is_IS UTF-8 locale # lib-gettext: Found 'is_IS.iso88591' as an is_IS ISO-8859-1 locale ok 1 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic ok 2 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes ok 3 - gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic ok 4 - gettext: impossible ISO-8859-1 output ok 5 - gettext: Fetching a UTF-8 msgid -> UTF-8 ok 6 - gettext: Fetching a UTF-8 msgid -> ISO-8859-1 ok 7 - gettext.c: git init UTF-8 -> UTF-8 ok 8 - gettext.c: git init UTF-8 -> ISO-8859-1 # passed all 8 test(s)
And now all those tests are run, great! But look what happens without the language pack:
# dpkg -P language-pack-is{,-base}
[...]
# grep is_IS /etc/locale.gen
is_IS ISO-8859-1
is_IS.UTF-8 UTF-8
buzz ~# locale-gen
Generating locales (this might take a while)...
[...]
is_IS.ISO-8859-1... done
is_IS.UTF-8... done
Generation complete.Still both Icelandic locales are generated.
$ ./t0204-gettext-reencode-sanity.sh # lib-gettext: Found 'is_IS.utf8' as an is_IS UTF-8 locale # lib-gettext: Found 'is_IS.iso88591' as an is_IS ISO-8859-1 locale ok 1 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Icelandic ok 2 - gettext: Emitting UTF-8 from our UTF-8 *.mo files / Runes ok 3 - gettext: Emitting ISO-8859-1 from our UTF-8 *.mo files / Icelandic ok 4 - gettext: impossible ISO-8859-1 output ok 5 - gettext: Fetching a UTF-8 msgid -> UTF-8 ok 6 - gettext: Fetching a UTF-8 msgid -> ISO-8859-1 ok 7 - gettext.c: git init UTF-8 -> UTF-8 ok 8 - gettext.c: git init UTF-8 -> ISO-8859-1 # passed all 8 test(s)
And still all those tests are run!
I did run all test scripts sourcing 'lib-gettext.sh' with both locales generated and didn't see any errors, independently from whether the language pack was installed or not. I still have a few skipped tests (because of no GETTEXT_POISON and something PCRE-related), but those, too, are independent from the language pack.
So it seems that we don't need 'language-pack-is' after all; what we do need are the ISO and UTF-8 Icelandic locales. Not sure we can modify /etc/locale.gen without sudo in the Travis CI build job, though, and I've run out of time to try.
Gábor