1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-20 13:50:12 +01:00

FDroidPopen must have a locale to support UTF-8 filenames

`fdroid update` should be able to handle any valid filename (hopefully
aapt doesn't barf on them).  To handle that, the environment where the
shell commands are run in needs to have a UTF-8 locale set. If LANG is
not set, things default to ASCII and UTF-8 filenames fail.

This also renames test APK with lots of Unicode chars as a test case.

closes #167
This commit is contained in:
Hans-Christoph Steiner 2016-06-23 17:11:49 +02:00
parent 82e2689246
commit 1be263e870
4 changed files with 25 additions and 1 deletions

View File

@ -1794,7 +1794,8 @@ def set_FDroidPopen_env(build=None):
set up the environment variables for the build environment
There is only a weak standard, the variables used by gradle, so also set
up the most commonly used environment variables for SDK and NDK
up the most commonly used environment variables for SDK and NDK. Also, if
there is no locale set, this will set the locale (e.g. LANG) to en_US.UTF-8.
'''
global env, orig_path
@ -1806,6 +1807,15 @@ def set_FDroidPopen_env(build=None):
for k, v in config['java_paths'].items():
env['JAVA%s_HOME' % k] = v
missinglocale = True
for k, v in env.items():
if k == 'LANG' and v != 'C':
missinglocale = False
elif k == 'LC_ALL':
missinglocale = False
if missinglocale:
env['LANG'] = 'en_US.UTF-8'
if build is not None:
path = build.ndk_path()
paths = orig_path.split(os.pathsep)

Binary file not shown.

View File

@ -138,6 +138,20 @@ $fdroid readmeta
$fdroid update
#------------------------------------------------------------------------------#
echo_header "copy tests/repo, generate a keystore, and update"
REPOROOT=`create_test_dir`
cd $REPOROOT
$fdroid init
cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $REPOROOT/
echo "accepted_formats = ['json', 'txt', 'xml', 'yml']" >> config.py
$fdroid update --verbose
test -e repo/index.xml
test -e repo/index.jar
grep -F '<application id=' repo/index.xml > /dev/null
#------------------------------------------------------------------------------#
echo_header "test metadata checks"