From 04104c319c94f6e92256fba47d4fcf42152f0ed2 Mon Sep 17 00:00:00 2001 From: oreo639 Date: Tue, 13 Sep 2022 10:22:19 -0700 Subject: [PATCH] base-files: don't overwrite existing locale and define default LANG Correct spelling of LC_IDENTIFICATION. --- srcpkgs/base-files/files/locale.sh | 22 ++++++++++++++++++++-- srcpkgs/base-files/template | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/srcpkgs/base-files/files/locale.sh b/srcpkgs/base-files/files/locale.sh index 8486367bfabf90..c027b4549f22be 100644 --- a/srcpkgs/base-files/files/locale.sh +++ b/srcpkgs/base-files/files/locale.sh @@ -1,9 +1,27 @@ # Sets up locale system settings from /etc/locale.conf. # +_parse_lc_conf() { + lineno= + while read -r line || [ "$line" ]; do + line="${line%%#*}" + lc=$(expr "$line" : '^\([[:upper:]_]\+=\([[:alnum:][:digit:]\._-]\+\|"[[:print:][:digit:]\._-]"\)\)') + lineno="$(($lineno+1))" + if [ "$line" = "$lc" ]; then + eval ": \${$line}" + elif [ "$line" ]; then + echo "$1: invalid assignment on line $lineno" + fi + done < "$1" + unset lineno line lc +} + if [ -s /etc/locale.conf ]; then - . /etc/locale.conf + _parse_lc_conf /etc/locale.conf fi +# define default LANG to C.UTF-8 if not already defined +LANG="${LANG:-C.UTF-8}" + export LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY export LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT -export LC_INDENTIFICATION +export LC_IDENTIFICATION diff --git a/srcpkgs/base-files/template b/srcpkgs/base-files/template index 64e756be34dee2..1877a88e14324e 100644 --- a/srcpkgs/base-files/template +++ b/srcpkgs/base-files/template @@ -1,7 +1,7 @@ # Template file for 'base-files' pkgname=base-files version=0.144 -revision=1 +revision=2 bootstrap=yes depends="xbps-triggers" short_desc="Void Linux base system files"