From: Simon McVittie Date: Thu, 19 Aug 2021 20:54:32 +0000 (+0100) Subject: tests: Specify locales' charsets explicitly, fixing FTBFS with new glibc X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1~1^2~54 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d75e9802dd07af0a9655ad1f2921b850978d36b3;p=gtk4.git tests: Specify locales' charsets explicitly, fixing FTBFS with new glibc glibc 2.31-14 dropped support for all non-UTF-8 locales, so we can't use /usr/share/i18n/SUPPORTED to choose a suitable charset any more. --- diff --git a/debian/run-tests.sh b/debian/run-tests.sh index e0ece616c2..75eac128cf 100755 --- a/debian/run-tests.sh +++ b/debian/run-tests.sh @@ -53,7 +53,7 @@ env \ --generate de_DE.UTF-8 \ --generate en_GB.UTF-8 \ --generate en_US.UTF-8 \ - --generate sv_SE \ + --generate sv_SE=ISO-8859-1 \ -- \ meson test -C "$BUILDDIR" \ --print-errorlogs \ diff --git a/debian/tests/installed-tests b/debian/tests/installed-tests index dac000d133..954d02d8dd 100755 --- a/debian/tests/installed-tests +++ b/debian/tests/installed-tests @@ -22,7 +22,7 @@ debian/tests/run-with-locales \ --generate de_DE.UTF-8 \ --generate en_GB.UTF-8 \ --generate en_US.UTF-8 \ - --generate sv_SE \ + --generate sv_SE=ISO-8859-1 \ -- \ gnome-desktop-testing-runner \ --report-directory="$AUTOPKGTEST_ARTIFACTS" \ diff --git a/debian/tests/installed-tests-flaky b/debian/tests/installed-tests-flaky index 47b39cc179..230add64ef 100755 --- a/debian/tests/installed-tests-flaky +++ b/debian/tests/installed-tests-flaky @@ -16,7 +16,7 @@ debian/tests/run-with-locales \ --generate de_DE.UTF-8 \ --generate en_GB.UTF-8 \ --generate en_US.UTF-8 \ - --generate sv_SE \ + --generate sv_SE=ISO-8859-1 \ -- \ debian/tests/run-with-display $GDK_BACKEND \ gnome-desktop-testing-runner \ diff --git a/debian/tests/run-with-locales b/debian/tests/run-with-locales index a63d22bdeb..29264ef759 100755 --- a/debian/tests/run-with-locales +++ b/debian/tests/run-with-locales @@ -3,9 +3,10 @@ # Run a wrapped command with at least the requested locales available. # Requires a dependency on locales | locales-all. # The requested locales must be of the form foo_FOO.utf8, or special-cased -# in generate(). +# in generate(), or listed in /usr/share/i18n/SUPPORTED, or specify the +# locale in the form locale=charset. # -# Copyright 2016-2020 Simon McVittie +# Copyright 2016-2021 Simon McVittie # Copyright 2017-2018 Collabora Ltd. # # SPDX-License-Identifier: MIT @@ -57,13 +58,18 @@ unset getopt_temp generate () { local locale="$1" - local charset + local charset="" local source local output echo "$me: $locale..." >&2 case "$locale" in + (*=*) + source="${locale%=*}" + output="$source" + ;; + (*.*) source="${locale%.*}" output="$source.$( @@ -84,18 +90,27 @@ generate () { return fi + if ! [ -d /usr/share/i18n/charmaps ]; then + echo "$me: $locale not in locales-all and /usr/share/i18n/charmaps not found" >&2 + return + fi + case "$locale" in - (*.utf8) + (*=*) + charset="${locale##*=}" + ;; + + (*.utf8 | *.UTF-8) charset="UTF-8" ;; - (*) - charset=$(sed -ne "s/^$locale //p" /usr/share/i18n/SUPPORTED) + (*.*) + charset="${locale##*.}" ;; esac if [ -z "$charset" ]; then - echo "$me: $locale not found in /usr/share/i18n/SUPPORTED" >&2 + echo "$me: $locale charset not known" >&2 exit 1 fi