slitaz-tools rev 1023

tinyutils/tazlocale: gen_utf8_locale(): fix error - make underlying folder.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Sep 02 16:32:55 2017 +0300 (2017-09-02)
parents eeb8ff6a623c
children 76ab8e9e4766
files tinyutils/tazlocale
line diff
     1.1 --- a/tinyutils/tazlocale	Mon Aug 28 19:49:26 2017 +0300
     1.2 +++ b/tinyutils/tazlocale	Sat Sep 02 16:32:55 2017 +0300
     1.3 @@ -3,7 +3,7 @@
     1.4  # Tazlocale: SliTaz GNU/Linux locale setting using dialog boxes.
     1.5  # Configuration file is: /etc/locale.conf
     1.6  #
     1.7 -# Copyright (C) 2008-2015 SliTaz GNU/Linux - BSD License
     1.8 +# Copyright (C) 2008-2017 SliTaz GNU/Linux - BSD License
     1.9  #
    1.10  # Author: Christophe Lincoln <pankso@slitaz.org>
    1.11  #
    1.12 @@ -15,15 +15,14 @@
    1.13  usage() {
    1.14  	newline
    1.15  	_ 'SliTaz GNU/Linux locale setting using dialog boxes.'
    1.16 -
    1.17 -	newline; boldify "$(_ 'Usage:')"
    1.18 +	newline
    1.19 +	boldify "$(_ 'Usage:')"
    1.20  	echo "  tazlocale [$(_ 'option')]"
    1.21 -
    1.22 -	newline; boldify "$(_ 'Options:')"
    1.23 +	newline
    1.24 +	boldify "$(_ 'Options:')"
    1.25  	optlist "\
    1.26  info	$(_ 'Show info about config file and current locale.')
    1.27  list	$(_ 'Show list of available locales.')"
    1.28 -
    1.29  	newline
    1.30  	_ 'Any other option treated as locale - set locale (root).'
    1.31  	_ 'Display locale selecting dialog if no option given (root).'
    1.32 @@ -112,6 +111,7 @@
    1.33  
    1.34  gen_utf8_locale() {
    1.35  	if [ ! -d "/usr/lib/locale/$locale.UTF-8" ]; then
    1.36 +		mkdir -p /usr/lib/locale
    1.37  		localedef -i "$locale" -c -f 'UTF-8' "/usr/lib/locale/$locale.UTF-8" &
    1.38  	fi
    1.39  }
    1.40 @@ -151,7 +151,7 @@
    1.41  	esac
    1.42  
    1.43  	# Default: POSIX => English
    1.44 -	[ "$locale" = 'en' ] && locale='en_US'
    1.45 +	[ "$locale" == 'en' ] && locale='en_US'
    1.46  	[ -s /etc/locale.conf ] && RECONFIG='yes'
    1.47  
    1.48  	# If it's a reconfiguration give an info message.