Github messages for voidlinux
 help / color / mirror / Atom feed
From: oreo639 <oreo639@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] base-files: don't overwrite existing locale and define default LANG
Date: Tue, 20 Jun 2023 06:29:24 +0200	[thread overview]
Message-ID: <20230620042924.h-wQ3lKnqMBG0cLcB5LdStyCSqd0UnwLhLBgWpLST8c@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-39264@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 2158 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages files
https://github.com/void-linux/void-packages/pull/39264

base-files: don't overwrite existing locale and define default LANG
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

Fixes overwriting user/desktop specified locale.

According to the locale.conf specification:

> The locale settings configured in /etc/locale.conf are
> system-wide and are inherited by every service or user, unless
> overridden or unset by individual programs or users.

https://man7.org/linux/man-pages/man5/locale.conf.5.html

Currently we always overwrite LANG on login, even if it was already set by the desktop or user which afaict goes against what is stated above.

You can see what Arch does here:
https://bugs.archlinux.org/task/42162
https://github.com/archlinux/svntogit-packages/blob/master/filesystem/trunk/locale.sh

Fedora does something way way more complicated using include guards and having bashrc and profile load each other and is definitely not what we want to do.

Closes: https://github.com/void-linux/void-packages/issues/15292

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/39264.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-files-39264.patch --]
[-- Type: text/x-diff, Size: 1846 bytes --]

From 7960f3ff73e0c21241b76b33cc36b1913f800758 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
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..6218dbae4b3e 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"

  parent reply	other threads:[~2023-06-20  4:29 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13 18:23 [PR PATCH] " oreo639
2022-09-13 18:25 ` [PR PATCH] [Updated] " oreo639
2022-09-26  6:36 ` oreo639
2022-09-26  6:36 ` oreo639
2022-09-26  6:37 ` oreo639
2022-12-26  1:57 ` github-actions
2022-12-26  2:02 ` oreo639
2022-12-26  2:22 ` [PR PATCH] [Updated] " oreo639
2023-01-02 15:29 ` leahneukirchen
2023-01-02 19:53 ` oreo639
2023-01-02 19:54 ` oreo639
2023-01-02 20:23 ` oreo639
2023-01-03  5:45 ` oreo639
2023-01-03  5:45 ` oreo639
2023-01-03  5:45 ` oreo639
2023-04-03  2:41 ` [PR PATCH] [Updated] " oreo639
2023-06-20  3:00 ` oreo639
2023-06-20  3:14 ` [PR REVIEW] " classabbyamp
2023-06-20  3:18 ` [PR PATCH] [Updated] " oreo639
2023-06-20  3:43 ` oreo639
2023-06-20  4:29 ` oreo639 [this message]
2023-06-20 21:08 ` oreo639
2023-06-20 21:21 ` oreo639
2023-06-21 10:37 ` oreo639
2023-06-21 11:08 ` oreo639
2023-06-21 11:10 ` oreo639
2023-06-21 11:14 ` oreo639
2023-06-21 11:47 ` oreo639
2023-09-20  1:45 ` github-actions
2023-09-20  5:06 ` oreo639
2023-09-21 16:05 ` leahneukirchen
2023-09-21 19:09 ` oreo639
2023-09-21 20:37 ` oreo639
2023-09-21 21:03 ` [PR PATCH] [Updated] " oreo639
2023-09-21 21:06 ` oreo639
2023-09-21 21:10 ` oreo639
2023-09-21 21:11 ` [PR PATCH] [Updated] " oreo639
2023-09-21 21:14 ` oreo639
2023-09-22 20:35 ` ahesford
2023-12-22  1:46 ` github-actions
2023-12-22  2:14 ` oreo639
2023-12-22  2:52 ` ahesford
2023-12-22  3:02 ` oreo639
2023-12-22  3:04 ` oreo639
2023-12-22 11:33 ` ahesford
2023-12-22 11:33 ` ahesford
2023-12-23  8:14 ` oreo639
2023-12-23  8:21 ` oreo639
2023-12-23  8:21 ` oreo639
2024-03-01  2:36 ` [PR PATCH] [Updated] " oreo639
2024-03-01  2:41 ` oreo639
2024-03-01  2:41 ` oreo639
2024-03-01  2:42 ` oreo639
2024-03-01  2:50 ` oreo639
2024-03-01  2:54 ` oreo639
2024-03-01  3:09 ` [PR PATCH] [Updated] " oreo639
2024-03-01  4:01 ` oreo639
2024-03-01  5:26 ` oreo639
2024-03-01  8:14 ` oreo639
2024-03-01 11:26 ` ahesford
2024-03-01 22:31 ` [PR PATCH] [Updated] " oreo639
2024-03-01 22:31 ` oreo639
2024-03-01 22:33 ` oreo639
2024-03-01 22:54 ` [PR PATCH] [Updated] " oreo639
2024-03-01 22:55 ` oreo639
2024-03-01 22:57 ` oreo639
2024-03-01 23:11 ` [PR PATCH] [Updated] " oreo639
2024-03-01 23:13 ` oreo639
2024-03-02  0:06 ` oreo639
2024-03-02  0:12 ` oreo639
2024-03-02  0:15 ` oreo639
2024-03-04 15:31 ` leahneukirchen
2024-03-04 19:52 ` [PR PATCH] [Updated] " oreo639

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230620042924.h-wQ3lKnqMBG0cLcB5LdStyCSqd0UnwLhLBgWpLST8c@z \
    --to=oreo639@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).