Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#57323 - [filesystem] sourcing /etc/profile.d/locale.sh from /etc/profile fails
Attached to Project:
Arch Linux
Opened by Ivan Gut (ivanarch) - Thursday, 01 February 2018, 13:15 GMT
Last edited by Doug Newgard (Scimmia) - Friday, 02 February 2018, 15:12 GMT
Opened by Ivan Gut (ivanarch) - Thursday, 01 February 2018, 13:15 GMT
Last edited by Doug Newgard (Scimmia) - Friday, 02 February 2018, 15:12 GMT
|
DetailsDescription: there's a small problem with file /etc/profile.d/locale.sh that is sourced from /etc/profile
The last command in /etc/profile/locale.sh is: [ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION The problem is that the very last command fails if the LC_IDENTIFICATION environ var is undefined or empty. Additional info: * package version(s): 2017.10-2 Steps to reproduce: The original 26th line of /etc/profile is: test -r "$profile" && . "$profile" To detect the bug modify that line to: test -r "profile" && if . "$profile" ; then echo "INFO: $profile sourced succesfully" ; else echo "ERROR: $profile source failed" ; fi Solution: Add a last line with a command that always exist successfully, for example the command "true". |
This task depends upon
locale from filesystem 2017.10-2 (core)
$ ./locale.sh
$ echo $?
1
locale from filesystem 2018.1-2 (testing)
$ ./locale.sh
$ echo $?
0
But I modified the /etc/profile to do some checks, with some commands that can rasonably fail, for example testing the exit code of sourcing various scripts in a for loop. If these scripts failed, I get noticed.
Example code:
## /etc/profile
## Executed by login shells.
userlog ()
{
logger --tag "user:$UID" --id $$ --priority "${PRIO:-user.info}" "$@"
}
...
...
...
for P in /etc/profile.d/*.sh ; do
if . "$P" ; then
userlog "INFO: File sourced: '$P'"
else
PRIO='user.warning' userlog "WARNING: Failed sourcing file: '$P'"
fi
done
unset P
...
...
...
https://git.archlinux.org/svntogit/packages.git/tree/trunk/locale.sh?h=packages/filesystem
EDIT: Basically what loqs pasted. :P