LTSP scripts break with Estonian locale

Bug #1491066 reported by Lauri Võsandi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LTSP5
Fix Released
Medium
Alkis Georgopoulos

Bug Description

Hi,

using Estonian locales regex [a-z] excludes letters t, u, v, w, x, y and this breaks several LTSP scripts.

Firstly I've noticed that LANG=C is necessary for building client, you can easily reproduce it by running LANG=et_EE.UTF-8 ltsp-build-client

I also isolated a piece of code which prevents local devices appearing on desktop with Estonian locale, it's a sed expression on line 104 here
http://apt-browse.org/browse/ubuntu/trusty/main/i386/ltsp-client-core/5.5.1-1ubuntu2/file/usr/share/ltsp/ltsp-client-common-functions

I think it would be good idea to run recursive grep over the LTSP script tree to identify a-z regexes and substitute them with [:alnum:] or similar, see similar fixes below

https://en.wikipedia.org/wiki/Estonian_orthography
http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=6b234d7ce4b687912e4778327945c64743db90ea
https://bugzilla.gnome.org/show_bug.cgi?id=602093
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=03994f01e8b72b3d01fd3d09d1cc7c9f421a727c

Related branches

Lauri Võsandi (v6sa)
description: updated
Revision history for this message
Vagrant Cascadian (vagrantc) wrote :

this highlights a number of problems in much of our code; I suspect a few uses of "sort" will also be impacted by locale settings.

From a quick glance at LTSP (not including LDM), I've found such code used by "tr", "sed", "expr", and even "perl" where they may not consistantly use the same regex.

We may need to selectively force the locale to C or C.UTF-8 for certain operations...

Looks like we need a bit of an audit...

Changed in ltsp:
importance: Undecided → Medium
Revision history for this message
Lauri Võsandi (v6sa) wrote :

Hi again, one potential fixes would be sourcing /etc/default/locale right before LDM starts. This way initscripts would not be affected by the locales.

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Test case:
# locale-gen et_EE.UTF-8
# echo _abcdefghijklmnopqrstuvwxyz_ | LANG=et_EE.UTF-8 LANGUAGE= LC_ALL= sed 's/[a-z]//g'
_tuvwxy_
# echo _abcdefghijklmnopqrstuvwxyz_ | LANG=et_EE.UTF-8 LANGUAGE= LC_ALL= sed 's/[[:alpha:]]//g'
__

I.e. the locale needs to be generated before it's functional,
and LANGUAGE and LC_ALL need to be unset in order for LANGUAGE to take effect.

Note that `tr` seems unaffected, maybe its developers are automatically replacing [a-z] with [[:alpha:]] internally.

I think that any occurrences of [a-z] in the code should be fixed whether we also decide to use LANG=C.UTF-8 or not.

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Fix committed in
http://bazaar.launchpad.net/~ltsp-upstream/ltsp/ltsp-trunk/revision/2664
http://bazaar.launchpad.net/~ltsp-upstream/ltsp/ldm-trunk/revision/1579

The part about setting/unsetting LANG, LANGUAGE, LC_ALL etc should be reviewed again in LTSP 6, where LDM will be removed, systemd will be properly supported etc.

Changed in ltsp:
assignee: nobody → Alkis Georgopoulos (alkisg)
status: New → Fix Committed
Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Fix released in LTSP 5.5.5.

Changed in ltsp:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.