Skip to content

Commit

Permalink
Improve error handling for update-locale
Browse files Browse the repository at this point in the history
Set absolute path to /usr/sbin/update-locale to make sure
the binary can be accessed no matter what's inside $PATH
and if it's not present inform user about it, but do not fail
because the locales-all package might be installed and it doesn't
provide the /usr/sbin/update-locale binary.
  • Loading branch information
mika committed Nov 12, 2013
1 parent 6e7a2c8 commit 2ef61aa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion chroot-script
Expand Up @@ -431,7 +431,13 @@ EOF
# set default locales {{{
default_locales() {
if [ -n "$DEFAULT_LOCALES" ] ; then
update-locale LANG="$DEFAULT_LOCALES"
if ! [ -x /usr/sbin/update-locale ] ; then
echo "Warning: update-locale executable not available (no locales package installed?)"
echo "Ignoring request to run update-locale for $DEFAULT_LOCALES therefore"
return 0
fi

/usr/sbin/update-locale LANG="$DEFAULT_LOCALES"
fi
}
# }}}
Expand Down

0 comments on commit 2ef61aa

Please sign in to comment.