LTSP scripts break with Estonian locale

Bug #1491066 reported by Lauri Võsandi on 2015-09-01
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Alkis Georgopoulos

Bug Description


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

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

Related branches

Lauri Võsandi (v6sa) on 2015-09-01
description: updated
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
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.

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'
# 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.

Alkis Georgopoulos (alkisg) wrote :

Fix committed in

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
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  Edit
Everyone can see this information.

Other bug subscribers