Bug#990511: unblock: kodi/2:19.1+dfsg2-2
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
X-Debbugs-Cc: mattia@debian.org
Please unblock package kodi
[ Reason ]
Targeted bug fix for #989814
[ Impact ]
Turkish users get Kodi unusable without it
[ Tests ]
See related Debian bug and https://github.com/xbmc/xbmc/issues/19883
[ Risks ]
Change is trivial and approved by upstream
[ Checklist ]
[x] all changes are documented in the d/changelog
[x] I reviewed all changes and I approve them
[x] attach debdiff against the package in testing
[ Other info ]
unblock kodi/2:19.1+dfsg2-2
diff -Nru kodi-19.1+dfsg2/debian/changelog kodi-19.1+dfsg2/debian/changelog
--- kodi-19.1+dfsg2/debian/changelog 2021-06-07 14:42:08.000000000 +0000
+++ kodi-19.1+dfsg2/debian/changelog 2021-06-24 20:44:30.000000000 +0000
@@ -1,3 +1,9 @@
+kodi (2:19.1+dfsg2-2) unstable; urgency=medium
+
+ * Add runtime locale test and fallback (Closes: #989814)
+
+ -- Vasyl Gello <vasek.gello@gmail.com> Thu, 24 Jun 2021 20:44:30 +0000
+
kodi (2:19.1+dfsg2-1) unstable; urgency=medium
* New upstream version 19.1+dfsg2
diff -Nru kodi-19.1+dfsg2/debian/patches/kodi/0022-Workaround-989814.patch kodi-19.1+dfsg2/debian/patches/kodi/0022-Workaround-989814.patch
--- kodi-19.1+dfsg2/debian/patches/kodi/0022-Workaround-989814.patch 1970-01-01 00:00:00.000000000 +0000
+++ kodi-19.1+dfsg2/debian/patches/kodi/0022-Workaround-989814.patch 2021-06-24 20:44:30.000000000 +0000
@@ -0,0 +1,67 @@
+From 8b8e97dbec5c6268d1b81eb7799cfc945ca9520e Mon Sep 17 00:00:00 2001
+From: Vasyl Gello <vasek.gello@gmail.com>
+Date: Fri, 25 Jun 2021 01:37:02 +0000
+Subject: [PATCH 1/2] Check if applied locale correctly lowers chars and
+ fallback
+
+.. to default region if it does not.
+
+Fixes #19883.
+
+Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
+---
+ xbmc/LangInfo.cpp | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/xbmc/LangInfo.cpp b/xbmc/LangInfo.cpp
+index 24f0419cfe..ace72e1ffe 100644
+--- a/xbmc/LangInfo.cpp
++++ b/xbmc/LangInfo.cpp
+@@ -981,6 +981,16 @@ void CLangInfo::SetCurrentRegion(const std::string& strName)
+
+ m_currentRegion->SetGlobalLocale();
+
++ // Check if locale is not affected by #19883
++ int test19883 = std::tolower('i') - std::tolower('I');
++ if (test19883 != 0)
++ {
++ CLog::Log(LOGWARNING, "region '{}' is affected by #19883 - falling back to default region '{}'",
++ m_currentRegion->m_strName, m_defaultRegion.m_strName);
++ m_currentRegion = &m_defaultRegion;
++ m_currentRegion->SetGlobalLocale();
++ }
++
+ const std::shared_ptr<CSettings> settings = CServiceBroker::GetSettingsComponent()->GetSettings();
+ if (settings->GetString(CSettings::SETTING_LOCALE_SHORTDATEFORMAT) == SETTING_REGIONAL_DEFAULT)
+ SetShortDateFormat(m_currentRegion->m_strDateFormatShort);
+--
+2.32.0.rc0
+
+
+From 114ee13138389c96a759d6e5b73717093dd4030d Mon Sep 17 00:00:00 2001
+From: Vasyl Gello <vasek.gello@gmail.com>
+Date: Sun, 27 Jun 2021 19:31:39 +0000
+Subject: [PATCH 2/2] kodi.sh.in: Unset LC_{ALL,CTYPE}, LANG
+
+Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
+---
+ tools/Linux/kodi.sh.in | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tools/Linux/kodi.sh.in b/tools/Linux/kodi.sh.in
+index 108c0b007b..29d17d2c0f 100644
+--- a/tools/Linux/kodi.sh.in
++++ b/tools/Linux/kodi.sh.in
+@@ -171,6 +171,9 @@ if command_exists gdb; then
+ fi
+ fi
+
++# Unset CTYPE, LANG and ALL - see issue #19883
++unset LC_CTYPE LC_ALL LANG
++
+ LOOP=1
+ while [ $(( $LOOP )) = "1" ]
+ do
+--
+2.32.0.rc0
+
diff -Nru kodi-19.1+dfsg2/debian/patches/series kodi-19.1+dfsg2/debian/patches/series
--- kodi-19.1+dfsg2/debian/patches/series 2021-06-07 14:42:08.000000000 +0000
+++ kodi-19.1+dfsg2/debian/patches/series 2021-06-24 20:44:30.000000000 +0000
@@ -19,6 +19,7 @@
kodi/0019-Disable-GetCPUFrequency-test.patch
kodi/0020-Fix-C++-example-includes.patch
kodi/0021-Detect-and-honor-big-endian-arch.patch
+kodi/0022-Workaround-989814.patch
libdvdnav/0001-xbmc-dvdnav-allow-get-set-vm-state.patch
libdvdnav/0002-xbmc-dvdnav-expose-dvdnav_get_vm-dvdnav_get_button_i.patch
libdvdnav/0003-xbmc-dvdnav-detection-of-dvd-name.patch
Reply to: