From 5c46541000e158b40ae6f886ddbd599bed0bd8aa 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 --- srcpkgs/base-files/files/locale.sh | 18 ++++++++++++++++++ srcpkgs/base-files/template | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/srcpkgs/base-files/files/locale.sh b/srcpkgs/base-files/files/locale.sh index 8486367bfabf..68206544b7bc 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. # + +for a in LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY \ + LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT \ + LC_INDENTIFICATION; do + eval '_backup_'${a}'="$'${a}'"' +done + if [ -s /etc/locale.conf ]; then . /etc/locale.conf fi +for a in LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY \ + LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT \ + LC_INDENTIFICATION; do + eval 'if [ -n "$_backup_'${a}'" ]; then + '${a}'="${_backup_'${a}'}" + fi' +done + +# 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 diff --git a/srcpkgs/base-files/template b/srcpkgs/base-files/template index b96d09351a08..3f2696ba6954 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.143 -revision=2 +revision=3 bootstrap=yes depends="xbps-triggers" short_desc="Void Linux base system files"