chef-boneyard / locale

Chef cookbook to configure the system locale on Linux systems
https://supermarket.chef.io/cookbooks/locale
Apache License 2.0
27 stars 54 forks source link

update-locale failure for Raspbian Jessie (Debian) #23

Open lashower opened 7 years ago

lashower commented 7 years ago

Cookbook version

2.0.1

Chef-client version

chef-client --version Chef: 13.2.20

Platform Details

cat /etc/*-release PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)" NAME="Raspbian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=raspbian ID_LIKE=debian

Scenario:

Running locale on newly formatted Raspberry Pi. Command "update-locale LANG=#{lang} LC_ALL=#{lc_all}" fails with: *** update-locale: Error: invalid locale settings: LC_ALL=en_US.UTF-8 LANG=en_GB.UTF-8

Steps to Reproduce:

You can easily reproduce this by running this command on a fresh Raspberry Pi running Raspbian Jessie: update-locale LANG=en_US.utf8 LC_ALL=en_US.utf8

Expected Result:

I expect locale -a to return this after execution: LANG=en_US.utf8 LANGUAGE= LC_CTYPE="en_US.utf8" LC_NUMERIC="en_US.utf8" LC_TIME="en_US.utf8" LC_COLLATE="en_US.utf8" LC_MONETARY="en_US.utf8" LC_MESSAGES="en_US.utf8" LC_PAPER="en_US.utf8" LC_NAME="en_US.utf8" LC_ADDRESS="en_US.utf8" LC_TELEPHONE="en_US.utf8" LC_MEASUREMENT="en_US.utf8" LC_IDENTIFICATION="en_US.utf8" LC_ALL=en_US.utf8

Actual Result:

Fails with this error on line 31: *** update-locale: Error: invalid locale settings: LC_ALL=en_US.UTF-8 LANG=en_GB.UTF-8

Quick Fix:

    template '/etc/locale.gen' do
      source 'locale.gen.erb'
    end
    execute "Updating Locales" do
      command "locale-gen en_US.UTF-8"
    end

See attached locale.txt = locale.gen.erb locale.txt

chewi commented 6 years ago

This is the same as #21.