Commit 980800da authored by Michael Pöhn's avatar Michael Pöhn

set locale to en_GB.UTF-8

parent ce3ee419
......@@ -57,7 +57,10 @@ def init_params(provider, debver, workdir='.', verbose=False, dry_run=False):
'size': '1000G',
'deb_mirror': 'http://deb.debian.org/debian',
'deb_distro': debver[:-2],
'deb_packages': ['openssh-server'],
'deb_packages': ['apt-transport-https', # enable HTTPS \
'ca-certificates', # for Debian repos
'locales', # install locale-gen
'openssh-server'], # vagrant requires SSH
'boostrapscript': os.path.join(workdir,
'fdroidserver-customize.sh'),
'username': 'vagrant',
......@@ -72,8 +75,6 @@ def init_params(provider, debver, workdir='.', verbose=False, dry_run=False):
params['img_name_raw'] = params['vm_name'] + '.raw'
params['img_path_raw'] = os.path.join(workdir, params['img_name_raw'])
params['vagrantfile_path'] = os.path.join(workdir, 'Vagrantfile')
# many third party apt repos require HTTPS
params['deb_packages'] += ('apt-transport-https', 'ca-certificates')
# add some packages which are missing in makebuildserver:
# (because they have been preinstalled on jessie64.box)
params['deb_packages'] += ('perl',
......@@ -126,6 +127,7 @@ def write_bootstrap_script(params, provider):
.format(username=params['username'],
deb_mirror=params['deb_mirror'],
deb_distro=params['deb_distro'],
verbose=params['verbose'],
provider=provider))
st = os.stat(path)
os.chmod(path, st.st_mode |
......
......@@ -17,8 +17,17 @@ echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4
chmod 600 $USERHOME/.ssh/authorized_keys
chown $VGRNT_UID:$VGRNT_GID $USERHOME/.ssh/authorized_keys
echo 'LANG=C.UTF-8' >> $VMROOT/etc/default/locale
echo 'LC_ALL=C.UTF-8' >> $VMROOT/etc/default/locale
# run locale-gen (has not effect, but do it anyway since that's what's documented on debian wiki)
echo "en_GB.UTF-8 UTF-8" >> $VMROOT/etc/locale.gen
echo "en_US.UTF-8 UTF-8" >> $VMROOT/etc/locale.gen
if [ "{verbose}" = 'True' ]; then
chroot $VMROOT locale-gen
else
chroot $VMROOT locale-gen > /dev/null
fi
# set system wide locale to the same value as on the legacy vm image
echo "LANG=en_GB.UTF-8" > $VMROOT/etc/default/locale
if [ $DEB_DISTRO = 'stretch' ]; then
echo 'deb http://deb.debian.org/debian stretch-backports main contrib' > $VMROOT/etc/apt/sources.list.d/stretch-backports.list
......
......@@ -37,7 +37,8 @@ class MkBsBoxTest(unittest.TestCase):
'boostrapscript': path,
'deb_distro': 'jessie',
'deb_mirror': 'http://deb.debian.org/debian',
'username': 'theUserName'}
'username': 'theUserName',
'verbose': True}
fdroid_basebox.write_bootstrap_script(params, 'libvirt')
self.assertTrue(os.path.isfile(path))
......
......@@ -6,7 +6,7 @@ TEST_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $TEST_DIR
echo "running flake8 ..."
flake8 --exclude env --filename '*.py,*.TestCase' --ignore=E402 ..
flake8 --exclude '../env/*,../buildroot/*' --filename '*.py,*.TestCase' --ignore=E402 ..
for testcase in *.TestCase; do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment