Kerin Millar d04f29919a
app-shells/bash: add 5.2_p37-r4 & 5.3_p3-r1, revise 9999, address PR #42626
This commit introduces 5.2_p37-r4 and bash-5.3_p3-r1, as well as
revising bash-9999. The effective changes are described herewith.

Install a new /etc/profile.d drop-in, named "00-prompt-command.sh". It
serves to initialise the PROMPT_COMMAND variable as early as is
conveniently possible, provided that bash is acting as a login shell.

Install a revision of the /etc/bash/bashrc file that refrains from
initialising the PROMPT_COMMAND variable, provided that bash is acting
as a login shell. Along with the aforementioned change, this amounts to
a simplified interpretation of GitHub PR #42626. Though not a common
practice, some /etc/profile.d drop-ins (such as vte-2.91.sh) need to be
able to manipulate PROMPT_COMMAND and had hitherto been stymied by
bashrc proceeding to unconditionally clobber it.

Finally, refrain from installing 15-gentoo-bashrc-check.bash to
/etc/bash/bashrc.d. At the time of its introduction, I recommended that
it should exist for no longer than a year. Its removal is overdue.

Reported-by: Krzesimir Nowak <knowak@microsoft.com>
Part-of: https://github.com/gentoo/gentoo/pull/42626
Closes: https://github.com/gentoo/gentoo/pull/42626
Signed-off-by: Kerin Millar <kfm@plushkava.net>
Signed-off-by: Sam James <sam@gentoo.org>
2025-08-18 16:50:58 +01:00

31 lines
1001 B
Plaintext

# /etc/bash/bashrc
# Proceed no further in the case of a non-interactive shell.
if [[ $- != *i* ]]; then
return
fi
# Disable errexit in case the user enabled it then chose to re-source this file.
shopt -u -o errexit
# Disable completion when the input buffer is empty. Mute STDERR because this
# option is only present in the case that bash was built with readline support.
shopt -s no_empty_cmd_completion 2>/dev/null &&
# Append to HISTFILE rather than overwrite upon exiting, per bug #139609. This
# option also requires for bash to have been built with readline support.
shopt -s histappend
# Initialise PROMPT_COMMAND as an array, unless bash is acting as a login shell.
# In the latter case, the profile.d drop-in will already have initialised it.
shopt -q login_shell || PROMPT_COMMAND=()
# Don't let the user influence the order of sourcing for bash 5.3 or greater.
unset -v GLOBSORT
for _ in /etc/bash/bashrc.d/*; do
if [[ $_ == *.@(bash|sh) && -r $_ ]]; then
source "$_"
fi
done