* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/bashrc.d/
@ 2024-04-27 23:15 Sam James
0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2024-04-27 23:15 UTC (permalink / raw
To: gentoo-commits
commit: 3b57965e7f470622da200da16761f522e57c7991
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat Apr 27 20:58:38 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Apr 27 23:09:49 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b57965e
app-shells/bash: prefixify bashrc.d files, whitelist st-256color, drop [ef]grep aliases
The ebuilds that install "${FILESDIR}/bashrc.d/10-gentoo-color.bash"
were neglecting to prefixify it. That is, to replace instances of "/etc"
with "${EPREFIX}/etc". After reviewing the prefix eclass, I found it to
be wanting in all of its chief respects: interface, correctness, safety
and robustness. Consequently, I rejected the notion of using it on
principle. Instead, I elected to create a custom function, which is now
used to prefixify both "bashrc" and "10-gentoo-color.bash". Among its
virtues are that it writes an amended stream to the standard output,
which may be directly processed by newins.
Whitelist st-256color for Set Text Parameters support. Also, add it to
the list of terminals known to support colour.
Drop the egrep and fgrep aliases again. Previously, they had been
dropped by Mike Gilbert but were inadvertently re-introduced through my
being thorough rather than prudent. Given that both are non-standard, I
certainly have no wish to provide users with any additional excuses for
their continued use.
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Fixes: 268b2e7c07d97bd9e833d239d786a0314c3b09ec
Signed-off-by: Sam James <sam <AT> gentoo.org>
...sh-5.1_p16-r8.ebuild => bash-5.1_p16-r9.ebuild} | 14 ++++++++--
...sh-5.2_p26-r1.ebuild => bash-5.2_p26-r2.ebuild} | 14 ++++++++--
...h-5.3_alpha.ebuild => bash-5.3_alpha-r1.ebuild} | 14 ++++++++--
.../bash/files/bashrc.d/10-gentoo-color.bash | 31 +++++++++++-----------
.../bash/files/bashrc.d/10-gentoo-title.bash | 1 +
5 files changed, 53 insertions(+), 21 deletions(-)
diff --git a/app-shells/bash/bash-5.1_p16-r8.ebuild b/app-shells/bash/bash-5.1_p16-r9.ebuild
similarity index 96%
rename from app-shells/bash/bash-5.1_p16-r8.ebuild
rename to app-shells/bash/bash-5.1_p16-r9.ebuild
index 41b73878797e..fefec1f7e54d 100644
--- a/app-shells/bash/bash-5.1_p16-r8.ebuild
+++ b/app-shells/bash/bash-5.1_p16-r9.ebuild
@@ -249,16 +249,26 @@ src_install() {
default
+ my_prefixify() {
+ while read -r; do
+ if [[ $REPLY == *$1* ]]; then
+ REPLY=${REPLY/"/etc/"/"${EPREFIX}/etc/"}
+ fi
+ printf '%s\n' "${REPLY}" || ! break
+ done < "$2" || die
+ }
+
dodir /bin
mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
dosym bash /bin/rbash
insinto /etc/bash
doins "${FILESDIR}"/bash_logout
- newins "$(prefixify_ro "${FILESDIR}"/bashrc-r1)" bashrc
+ my_prefixify bashrc.d "${FILESDIR}"/bashrc-r1 | newins - bashrc
insinto /etc/bash/bashrc.d
- doins "${FILESDIR}"/bashrc.d/*.bash
+ my_prefixify DIR_COLORS "${FILESDIR}"/bashrc.d/10-gentoo-color.bash | newins - 10-gentoo-color.bash
+ doins "${FILESDIR}"/bashrc.d/10-gentoo-title.bash
insinto /etc/skel
for f in bash{_logout,_profile,rc} ; do
diff --git a/app-shells/bash/bash-5.2_p26-r1.ebuild b/app-shells/bash/bash-5.2_p26-r2.ebuild
similarity index 96%
rename from app-shells/bash/bash-5.2_p26-r1.ebuild
rename to app-shells/bash/bash-5.2_p26-r2.ebuild
index 0e803fa5048c..64cfa30c6113 100644
--- a/app-shells/bash/bash-5.2_p26-r1.ebuild
+++ b/app-shells/bash/bash-5.2_p26-r2.ebuild
@@ -296,16 +296,26 @@ src_install() {
default
+ my_prefixify() {
+ while read -r; do
+ if [[ $REPLY == *$1* ]]; then
+ REPLY=${REPLY/"/etc/"/"${EPREFIX}/etc/"}
+ fi
+ printf '%s\n' "${REPLY}" || ! break
+ done < "$2" || die
+ }
+
dodir /bin
mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
dosym bash /bin/rbash
insinto /etc/bash
doins "${FILESDIR}"/bash_logout
- newins "$(prefixify_ro "${FILESDIR}"/bashrc-r1)" bashrc
+ my_prefixify bashrc.d "${FILESDIR}"/bashrc-r1 | newins - bashrc
insinto /etc/bash/bashrc.d
- doins "${FILESDIR}"/bashrc.d/*.bash
+ my_prefixify DIR_COLORS "${FILESDIR}"/bashrc.d/10-gentoo-color.bash | newins - 10-gentoo-color.bash
+ doins "${FILESDIR}"/bashrc.d/10-gentoo-title.bash
insinto /etc/skel
for f in bash{_logout,_profile,rc} ; do
diff --git a/app-shells/bash/bash-5.3_alpha.ebuild b/app-shells/bash/bash-5.3_alpha-r1.ebuild
similarity index 96%
rename from app-shells/bash/bash-5.3_alpha.ebuild
rename to app-shells/bash/bash-5.3_alpha-r1.ebuild
index 036e48751a1f..9b535f0e39eb 100644
--- a/app-shells/bash/bash-5.3_alpha.ebuild
+++ b/app-shells/bash/bash-5.3_alpha-r1.ebuild
@@ -295,16 +295,26 @@ src_install() {
default
+ my_prefixify() {
+ while read -r; do
+ if [[ $REPLY == *$1* ]]; then
+ REPLY=${REPLY/"/etc/"/"${EPREFIX}/etc/"}
+ fi
+ printf '%s\n' "${REPLY}" || ! break
+ done < "$2" || die
+ }
+
dodir /bin
mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
dosym bash /bin/rbash
insinto /etc/bash
doins "${FILESDIR}"/bash_logout
- newins "$(prefixify_ro "${FILESDIR}"/bashrc-r1)" bashrc
+ my_prefixify bashrc.d "${FILESDIR}"/bashrc-r1 | newins - bashrc
insinto /etc/bash/bashrc.d
- doins "${FILESDIR}"/bashrc.d/*.bash
+ my_prefixify DIR_COLORS "${FILESDIR}"/bashrc.d/10-gentoo-color.bash | newins - 10-gentoo-color.bash
+ doins "${FILESDIR}"/bashrc.d/10-gentoo-title.bash
insinto /etc/skel
for f in bash{_logout,_profile,rc} ; do
diff --git a/app-shells/bash/files/bashrc.d/10-gentoo-color.bash b/app-shells/bash/files/bashrc.d/10-gentoo-color.bash
index 5a6df5690c08..66afdcaa9557 100644
--- a/app-shells/bash/files/bashrc.d/10-gentoo-color.bash
+++ b/app-shells/bash/files/bashrc.d/10-gentoo-color.bash
@@ -14,20 +14,21 @@ elif unset -v COLORTERM; ! gentoo_color=$(tput colors 2>/dev/null); then
# and which remain (somewhat) popular. This will rarely happen, so the
# list need not be exhaustive.
case ${TERM} in
- *color* |\
- *direct* |\
- [Ekx]term* |\
- alacritty |\
- aterm |\
- dtterm |\
- foot* |\
- jfbterm |\
- linux |\
- mlterm |\
- rxvt* |\
- screen* |\
- tmux* |\
- wsvt25* ) gentoo_color=1
+ *color* |\
+ *direct* |\
+ [Ekx]term* |\
+ alacritty |\
+ aterm |\
+ dtterm |\
+ foot* |\
+ jfbterm |\
+ linux |\
+ mlterm |\
+ rxvt* |\
+ screen* |\
+ st-256color |\
+ tmux* |\
+ wsvt25* ) gentoo_color=1
esac
elif (( gentoo_color == 16777216 )); then
# Truecolor support is available. Advertise it.
@@ -47,7 +48,7 @@ fi
if (( gentoo_color > 0 )); then
# Colorize the output of grep and several coreutils utilities.
- for _ in diff dir egrep fgrep grep ls vdir; do
+ for _ in diff dir grep ls vdir; do
alias "$_=$_ --color=auto"
done
diff --git a/app-shells/bash/files/bashrc.d/10-gentoo-title.bash b/app-shells/bash/files/bashrc.d/10-gentoo-title.bash
index 56afcf213045..1fbf17c26327 100644
--- a/app-shells/bash/files/bashrc.d/10-gentoo-title.bash
+++ b/app-shells/bash/files/bashrc.d/10-gentoo-title.bash
@@ -45,6 +45,7 @@ case ${TERM} in
foot* |\
rxvt-unicode* |\
screen* |\
+ st-256color |\
tmux* |\
xterm* )
genfun_set_win_title() {
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/bashrc.d/
@ 2024-06-15 4:40 Sam James
0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2024-06-15 4:40 UTC (permalink / raw
To: gentoo-commits
commit: b35701d05b15a831d8319c046203f7a70be339cb
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat Jun 15 03:59:11 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 15 04:39:29 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b35701d0
app-shells/bash: declare the genfun_set_win_title function unconditionally
Presently, revisions 5.1_p16-r10, 5.2_p26-r3 and bash-5.3_alpha-r2
refrain from declaring the genfun_set_win_title function at all in the
case that the tty belongs to sshd(8). This is to avoid cluttering the
shell's operating environment in situations where the decision is made
not to append 'genfun_set_win_title' to the PROMPT_COMMANDS array.
One might ask why it should not always be appended to the array. The
explanation for this is that Gentoo Linux does not exist in a vacuum;
not all operating systems default to initialising bash in such a way
that it can be assumed that the title will be set at each prompt (or at
all). Where SSH is involved, the server has no knowledge whatsoever of
the particulars of the client OS or its operating environment. This
would previously give rise to the following scenario.
1. User runs ssh(1) from non-Gentoo to connect to sshd(8) on Gentoo
2. The remote shell alters the window title
3. The user eventually exits the remote shell.
4. The window title is never restored to its prior value
Put simply, there is no way for the remote side to know what the
existing window title is, much less guarantee that it be restored on the
client side.
All that being said - and rather unsurprisingly - some Gentoo users will
care nothing for these considerations or are simply operating in a
homogenous environment where they are not an immediate concern. Try to
accommodate the wishes of such users more effectively by declaring the
function unconditionally. Consequently, they will have the option of
restoring Gentoo's historical behaviour in a somewhat straightforward
manner. That is, by setting PROMPT_COMMAND in ~/.bashrc or in an
/etc/bash/bashrc.d/ drop-in to the effect of the following.
PROMPT_COMMAND=(genfun_set_win_title)
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Bug: https://bugs.gentoo.org/934309
Signed-off-by: Sam James <sam <AT> gentoo.org>
...-5.1_p16-r10.ebuild => bash-5.1_p16-r11.ebuild} | 0
...sh-5.2_p26-r3.ebuild => bash-5.2_p26-r4.ebuild} | 0
....3_alpha-r2.ebuild => bash-5.3_alpha-r3.ebuild} | 0
.../bash/files/bashrc.d/10-gentoo-title.bash | 49 +++++++++++++---------
4 files changed, 29 insertions(+), 20 deletions(-)
diff --git a/app-shells/bash/bash-5.1_p16-r10.ebuild b/app-shells/bash/bash-5.1_p16-r11.ebuild
similarity index 100%
rename from app-shells/bash/bash-5.1_p16-r10.ebuild
rename to app-shells/bash/bash-5.1_p16-r11.ebuild
diff --git a/app-shells/bash/bash-5.2_p26-r3.ebuild b/app-shells/bash/bash-5.2_p26-r4.ebuild
similarity index 100%
rename from app-shells/bash/bash-5.2_p26-r3.ebuild
rename to app-shells/bash/bash-5.2_p26-r4.ebuild
diff --git a/app-shells/bash/bash-5.3_alpha-r2.ebuild b/app-shells/bash/bash-5.3_alpha-r3.ebuild
similarity index 100%
rename from app-shells/bash/bash-5.3_alpha-r2.ebuild
rename to app-shells/bash/bash-5.3_alpha-r3.ebuild
diff --git a/app-shells/bash/files/bashrc.d/10-gentoo-title.bash b/app-shells/bash/files/bashrc.d/10-gentoo-title.bash
index 1fbf17c26327..0246d4fa36f0 100644
--- a/app-shells/bash/files/bashrc.d/10-gentoo-title.bash
+++ b/app-shells/bash/files/bashrc.d/10-gentoo-title.bash
@@ -1,5 +1,31 @@
# /etc/bash/bashrc.d/10-gentoo-title.bash
+genfun_set_win_title() {
+ # Assigns the basename of the current working directory, having
+ # sanitised it with @Q parameter expansion. Useful for paths containing
+ # newlines and such. As a special case, names consisting entirely of
+ # graphemes shall not undergo the expansion, for reasons of cleanliness.
+ genfun_sanitise_cwd() {
+ _cwd=${PWD##*/}
+ if [[ ! ${_cwd} ]]; then
+ _cwd=${PWD}
+ elif [[ ${_cwd} == *[![:graph:]]* ]]; then
+ _cwd=${_cwd@Q}
+ fi
+ }
+
+ # Sets the window title with the Set Text Parameters sequence. For
+ # screen, the sequence defines the hardstatus (%h) and for tmux, the
+ # window_name (#W). For graphical terminal emulators, it is normal for
+ # the title bar be affected.
+ genfun_set_win_title() {
+ genfun_sanitise_cwd
+ printf '\033]2;%s@%s - %s\007' "${USER}" "${HOSTNAME%%.*}" "${_cwd}"
+ }
+
+ genfun_set_win_title
+}
+
# Set window title with the Title Definition String sequence. For screen, the
# sequence defines the window title (%t) and for tmux, the pane_title (#T).
# For tmux to be affected requires that its allow-rename option be enabled.
@@ -15,27 +41,14 @@ case ${TERM} in
# If the TTY is that of sshd(8) then proceed no further. Alas,
# there exist many operating environments in which the window
# title would otherwise not be restored upon ssh(1) exiting.
+ # Users wishing to coerce the historical behaviour have the
+ # option of setting PROMPT_COMMAND=(genfun_set_win_title).
if [[ ${SSH_TTY} && ${SSH_TTY} == "$(tty)" ]]; then
return
fi
esac
-# Assigns the basename of the current working directory, having sanitised it
-# with @Q parameter expansion. Useful for paths containing newlines and such.
-# As a special case, names consisting entirely of graphemes shall not undergo
-# the parameter expansion, for reasons of cleanliness.
-genfun_sanitise_cwd() {
- _cwd=${PWD##*/}
- if [[ ! ${_cwd} ]]; then
- _cwd=${PWD}
- elif [[ ${_cwd} == *[![:graph:]]* ]]; then
- _cwd=${_cwd@Q}
- fi
-}
-
-# Set window title with the Set Text Parameters sequence. For screen, the
-# sequence defines the hardstatus (%h) and for tmux, the window_name (#W).
-# For graphical terminal emulators, it is normal for the title bar be affected.
+# Determine whether the terminal can handle the Set Text Parameters sequence.
# The only terminals permitted here are those for which there is empirical
# evidence that the sequence is supported and that the UTF-8 character encoding
# is handled correctly. Quite rightly, this precludes many vintage terminals.
@@ -48,9 +61,5 @@ case ${TERM} in
st-256color |\
tmux* |\
xterm* )
- genfun_set_win_title() {
- genfun_sanitise_cwd
- printf '\033]2;%s@%s - %s\007' "${USER}" "${HOSTNAME%%.*}" "${_cwd}"
- }
PROMPT_COMMAND+=('genfun_set_win_title')
esac
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/bashrc.d/
@ 2024-06-30 17:31 Sam James
0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2024-06-30 17:31 UTC (permalink / raw
To: gentoo-commits
commit: 1d15b220376e9da1251127d71f78203f5da3f9d7
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat Jun 29 12:58:33 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun 30 17:25:03 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d15b220
app-shells/bash: fix title setting heuristic; set both icon name and title
In bug #934732, Sven Wegener requested for bash to refrain from setting
the "internal" window title. That is, the window title (%t) of GNU
screen and the window_name (#W) of tmux. A patch was attached to the
bug, which I acknowledged and which was subsequently applied by Sven.
Unfortunately - and perhaps owing to my eagerness to have the matter be
resolved - I did not notice that the patch introduces a regression. The
regression is that both screen and tmux are no longer exempted from the
sshd(8) check, resulting in neither the hardstatus (%h) being set for
the former, nor the pane_title (#T) for the latter. This commit restores
the intended behaviour.
In comment #10 of bug #550104, Heui-mun Park makes a compelling case
that the "\033]0;" variant of the Set Text Parameters sequence should be
preferred over other variants. The difference is that it sets the "icon
name" in addition to the "window title". Indeed, I have found that most
applications that employ the sequence make use of this more
comprehensive variant. For many users, such a distinction would amount
to being little more than an artifact of history. Nevertheless, it makes
perfect sense for 10-gentoo-title.bash to be aligned with the practices
of others in this regard. Make it so.
Improve the commentary in 10-gentoo-title.bash, along with the accuracy
and utility of the information conveyed by the ewarn comands in the
ebuilds.
Have the live ebuild (version 9999) install 15-gentoo-bashrc-check.bash,
just as the other recent ebuilds do. It's simpler from a maintenance
standpoint for there to be as few differences between them as is
possible.
Fixes: 9ff9f8199ccf9d55fb1cf066cbbc791101894ab0
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
...-5.1_p16-r12.ebuild => bash-5.1_p16-r13.ebuild} | 37 ++++++++++++--------
...sh-5.2_p26-r5.ebuild => bash-5.2_p26-r6.ebuild} | 37 ++++++++++++--------
....3_alpha-r4.ebuild => bash-5.3_alpha-r5.ebuild} | 37 ++++++++++++--------
app-shells/bash/bash-9999.ebuild | 40 ++++++++++++++--------
.../bash/files/bashrc.d/10-gentoo-title.bash | 13 +++----
5 files changed, 102 insertions(+), 62 deletions(-)
diff --git a/app-shells/bash/bash-5.1_p16-r12.ebuild b/app-shells/bash/bash-5.1_p16-r13.ebuild
similarity index 89%
rename from app-shells/bash/bash-5.1_p16-r12.ebuild
rename to app-shells/bash/bash-5.1_p16-r13.ebuild
index cc9ce6983938..38b7451addc3 100644
--- a/app-shells/bash/bash-5.1_p16-r12.ebuild
+++ b/app-shells/bash/bash-5.1_p16-r13.ebuild
@@ -328,22 +328,31 @@ pkg_postinst() {
read -r old_ver <<<"${REPLACING_VERSIONS}"
if [[ ! $old_ver ]]; then
:
- elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r1"; then
+ elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r6"; then
return
- elif ver_test "$old_ver" -lt "5.2" && ver_test "$old_ver" -ge "5.1_p16-r8"; then
+ elif ver_test "$old_ver" -lt "5.2" && ver_test "$old_ver" -ge "5.1_p16-r13"; then
return
fi
- ewarn "Files situated under /etc/bash/bashrc.d must now have a suffix of .sh or .bash."
- ewarn ""
- ewarn "Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the"
- ewarn "characteristics of the operating environment, this array may contain commands"
- ewarn "to set the window and pane title. Users that choose to customise this variable"
- ewarn "in ~/.bashrc are advised to append their commands, using the following syntax."
- ewarn ""
- ewarn "PROMPT_COMMAND+=('custom command goes here')"
- ewarn ""
- ewarn "Alternatively, users that wish to opt out of Gentoo's window title setting"
- ewarn "behaviour may now do so by either unsetting PROMPT_COMMAND or by re-defining it"
- ewarn "as desired. Previously, there was no formally supported method of opting out."
+ while read -r; do ewarn "${REPLY}"; done <<'EOF'
+Files situated under /etc/bash/bashrc.d must now have a suffix of .sh or .bash.
+
+Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the
+characteristics of the operating environment, this array may contain a command
+to set the terminal's window title. Those already choosing to customise the
+PROMPT_COMMAND variable are now advised to append their commands like so:
+
+PROMPT_COMMAND+=('custom command goes here')
+
+Gentoo no longer defaults to having bash manipulate the window title in the case
+that the terminal is controlled by sshd(8), unless screen or tmux are in use.
+Those wanting to set the title unconditionally may adjust ~/.bashrc - or create
+a custom /etc/bash/bashrc.d drop-in - to set PROMPT_COMMMAND like so:
+
+PROMPT_COMMAND=(genfun_set_win_title)
+
+Those who would prefer for bash never to interfere with the window title may
+now opt out of the default title setting behaviour, either with the "unset -v
+PROMPT_COMMAND" command or by re-defining PROMPT_COMMAND as desired.
+EOF
}
diff --git a/app-shells/bash/bash-5.2_p26-r5.ebuild b/app-shells/bash/bash-5.2_p26-r6.ebuild
similarity index 90%
rename from app-shells/bash/bash-5.2_p26-r5.ebuild
rename to app-shells/bash/bash-5.2_p26-r6.ebuild
index e8eaa353cf21..4350a8a719c3 100644
--- a/app-shells/bash/bash-5.2_p26-r5.ebuild
+++ b/app-shells/bash/bash-5.2_p26-r6.ebuild
@@ -372,22 +372,31 @@ pkg_postinst() {
read -r old_ver <<<"${REPLACING_VERSIONS}"
if [[ ! $old_ver ]]; then
:
- elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r1"; then
+ elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r6"; then
return
- elif ver_test "$old_ver" -lt "5.2" && ver_test "$old_ver" -ge "5.1_p16-r8"; then
+ elif ver_test "$old_ver" -lt "5.2" && ver_test "$old_ver" -ge "5.1_p16-r13"; then
return
fi
- ewarn "Files situated under /etc/bash/bashrc.d must now have a suffix of .sh or .bash."
- ewarn ""
- ewarn "Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the"
- ewarn "characteristics of the operating environment, this array may contain commands"
- ewarn "to set the window and pane title. Users that choose to customise this variable"
- ewarn "in ~/.bashrc are advised to append their commands, using the following syntax."
- ewarn ""
- ewarn "PROMPT_COMMAND+=('custom command goes here')"
- ewarn ""
- ewarn "Alternatively, users that wish to opt out of Gentoo's window title setting"
- ewarn "behaviour may now do so by either unsetting PROMPT_COMMAND or by re-defining it"
- ewarn "as desired. Previously, there was no formally supported method of opting out."
+ while read -r; do ewarn "${REPLY}"; done <<'EOF'
+Files situated under /etc/bash/bashrc.d must now have a suffix of .sh or .bash.
+
+Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the
+characteristics of the operating environment, this array may contain a command
+to set the terminal's window title. Those already choosing to customise the
+PROMPT_COMMAND variable are now advised to append their commands like so:
+
+PROMPT_COMMAND+=('custom command goes here')
+
+Gentoo no longer defaults to having bash manipulate the window title in the case
+that the terminal is controlled by sshd(8), unless screen or tmux are in use.
+Those wanting to set the title unconditionally may adjust ~/.bashrc - or create
+a custom /etc/bash/bashrc.d drop-in - to set PROMPT_COMMMAND like so:
+
+PROMPT_COMMAND=(genfun_set_win_title)
+
+Those who would prefer for bash never to interfere with the window title may
+now opt out of the default title setting behaviour, either with the "unset -v
+PROMPT_COMMAND" command or by re-defining PROMPT_COMMAND as desired.
+EOF
}
diff --git a/app-shells/bash/bash-5.3_alpha-r4.ebuild b/app-shells/bash/bash-5.3_alpha-r5.ebuild
similarity index 90%
rename from app-shells/bash/bash-5.3_alpha-r4.ebuild
rename to app-shells/bash/bash-5.3_alpha-r5.ebuild
index 9699a659026a..c0e5e68f43a5 100644
--- a/app-shells/bash/bash-5.3_alpha-r4.ebuild
+++ b/app-shells/bash/bash-5.3_alpha-r5.ebuild
@@ -371,22 +371,31 @@ pkg_postinst() {
read -r old_ver <<<"${REPLACING_VERSIONS}"
if [[ ! $old_ver ]]; then
:
- elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r1"; then
+ elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r6"; then
return
- elif ver_test "$old_ver" -lt "5.2" && ver_test "$old_ver" -ge "5.1_p16-r8"; then
+ elif ver_test "$old_ver" -lt "5.2" && ver_test "$old_ver" -ge "5.1_p16-r13"; then
return
fi
- ewarn "Files situated under /etc/bash/bashrc.d must now have a suffix of .sh or .bash."
- ewarn ""
- ewarn "Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the"
- ewarn "characteristics of the operating environment, this array may contain commands"
- ewarn "to set the window and pane title. Users that choose to customise this variable"
- ewarn "in ~/.bashrc are advised to append their commands, using the following syntax."
- ewarn ""
- ewarn "PROMPT_COMMAND+=('custom command goes here')"
- ewarn ""
- ewarn "Alternatively, users that wish to opt out of Gentoo's window title setting"
- ewarn "behaviour may now do so by either unsetting PROMPT_COMMAND or by re-defining it"
- ewarn "as desired. Previously, there was no formally supported method of opting out."
+ while read -r; do ewarn "${REPLY}"; done <<'EOF'
+Files situated under /etc/bash/bashrc.d must now have a suffix of .sh or .bash.
+
+Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the
+characteristics of the operating environment, this array may contain a command
+to set the terminal's window title. Those already choosing to customise the
+PROMPT_COMMAND variable are now advised to append their commands like so:
+
+PROMPT_COMMAND+=('custom command goes here')
+
+Gentoo no longer defaults to having bash manipulate the window title in the case
+that the terminal is controlled by sshd(8), unless screen or tmux are in use.
+Those wanting to set the title unconditionally may adjust ~/.bashrc - or create
+a custom /etc/bash/bashrc.d drop-in - to set PROMPT_COMMMAND like so:
+
+PROMPT_COMMAND=(genfun_set_win_title)
+
+Those who would prefer for bash never to interfere with the window title may
+now opt out of the default title setting behaviour, either with the "unset -v
+PROMPT_COMMAND" command or by re-defining PROMPT_COMMAND as desired.
+EOF
}
diff --git a/app-shells/bash/bash-9999.ebuild b/app-shells/bash/bash-9999.ebuild
index ae661e409da8..7ef121e1c56f 100644
--- a/app-shells/bash/bash-9999.ebuild
+++ b/app-shells/bash/bash-9999.ebuild
@@ -311,6 +311,9 @@ src_install() {
insinto /etc/bash/bashrc.d
my_prefixify DIR_COLORS "${FILESDIR}"/bashrc.d/10-gentoo-color.bash | newins - 10-gentoo-color.bash
doins "${FILESDIR}"/bashrc.d/10-gentoo-title.bash
+ if [[ ! ${EPREFIX} ]]; then
+ doins "${FILESDIR}"/bashrc.d/15-gentoo-bashrc-check.bash
+ fi
insinto /etc/skel
for f in bash{_logout,_profile,rc}; do
@@ -368,22 +371,31 @@ pkg_postinst() {
read -r old_ver <<<"${REPLACING_VERSIONS}"
if [[ ! $old_ver ]]; then
:
- elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r1"; then
+ elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r6"; then
return
- elif ver_test "$old_ver" -lt "5.2" && ver_test "$old_ver" -ge "5.1_p16-r8"; then
+ elif ver_test "$old_ver" -lt "5.2" && ver_test "$old_ver" -ge "5.1_p16-r13"; then
return
fi
- ewarn "Files situated under /etc/bash/bashrc.d must now have a suffix of .sh or .bash."
- ewarn ""
- ewarn "Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the"
- ewarn "characteristics of the operating environment, this array may contain commands"
- ewarn "to set the window and pane title. Users that choose to customise this variable"
- ewarn "in ~/.bashrc are advised to append their commands, using the following syntax."
- ewarn ""
- ewarn "PROMPT_COMMAND+=('custom command goes here')"
- ewarn ""
- ewarn "Alternatively, users that wish to opt out of Gentoo's window title setting"
- ewarn "behaviour may now do so by either unsetting PROMPT_COMMAND or by re-defining it"
- ewarn "as desired. Previously, there was no formally supported method of opting out."
+ while read -r; do ewarn "${REPLY}"; done <<'EOF'
+Files situated under /etc/bash/bashrc.d must now have a suffix of .sh or .bash.
+
+Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the
+characteristics of the operating environment, this array may contain a command
+to set the terminal's window title. Those already choosing to customise the
+PROMPT_COMMAND variable are now advised to append their commands like so:
+
+PROMPT_COMMAND+=('custom command goes here')
+
+Gentoo no longer defaults to having bash manipulate the window title in the case
+that the terminal is controlled by sshd(8), unless screen or tmux are in use.
+Those wanting to set the title unconditionally may adjust ~/.bashrc - or create
+a custom /etc/bash/bashrc.d drop-in - to set PROMPT_COMMMAND like so:
+
+PROMPT_COMMAND=(genfun_set_win_title)
+
+Those who would prefer for bash never to interfere with the window title may
+now opt out of the default title setting behaviour, either with the "unset -v
+PROMPT_COMMAND" command or by re-defining PROMPT_COMMAND as desired.
+EOF
}
diff --git a/app-shells/bash/files/bashrc.d/10-gentoo-title.bash b/app-shells/bash/files/bashrc.d/10-gentoo-title.bash
index 003e364ff072..2b2e23347784 100644
--- a/app-shells/bash/files/bashrc.d/10-gentoo-title.bash
+++ b/app-shells/bash/files/bashrc.d/10-gentoo-title.bash
@@ -20,17 +20,18 @@ genfun_set_win_title() {
# the title bar to be affected.
genfun_set_win_title() {
genfun_sanitise_cwd
- printf '\033]2;%s@%s - %s\007' "${USER}" "${HOSTNAME%%.*}" "${_cwd}"
+ printf '\033]0;%s@%s - %s\007' "${USER}" "${HOSTNAME%%.*}" "${_cwd}"
}
genfun_set_win_title
}
-# If the TTY is that of sshd(8) then proceed no further. Alas, there exist many
-# operating environments in which the window title would otherwise not be
-# restored upon ssh(1) exiting. Users wishing to coerce the historical
-# behaviour have the option of setting PROMPT_COMMAND=(genfun_set_win_title).
-if [[ ${SSH_TTY} && ${SSH_TTY} == "$(tty)" ]]; then
+# Proceed no further if the TTY is that of sshd(8) and if not running a terminal
+# multiplexer. Alas, there exist many operating environments in which the window
+# title would otherwise not be restored upon ssh(1) exiting. Those who wish for
+# the title to be set unconditionally may adjust ~/.bashrc - or create a custom
+# bashrc.d drop-in - to define PROMPT_COMMAND=(genfun_set_win_title).
+if [[ ${SSH_TTY} && ${TERM} != @(screen|tmux)* && ${SSH_TTY} == "$(tty)" ]]; then
return
fi
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/bashrc.d/
@ 2024-07-07 0:18 Sam James
0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2024-07-07 0:18 UTC (permalink / raw
To: gentoo-commits
commit: b40811ec316a630d6a48f185e6459f235c83413d
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat Jul 6 22:59:56 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 7 00:18:08 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b40811ec
app-shells/bash: add 5.2_p26-r8 with non-preliminary XTWINOPS support
The 5.2_p26-r7 revision contained (harmless) changes that were not yet
intended to be applied to the gentoo repo, owing to a miscommunication
between Sam and I. This commit applies the changes as were eventually
intended and, for this reason, the remainder of this commit message
shall be written accordingly. That is, as if no preceding commit had
been involved to get to this point.
...
Xterm is able to push and pop window titles to a stack and there are
several other terminal emulators that can do so, such as alacritty, foot
and tmux. Take advantage of this feature so as to reinstate automatic
window title setting in the case that the PTY is owned by sshd(8).
Unfortunately, there are a lot of terminal emulators that falsely
advertise themselves as being xterm-compatible, making it impossible to
reliably identify xterm itself. However, we can reliably identify
alacritty, foot and tmux so let's support those three to begin with.
The benefits conferred upon tmux are of a distinct nature, since it was
already the case that it was being whitelisted for title support.
Specifcally, the benefits are as follows:
- title restoration is supported even where tmux(1) is launched prior to ssh(1)
- title restoration is supported for nested instances of tmux
It should be noted that tmux does not forward titles to the outer
terminal emulator by default. Such can be arranged for with the
following configuration.
set -g set-titles on
set -g set-titles-string "#T"
Don't enable title setting for GNU screen in the case that the PTY is
owned by sshd(8) and screen(1) was launched prior to connecting with
ssh(1). This is a distinction that can be made by checking whether the
WINDOW variable is set in the environment.
Have the genfun_set_win_title function export a variable named
SHELL_SETS_TITLE upon the first occasion that it is called. Presently,
nothing responds to this variable but the intention is to eventually
have portage respond to it. Portage implements heuristics and behaviours
that are horrifyingly broken. For instance, it considers the mere
presence of PROMPT_COMMAND as somehow proving that the interactive shell
uses it for nothing other than to set the title, despite the fact that:
- the contents of PROMPT_COMMAND may be arbitrarily defined by the user
- the purpose of PROMPT_COMMAND is whatever the user may wish it to be
- nobody in their right mind would export PROMPT_COMMAND
- PROMPT_COMMAND can be an array since 5.1 (making it unexportable)
Worse still, in the event that portage is somehow able to ascertain the
value of PROMPT_COMMAND, it takes its first element and proceeds to
inject its value into an invocation of either sh, $SHELL or bash -c,
irrespective of the consequences. No, I'm not making this up.
As such, the purpose of the SHELL_SETS_TITLE variable is to act as a
straightforward indicator that an interactive shell exists as an
ancestor process and that it will take it upon itself to set a fresh
window title upon its primary prompt being displayed.
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../bash/{bash-5.2_p26-r7.ebuild => bash-5.2_p26-r8.ebuild} | 12 ++++++------
app-shells/bash/files/bashrc.d/10-gentoo-title-r1.bash | 13 ++++++++++---
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/app-shells/bash/bash-5.2_p26-r7.ebuild b/app-shells/bash/bash-5.2_p26-r8.ebuild
similarity index 96%
rename from app-shells/bash/bash-5.2_p26-r7.ebuild
rename to app-shells/bash/bash-5.2_p26-r8.ebuild
index c46a593c82b0..1926aee81671 100644
--- a/app-shells/bash/bash-5.2_p26-r7.ebuild
+++ b/app-shells/bash/bash-5.2_p26-r8.ebuild
@@ -372,7 +372,7 @@ pkg_postinst() {
read -r old_ver <<<"${REPLACING_VERSIONS}"
if [[ ! $old_ver ]]; then
:
- elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r7"; then
+ elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r8"; then
return
fi
@@ -387,11 +387,11 @@ PROMPT_COMMAND variable are now advised to append their commands like so:
PROMPT_COMMAND+=('custom command goes here')
Gentoo no longer defaults to having bash set the window title in the case
-that the terminal is controlled by sshd(8), unless screen or tmux are in use
-or the terminal reliably supports saving and restoring the title (as
-alacritty and foot do). Those wanting to set the title unconditionally may
-adjust ~/.bashrc - or create a custom /etc/bash/bashrc.d drop-in - to set
-PROMPT_COMMMAND like so:
+that the terminal is controlled by sshd(8), unless screen is launched on the
+remote side or the terminal reliably supports saving and restoring the title
+(as alacritty, foot and tmux do). Those wanting for the title to be set
+regardless may adjust ~/.bashrc - or create a custom /etc/bash/bashrc.d
+drop-in - to set PROMPT_COMMMAND like so:
PROMPT_COMMAND=(genfun_set_win_title)
diff --git a/app-shells/bash/files/bashrc.d/10-gentoo-title-r1.bash b/app-shells/bash/files/bashrc.d/10-gentoo-title-r1.bash
index 1dc7b63bf422..8e78b09a9daf 100644
--- a/app-shells/bash/files/bashrc.d/10-gentoo-title-r1.bash
+++ b/app-shells/bash/files/bashrc.d/10-gentoo-title-r1.bash
@@ -42,9 +42,7 @@ unset -v SHELL_SETS_TITLE
# evidence that the sequence is supported and that the UTF-8 character encoding
# is handled correctly. Quite rightly, this precludes many vintage terminals.
case ${TERM} in
- screen*|tmux*)
- ;;
- alacritty|foot*)
+ alacritty|foot*|tmux*)
# The terminal emulator also supports XTWINOPS. If the PTY was
# created by sshd(8) then push the current window title to the
# stack and arrange for it to be popped upon exiting. Xterm also
@@ -66,6 +64,15 @@ case ${TERM} in
return
fi
;;
+ screen*)
+ # If the PTY was created by sshd(8) and screen(1) was launched
+ # prior to the SSH session beginning, as opposed to afterwards,
+ # proceed no further. It is another case in which there would be
+ # no guarantee of the title being restored upon ssh(1) exiting.
+ if [[ ! ${WINDOW} && ${SSH_TTY} && ${SSH_TTY} == "$(tty)" ]]; then
+ return
+ fi
+ ;;
*)
return
esac
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/bashrc.d/
@ 2025-05-04 4:59 Sam James
0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2025-05-04 4:59 UTC (permalink / raw
To: gentoo-commits
commit: b39e66dce51adbe2ccef98dbd7e321c6c2e6b835
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat May 3 05:05:40 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun May 4 04:58:22 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b39e66dc
app-shells/bash: add 5.2_p37-r2 with optimised colour/prompt intialisation
This revision brings two changes to the 10-gentoo-color.bash drop-in.
Firstly, try to match the value of TERM against the whitelist of
terminals known to support colour, only employing tput(1) as a last
resort. Given that the list is now a well-curated one, it makes sense to
try to forgo the expense of executing an external utility.
Secondly, micro-optimise the method by which readline support is
detected. It is ever so slightly faster to run ( ! shopt -u direxpand )
as opposed to [[ ! $(shopt -p direxpand) ]].
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
app-shells/bash/bash-5.2_p37-r2.ebuild | 408 +++++++++++++++++++++
.../bash/files/bashrc.d/10-gentoo-color-r2.bash | 70 ++++
2 files changed, 478 insertions(+)
diff --git a/app-shells/bash/bash-5.2_p37-r2.ebuild b/app-shells/bash/bash-5.2_p37-r2.ebuild
new file mode 100644
index 000000000000..2e063be865c1
--- /dev/null
+++ b/app-shells/bash/bash-5.2_p37-r2.ebuild
@@ -0,0 +1,408 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/chetramey.asc
+inherit flag-o-matic toolchain-funcs prefix verify-sig
+
+# Uncomment if we have a patchset.
+#GENTOO_PATCH_DEV="sam"
+#GENTOO_PATCH_VER="${PV}"
+
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MY_P=${PN}-${MY_PV}
+MY_PATCHES=()
+
+# Determine the patchlevel. See ftp://ftp.gnu.org/gnu/bash/bash-5.2-patches/.
+case ${PV} in
+ *_p*)
+ PLEVEL=${PV##*_p}
+ ;;
+ 9999|*_alpha*|*_beta*|*_rc*)
+ # Set a negative patchlevel to indicate that it's a pre-release.
+ PLEVEL=-1
+ ;;
+ *)
+ PLEVEL=0
+esac
+
+# The version of readline this bash normally ships with. Note that we only use
+# the bundled copy of readline for pre-releases.
+READLINE_VER="8.2_p1"
+
+DESCRIPTION="The standard GNU Bourne again shell"
+HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
+ EGIT_BRANCH=devel
+ inherit git-r3
+else
+ my_urls=( {'mirror://gnu/bash','ftp://ftp.cwru.edu/pub/bash'}/"${MY_P}.tar.gz" )
+
+ # bash-5.1 -> bash51
+ my_p=${PN}$(ver_cut 1-2) my_p=${my_p/.}
+
+ for (( my_patch_idx = 1; my_patch_idx <= PLEVEL; my_patch_idx++ )); do
+ printf -v my_patch_ver %s-%03d "${my_p}" "${my_patch_idx}"
+ my_urls+=( {'mirror://gnu/bash','ftp://ftp.cwru.edu/pub/bash'}/"${MY_P}-patches/${my_patch_ver}" )
+ MY_PATCHES+=( "${DISTDIR}/${my_patch_ver}" )
+ done
+
+ SRC_URI="${my_urls[*]} verify-sig? ( ${my_urls[*]/%/.sig} )"
+
+ unset -v my_urls my_p my_patch_idx my_patch_ver
+fi
+
+if [[ ${GENTOO_PATCH_VER} ]]; then
+ SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV:?}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER:?}-patches.tar.xz"
+fi
+
+S=${WORKDIR}/${MY_P}
+
+LICENSE="GPL-3+"
+SLOT="0"
+if (( PLEVEL >= 0 )); then
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+fi
+IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
+
+DEPEND="
+ >=sys-libs/ncurses-5.2-r2:=
+ nls? ( virtual/libintl )
+"
+if (( PLEVEL >= 0 )); then
+ DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
+fi
+RDEPEND="
+ ${DEPEND}
+"
+# We only need bison (yacc) when the .y files get patched (bash42-005, bash51-011).
+BDEPEND="
+ pgo? ( dev-util/gperf )
+ verify-sig? ( sec-keys/openpgp-keys-chetramey )
+"
+
+# EAPI 8 tries to append it but it doesn't exist here.
+QA_CONFIGURE_OPTIONS="--disable-static"
+
+PATCHES=(
+ #"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
+
+ # Patches to or from Chet, posted to the bug-bash mailing list.
+ "${FILESDIR}/${PN}-5.0-syslog-history-extern.patch"
+ "${FILESDIR}/${PN}-5.2_p15-random-ub.patch"
+ "${FILESDIR}/${PN}-5.2_p15-configure-clang16.patch"
+ "${FILESDIR}/${PN}-5.2_p21-wpointer-to-int.patch"
+ "${FILESDIR}/${PN}-5.2_p32-memory-leaks.patch"
+ "${FILESDIR}/${PN}-5.2_p32-invalid-continuation-byte-ignored-as-delimiter-1.patch"
+ "${FILESDIR}/${PN}-5.2_p32-invalid-continuation-byte-ignored-as-delimiter-2.patch"
+ "${FILESDIR}/${PN}-5.2_p32-erroneous-delimiter-pushback-condition.patch"
+)
+
+pkg_setup() {
+ # bug #7332
+ if is-flag -malign-double; then
+ eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
+ eerror "as it breaks LFS (struct stat64) on x86."
+ die "remove -malign-double from your CFLAGS mr ricer"
+ fi
+
+ if use bashlogger; then
+ ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
+ ewarn "This will log ALL output you enter into the shell, you have been warned."
+ fi
+}
+
+src_unpack() {
+ local patch
+
+ if [[ ${PV} == 9999 ]]; then
+ git-r3_src_unpack
+ else
+ if use verify-sig; then
+ verify-sig_verify_detached "${DISTDIR}/${MY_P}.tar.gz"{,.sig}
+
+ for patch in "${MY_PATCHES[@]}"; do
+ verify-sig_verify_detached "${patch}"{,.sig}
+ done
+ fi
+
+ unpack "${MY_P}.tar.gz"
+
+ if [[ ${GENTOO_PATCH_VER} ]]; then
+ unpack "${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
+ fi
+ fi
+}
+
+src_prepare() {
+ # Include official patches.
+ (( PLEVEL > 0 )) && eapply -p0 "${MY_PATCHES[@]}"
+
+ # Clean out local libs so we know we use system ones w/releases. The
+ # touch utility is invoked for the benefit of config.status.
+ if (( PLEVEL >= 0 )); then
+ rm -rf lib/{readline,termcap}/* \
+ && touch lib/{readline,termcap}/Makefile.in \
+ && sed -i -E 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in \
+ || die
+ fi
+
+ # Prefixify hardcoded path names. No-op for non-prefix.
+ hprefixify pathnames.h.in
+
+ # Avoid regenerating docs after patches, bug #407985.
+ sed -i -E '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in \
+ && touch -r . doc/* \
+ || die
+
+ # Sometimes hangs (more noticeable w/ pgo), bug #907403.
+ rm tests/run-jobs || die
+
+ eapply -p0 "${PATCHES[@]}"
+ eapply_user
+}
+
+src_configure() {
+ local -a myconf
+
+ # Upstream only test with Bison and require GNUisms like YYEOF and
+ # YYERRCODE. The former at least may be in POSIX soon:
+ # https://www.austingroupbugs.net/view.php?id=1269.
+ # configure warns on use of non-Bison but doesn't abort. The result
+ # may misbehave at runtime.
+ unset -v YACC
+
+ # bash 5.3 drops unprototyped functions, earlier versions are
+ # incompatible with C23.
+ append-cflags $(test-flags-CC -std=gnu17)
+
+ myconf=(
+ --disable-profiling
+
+ # Force linking with system curses ... the bundled termcap lib
+ # sucks bad compared to ncurses. For the most part, ncurses
+ # is here because readline needs it. But bash itself calls
+ # ncurses in one or two small places :(.
+ --with-curses
+
+ $(use_enable mem-scramble)
+ $(use_enable net net-redirections)
+ $(use_enable readline)
+ $(use_enable readline bang-history)
+ $(use_enable readline history)
+ $(use_with afs)
+ $(use_with mem-scramble bash-malloc)
+ )
+
+ # For descriptions of these, see config-top.h.
+ # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
+ append-cppflags \
+ -DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \
+ -DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \
+ -DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \
+ -DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
+ -DNON_INTERACTIVE_LOGIN_SHELLS \
+ -DSSH_SOURCE_BASHRC \
+ $(use bashlogger && echo -DSYSLOG_HISTORY)
+
+ use nls || myconf+=( --disable-nls )
+
+ if (( PLEVEL >= 0 )); then
+ # Historically, we always used the builtin readline, but since
+ # our handling of SONAME upgrades has gotten much more stable
+ # in the PM (and the readline ebuild itself preserves the old
+ # libs during upgrades), linking against the system copy should
+ # be safe.
+ # Exact cached version here doesn't really matter as long as it
+ # is at least what's in the DEPEND up above.
+ export ac_cv_rl_version=${READLINE_VER%%_*}
+
+ # Use system readline only with released versions.
+ myconf+=( --with-installed-readline=. )
+ fi
+
+ if use plugins; then
+ append-ldflags "-Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/bash"
+ else
+ # Disable the plugins logic by hand since bash doesn't provide
+ # a way of doing it.
+ export ac_cv_func_dl{close,open,sym}=no \
+ ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
+
+ sed -i -e '/LOCAL_LDFLAGS=/s:-rdynamic::' configure || die
+ fi
+
+ # bug #444070
+ tc-export AR
+
+ econf "${myconf[@]}"
+}
+
+src_compile() {
+ local -a pgo_generate_flags pgo_use_flags
+ local flag
+
+ # -fprofile-partial-training because upstream notes the test suite isn't
+ # super comprehensive.
+ # https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
+ if use pgo; then
+ pgo_generate_flags=(
+ -fprofile-update=atomic
+ -fprofile-dir="${T}"/pgo
+ -fprofile-generate="${T}"/pgo
+ )
+ pgo_use_flags=(
+ -fprofile-use="${T}"/pgo
+ -fprofile-dir="${T}"/pgo
+ )
+ if flag=$(test-flags-CC -fprofile-partial-training); then
+ pgo_generate_flags+=( "${flag}" )
+ pgo_use_flags+=( "${flag}" )
+ fi
+ fi
+
+ emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}"
+ use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" all others
+
+ # Build Bash and run its tests to generate profiles.
+ if (( ${#pgo_generate_flags[@]} )); then
+ # Used in test suite.
+ unset -v A
+
+ emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" -k check
+
+ if tc-is-clang; then
+ llvm-profdata merge "${T}"/pgo --output="${T}"/pgo/default.profdata || die
+ fi
+
+ # Rebuild Bash using the profiling data we just generated.
+ emake clean
+ emake CFLAGS="${CFLAGS} ${pgo_use_flags[*]}"
+ use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_use_flags[*]}" all others
+ fi
+}
+
+src_test() {
+ # Used in test suite.
+ unset -v A
+
+ default
+}
+
+src_install() {
+ local d f
+
+ default
+
+ my_prefixify() {
+ while read -r; do
+ if [[ $REPLY == *$1* ]]; then
+ REPLY=${REPLY/"/etc/"/"${EPREFIX}/etc/"}
+ fi
+ printf '%s\n' "${REPLY}" || ! break
+ done < "$2" || die
+ }
+
+ dodir /bin
+ mv -- "${ED}"/usr/bin/bash "${ED}"/bin/ || die
+ dosym bash /bin/rbash
+
+ insinto /etc/bash
+ doins "${FILESDIR}"/bash_logout
+ my_prefixify bashrc.d "${FILESDIR}"/bashrc-r1 | newins - bashrc
+
+ insinto /etc/bash/bashrc.d
+ my_prefixify DIR_COLORS "${FILESDIR}"/bashrc.d/10-gentoo-color-r2.bash | newins - 10-gentoo-color.bash
+ newins "${FILESDIR}"/bashrc.d/10-gentoo-title-r2.bash 10-gentoo-title.bash
+ if [[ ! ${EPREFIX} ]]; then
+ doins "${FILESDIR}"/bashrc.d/15-gentoo-bashrc-check.bash
+ fi
+
+ insinto /etc/skel
+ for f in bash{_logout,_profile,rc}; do
+ newins "${FILESDIR}/dot-${f}" ".${f}"
+ done
+
+ if use plugins; then
+ exeinto "/usr/$(get_libdir)/bash"
+ set -- examples/loadables/*.o
+ doexe "${@%.o}"
+
+ insinto /usr/include/bash-plugins
+ doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
+ fi
+
+ if use examples; then
+ for d in examples/{functions,misc,scripts,startup-files}; do
+ exeinto "/usr/share/doc/${PF}/${d}"
+ docinto "${d}"
+ for f in "${d}"/*; do
+ if [[ ${f##*/} != @(PERMISSION|*README) ]]; then
+ doexe "${f}"
+ else
+ dodoc "${f}"
+ fi
+ done
+ done
+ fi
+
+ # Install bash_builtins.1 and rbash.1.
+ emake -C doc DESTDIR="${D}" install_builtins
+ sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
+ doman "${T}"/rbash.1
+
+ newdoc CWRU/changelog ChangeLog
+ dosym bash.info /usr/share/info/bashref.info
+}
+
+pkg_preinst() {
+ if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]]; then
+ mkdir -p -- "${EROOT}"/etc/bash \
+ && mv -f -- "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/ \
+ || die
+ fi
+}
+
+pkg_postinst() {
+ local old_ver
+
+ # If /bin/sh does not exist, provide it.
+ if [[ ! -e ${EROOT}/bin/sh ]]; then
+ ln -sf -- bash "${EROOT}"/bin/sh || die
+ fi
+
+ read -r old_ver <<<"${REPLACING_VERSIONS}"
+ if [[ ! $old_ver ]]; then
+ :
+ elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r8"; then
+ return
+ fi
+
+ while read -r; do ewarn "${REPLY}"; done <<'EOF'
+Files under /etc/bash/bashrc.d must now have a suffix of .sh or .bash.
+
+Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the
+characteristics of the operating environment, it may contain a command to set
+the terminal's window title. Those who were already choosing to customise the
+PROMPT_COMMAND variable are now advised to append their commands like so:
+
+PROMPT_COMMAND+=('custom command goes here')
+
+Gentoo no longer defaults to having bash set the window title in the case
+that the terminal is controlled by sshd(8), unless screen is launched on the
+remote side or the terminal reliably supports saving and restoring the title
+(as alacritty, foot and tmux do). Those wanting for the title to be set
+regardless may adjust ~/.bashrc - or create a custom /etc/bash/bashrc.d
+drop-in - to set PROMPT_COMMMAND like so:
+
+PROMPT_COMMAND=(genfun_set_win_title)
+
+Those who would prefer for bash never to interfere with the window title may
+now opt out of the default title setting behaviour, either with the "unset -v
+PROMPT_COMMAND" command or by re-defining PROMPT_COMMAND as desired.
+EOF
+}
diff --git a/app-shells/bash/files/bashrc.d/10-gentoo-color-r2.bash b/app-shells/bash/files/bashrc.d/10-gentoo-color-r2.bash
new file mode 100644
index 000000000000..847e76f8f186
--- /dev/null
+++ b/app-shells/bash/files/bashrc.d/10-gentoo-color-r2.bash
@@ -0,0 +1,70 @@
+# /etc/bash/bashrc.d/10-gentoo-color.bash
+
+if [[ ${NO_COLOR} ]]; then
+ # Respect the user's wish not to use color. See https://no-color.org/.
+ gentoo_color=0
+elif [[ ${COLORTERM@a} == *x* && ${COLORTERM} == @(24bit|truecolor) ]]; then
+ # The COLORTERM environment variable can reasonably be trusted here.
+ # See https://github.com/termstandard/colors for further information.
+ gentoo_color=1
+else
+ # Check TERM against a whitelist covering a majority of popular
+ # terminal emulators and virtual console implementations known to
+ # support color. If no matching entry is found, try to use tput(1) to
+ # determine whether color is supported.
+ case ${TERM} in
+ *color* |\
+ *direct* |\
+ *ghostty |\
+ [Ekx]term* |\
+ alacritty |\
+ aterm |\
+ contour |\
+ dtterm |\
+ foot* |\
+ jfbterm |\
+ linux |\
+ mlterm |\
+ rxvt* |\
+ screen* |\
+ tmux* |\
+ wsvt25* ) gentoo_color=1 ;;
+ * ) gentoo_color=$(tput colors 2>/dev/null)
+ esac
+fi
+
+# For direxpand to be missing indicates that bash is lacking readline support.
+if (( gentoo_color <= 0 )) || ( ! shopt -u direxpand 2>/dev/null ); then
+ # Define a prompt without color.
+ PS1='\u@\h \w \$ '
+elif (( EUID == 0 )); then
+ # If root, omit the username and print the hostname in red.
+ PS1='\[\e[01;31m\]\h\[\e[01;34m\] \w \$\[\e[00m\] '
+else
+ # Otherwise, print the username and hostname in green.
+ PS1='\[\e[01;32m\]\u@\h\[\e[01;34m\] \w \$\[\e[00m\] '
+fi
+
+if (( gentoo_color > 0 )); then
+ # Colorize the output of diff(1), grep(1) and a few coreutils utilities.
+ # However, do so only where no alias/function by the given name exists.
+ for _ in diff dir grep ls vdir; do
+ if [[ $(type -t "$_") == file ]]; then
+ alias "$_=$_ --color=auto"
+ fi
+ done
+
+ # Enable colors for ls(1) and some other utilities that respect the
+ # LS_COLORS variable. Prefer ~/.dir_colors, per bug #64489.
+ if hash dircolors 2>/dev/null; then
+ if [[ -f ~/.dir_colors ]]; then
+ eval "$(COLORTERM=1 dircolors -b -- ~/.dir_colors)"
+ elif [[ -f /etc/DIR_COLORS ]]; then
+ eval "$(COLORTERM=1 dircolors -b /etc/DIR_COLORS)"
+ else
+ eval "$(COLORTERM=1 dircolors -b)"
+ fi
+ fi
+fi
+
+unset -v gentoo_color
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/bashrc.d/
@ 2025-08-18 15:55 Sam James
0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2025-08-18 15:55 UTC (permalink / raw
To: gentoo-commits
commit: 0f47bc2332d21b4e546f2d155a78f9cbcd0e89d7
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Mon Aug 18 07:31:21 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 18 15:50:59 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f47bc23
app-shells/bash: drop 5.2_p37
Drop 5.2_p37, along with the files that it was uniquely referencing.
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
app-shells/bash/bash-5.2_p37.ebuild | 410 ---------------------
.../bash/files/bashrc.d/10-gentoo-color.bash | 68 ----
.../bash/files/bashrc.d/10-gentoo-title-r1.bash | 81 ----
3 files changed, 559 deletions(-)
diff --git a/app-shells/bash/bash-5.2_p37.ebuild b/app-shells/bash/bash-5.2_p37.ebuild
deleted file mode 100644
index 9797feecdcf2..000000000000
--- a/app-shells/bash/bash-5.2_p37.ebuild
+++ /dev/null
@@ -1,410 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/chetramey.asc
-inherit flag-o-matic toolchain-funcs prefix verify-sig
-
-# Uncomment if we have a patchset.
-#GENTOO_PATCH_DEV="sam"
-#GENTOO_PATCH_VER="${PV}"
-
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-MY_PATCHES=()
-
-# Determine the patchlevel. See ftp://ftp.gnu.org/gnu/bash/bash-5.2-patches/.
-case ${PV} in
- *_p*)
- PLEVEL=${PV##*_p}
- ;;
- 9999|*_alpha*|*_beta*|*_rc*)
- # Set a negative patchlevel to indicate that it's a pre-release.
- PLEVEL=-1
- ;;
- *)
- PLEVEL=0
-esac
-
-# The version of readline this bash normally ships with. Note that we only use
-# the bundled copy of readline for pre-releases.
-READLINE_VER="8.2_p1"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
-
-if [[ ${PV} == 9999 ]]; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
- EGIT_BRANCH=devel
- inherit git-r3
-else
- my_urls=( "mirror://gnu/bash/${MY_P}.tar.gz" )
-
- # bash-5.1 -> bash51
- my_p=${PN}$(ver_cut 1-2) my_p=${my_p/.}
-
- for (( my_patch_idx = 1; my_patch_idx <= PLEVEL; my_patch_idx++ )); do
- printf -v my_patch_ver %s-%03d "${my_p}" "${my_patch_idx}"
- my_urls+=( "mirror://gnu/bash/${MY_P}-patches/${my_patch_ver}" )
- MY_PATCHES+=( "${DISTDIR}/${my_patch_ver}" )
- done
-
- SRC_URI="${my_urls[*]} verify-sig? ( ${my_urls[*]/%/.sig} )"
-
- unset -v my_urls my_p my_patch_idx my_patch_ver
-fi
-
-if [[ ${GENTOO_PATCH_VER} ]]; then
- SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV:?}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER:?}-patches.tar.xz"
-fi
-
-S=${WORKDIR}/${MY_P}
-
-LICENSE="GPL-3+"
-SLOT="0"
-if (( PLEVEL >= 0 )); then
- KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
-fi
-IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
-
-DEPEND="
- >=sys-libs/ncurses-5.2-r2:=
- nls? ( virtual/libintl )
-"
-if (( PLEVEL >= 0 )); then
- DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
-fi
-RDEPEND="
- ${DEPEND}
-"
-# We only need bison (yacc) when the .y files get patched (bash42-005, bash51-011).
-BDEPEND="
- pgo? ( dev-util/gperf )
- verify-sig? ( sec-keys/openpgp-keys-chetramey )
-"
-
-# EAPI 8 tries to append it but it doesn't exist here.
-QA_CONFIGURE_OPTIONS="--disable-static"
-
-PATCHES=(
- #"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
-
- # Patches to or from Chet, posted to the bug-bash mailing list.
- "${FILESDIR}/${PN}-5.0-syslog-history-extern.patch"
- "${FILESDIR}/${PN}-5.2_p15-random-ub.patch"
- "${FILESDIR}/${PN}-5.2_p15-configure-clang16.patch"
- "${FILESDIR}/${PN}-5.2_p21-wpointer-to-int.patch"
- "${FILESDIR}/${PN}-5.2_p32-memory-leaks.patch"
- "${FILESDIR}/${PN}-5.2_p32-invalid-continuation-byte-ignored-as-delimiter-1.patch"
-)
-
-pkg_setup() {
- # bug #7332
- if is-flag -malign-double; then
- eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
- eerror "as it breaks LFS (struct stat64) on x86."
- die "remove -malign-double from your CFLAGS mr ricer"
- fi
-
- if use bashlogger; then
- ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
- ewarn "This will log ALL output you enter into the shell, you have been warned."
- fi
-}
-
-src_unpack() {
- local patch
-
- if [[ ${PV} == 9999 ]]; then
- git-r3_src_unpack
- else
- if use verify-sig; then
- verify-sig_verify_detached "${DISTDIR}/${MY_P}.tar.gz"{,.sig}
-
- for patch in "${MY_PATCHES[@]}"; do
- verify-sig_verify_detached "${patch}"{,.sig}
- done
- fi
-
- unpack "${MY_P}.tar.gz"
-
- if [[ ${GENTOO_PATCH_VER} ]]; then
- unpack "${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
- fi
- fi
-}
-
-src_prepare() {
- # Include official patches.
- (( PLEVEL > 0 )) && eapply -p0 "${MY_PATCHES[@]}"
-
- # Clean out local libs so we know we use system ones w/releases. The
- # touch utility is invoked for the benefit of config.status.
- if (( PLEVEL >= 0 )); then
- rm -rf lib/{readline,termcap}/* \
- && touch lib/{readline,termcap}/Makefile.in \
- && sed -i -E 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in \
- || die
- fi
-
- # Prefixify hardcoded path names. No-op for non-prefix.
- hprefixify pathnames.h.in
-
- # Avoid regenerating docs after patches, bug #407985.
- sed -i -E '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in \
- && touch -r . doc/* \
- || die
-
- # Sometimes hangs (more noticeable w/ pgo), bug #907403.
- rm tests/run-jobs || die
-
- eapply -p0 "${PATCHES[@]}"
- eapply_user
-}
-
-src_configure() {
- local -a myconf
-
- # Upstream only test with Bison and require GNUisms like YYEOF and
- # YYERRCODE. The former at least may be in POSIX soon:
- # https://www.austingroupbugs.net/view.php?id=1269.
- # configure warns on use of non-Bison but doesn't abort. The result
- # may misbehave at runtime.
- unset -v YACC
-
- # bash 5.3 drops unprototyped functions, earlier versions are
- # incompatible with C23.
- append-cflags $(test-flags-CC -std=gnu17)
-
- if tc-is-cross-compiler; then
- export CFLAGS_FOR_BUILD="${BUILD_CFLAGS} -std=gnu17"
- fi
-
- myconf=(
- --disable-profiling
-
- # Force linking with system curses ... the bundled termcap lib
- # sucks bad compared to ncurses. For the most part, ncurses
- # is here because readline needs it. But bash itself calls
- # ncurses in one or two small places :(.
- --with-curses
-
- $(use_enable mem-scramble)
- $(use_enable net net-redirections)
- $(use_enable readline)
- $(use_enable readline bang-history)
- $(use_enable readline history)
- $(use_with afs)
- $(use_with mem-scramble bash-malloc)
- )
-
- # For descriptions of these, see config-top.h.
- # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
- append-cppflags \
- -DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \
- -DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \
- -DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \
- -DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
- -DNON_INTERACTIVE_LOGIN_SHELLS \
- -DSSH_SOURCE_BASHRC \
- $(use bashlogger && echo -DSYSLOG_HISTORY)
-
- use nls || myconf+=( --disable-nls )
-
- if (( PLEVEL >= 0 )); then
- # Historically, we always used the builtin readline, but since
- # our handling of SONAME upgrades has gotten much more stable
- # in the PM (and the readline ebuild itself preserves the old
- # libs during upgrades), linking against the system copy should
- # be safe.
- # Exact cached version here doesn't really matter as long as it
- # is at least what's in the DEPEND up above.
- export ac_cv_rl_version=${READLINE_VER%%_*}
-
- # Use system readline only with released versions.
- myconf+=( --with-installed-readline=. )
- fi
-
- if use plugins; then
- append-ldflags "-Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/bash"
- else
- # Disable the plugins logic by hand since bash doesn't provide
- # a way of doing it.
- export ac_cv_func_dl{close,open,sym}=no \
- ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-
- sed -i -e '/LOCAL_LDFLAGS=/s:-rdynamic::' configure || die
- fi
-
- # bug #444070
- tc-export AR
-
- econf "${myconf[@]}"
-}
-
-src_compile() {
- local -a pgo_generate_flags pgo_use_flags
- local flag
-
- # -fprofile-partial-training because upstream notes the test suite isn't
- # super comprehensive.
- # https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
- if use pgo; then
- pgo_generate_flags=(
- -fprofile-update=atomic
- -fprofile-dir="${T}"/pgo
- -fprofile-generate="${T}"/pgo
- )
- pgo_use_flags=(
- -fprofile-use="${T}"/pgo
- -fprofile-dir="${T}"/pgo
- )
- if flag=$(test-flags-CC -fprofile-partial-training); then
- pgo_generate_flags+=( "${flag}" )
- pgo_use_flags+=( "${flag}" )
- fi
- fi
-
- emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}"
- use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" all others
-
- # Build Bash and run its tests to generate profiles.
- if (( ${#pgo_generate_flags[@]} )); then
- # Used in test suite.
- unset -v A
-
- emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" -k check
-
- if tc-is-clang; then
- llvm-profdata merge "${T}"/pgo --output="${T}"/pgo/default.profdata || die
- fi
-
- # Rebuild Bash using the profiling data we just generated.
- emake clean
- emake CFLAGS="${CFLAGS} ${pgo_use_flags[*]}"
- use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_use_flags[*]}" all others
- fi
-}
-
-src_test() {
- # Used in test suite.
- unset -v A
-
- default
-}
-
-src_install() {
- local d f
-
- default
-
- my_prefixify() {
- while read -r; do
- if [[ $REPLY == *$1* ]]; then
- REPLY=${REPLY/"/etc/"/"${EPREFIX}/etc/"}
- fi
- printf '%s\n' "${REPLY}" || ! break
- done < "$2" || die
- }
-
- dodir /bin
- mv -- "${ED}"/usr/bin/bash "${ED}"/bin/ || die
- dosym bash /bin/rbash
-
- insinto /etc/bash
- doins "${FILESDIR}"/bash_logout
- my_prefixify bashrc.d "${FILESDIR}"/bashrc-r1 | newins - bashrc
-
- insinto /etc/bash/bashrc.d
- my_prefixify DIR_COLORS "${FILESDIR}"/bashrc.d/10-gentoo-color.bash | newins - 10-gentoo-color.bash
- newins "${FILESDIR}"/bashrc.d/10-gentoo-title-r1.bash 10-gentoo-title.bash
- if [[ ! ${EPREFIX} ]]; then
- doins "${FILESDIR}"/bashrc.d/15-gentoo-bashrc-check.bash
- fi
-
- insinto /etc/skel
- for f in bash{_logout,_profile,rc}; do
- newins "${FILESDIR}/skel/dot-${f}" ".${f}"
- done
-
- if use plugins; then
- exeinto "/usr/$(get_libdir)/bash"
- set -- examples/loadables/*.o
- doexe "${@%.o}"
-
- insinto /usr/include/bash-plugins
- doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
- fi
-
- if use examples; then
- for d in examples/{functions,misc,scripts,startup-files}; do
- exeinto "/usr/share/doc/${PF}/${d}"
- docinto "${d}"
- for f in "${d}"/*; do
- if [[ ${f##*/} != @(PERMISSION|*README) ]]; then
- doexe "${f}"
- else
- dodoc "${f}"
- fi
- done
- done
- fi
-
- # Install bash_builtins.1 and rbash.1.
- emake -C doc DESTDIR="${D}" install_builtins
- sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
- doman "${T}"/rbash.1
-
- newdoc CWRU/changelog ChangeLog
- dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
- if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]]; then
- mkdir -p -- "${EROOT}"/etc/bash \
- && mv -f -- "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/ \
- || die
- fi
-}
-
-pkg_postinst() {
- local old_ver
-
- # If /bin/sh does not exist, provide it.
- if [[ ! -e ${EROOT}/bin/sh ]]; then
- ln -sf -- bash "${EROOT}"/bin/sh || die
- fi
-
- read -r old_ver <<<"${REPLACING_VERSIONS}"
- if [[ ! $old_ver ]]; then
- :
- elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r8"; then
- return
- fi
-
- while read -r; do ewarn "${REPLY}"; done <<'EOF'
-Files under /etc/bash/bashrc.d must now have a suffix of .sh or .bash.
-
-Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the
-characteristics of the operating environment, it may contain a command to set
-the terminal's window title. Those who were already choosing to customise the
-PROMPT_COMMAND variable are now advised to append their commands like so:
-
-PROMPT_COMMAND+=('custom command goes here')
-
-Gentoo no longer defaults to having bash set the window title in the case
-that the terminal is controlled by sshd(8), unless screen is launched on the
-remote side or the terminal reliably supports saving and restoring the title
-(as alacritty, foot and tmux do). Those wanting for the title to be set
-regardless may adjust ~/.bashrc - or create a custom /etc/bash/bashrc.d
-drop-in - to set PROMPT_COMMMAND like so:
-
-PROMPT_COMMAND=(genfun_set_win_title)
-
-Those who would prefer for bash never to interfere with the window title may
-now opt out of the default title setting behaviour, either with the "unset -v
-PROMPT_COMMAND" command or by re-defining PROMPT_COMMAND as desired.
-EOF
-}
diff --git a/app-shells/bash/files/bashrc.d/10-gentoo-color.bash b/app-shells/bash/files/bashrc.d/10-gentoo-color.bash
deleted file mode 100644
index f0c5983b66e1..000000000000
--- a/app-shells/bash/files/bashrc.d/10-gentoo-color.bash
+++ /dev/null
@@ -1,68 +0,0 @@
-# /etc/bash/bashrc.d/10-gentoo-color.bash
-
-if [[ ${NO_COLOR} ]]; then
- # Respect the user's wish not to use color. See https://no-color.org/.
- gentoo_color=0
-elif [[ ${COLORTERM@a} == *x* && ${COLORTERM} == @(24bit|truecolor) ]]; then
- # The COLORTERM environment variable can reasonably be trusted here.
- # See https://github.com/termstandard/colors for further information.
- gentoo_color=1
-elif unset -v COLORTERM; ! gentoo_color=$(tput colors 2>/dev/null); then
- # Either ncurses is not installed or no terminfo database could be
- # found. Fall back to a whitelist which covers the majority of terminal
- # emulators and virtual console implementations known to support color
- # and which remain (somewhat) popular. This will rarely happen, so the
- # list need not be exhaustive.
- case ${TERM} in
- *color* |\
- *direct* |\
- [Ekx]term* |\
- alacritty |\
- aterm |\
- dtterm |\
- foot* |\
- jfbterm |\
- linux |\
- mlterm |\
- rxvt* |\
- screen* |\
- tmux* |\
- wsvt25* ) gentoo_color=1
- esac
-elif (( gentoo_color == 16777216 )); then
- # Truecolor support is available. Advertise it.
- export COLORTERM=truecolor
-fi
-
-# For direxpand to be missing indicates that bash is lacking readline support.
-if (( gentoo_color <= 0 )) || [[ ! $(shopt -p direxpand 2>/dev/null) ]]; then
- # Define a prompt without color.
- PS1='\u@\h \w \$ '
-elif (( EUID == 0 )); then
- # If root, omit the username and print the hostname in red.
- PS1='\[\e[01;31m\]\h\[\e[01;34m\] \w \$\[\e[00m\] '
-else
- # Otherwise, print the username and hostname in green.
- PS1='\[\e[01;32m\]\u@\h\[\e[01;34m\] \w \$\[\e[00m\] '
-fi
-
-if (( gentoo_color > 0 )); then
- # Colorize the output of diff(1), grep(1) and a few coreutils utilities.
- for _ in diff dir grep ls vdir; do
- alias "$_=$_ --color=auto"
- done
-
- # Enable colors for ls(1) and some other utilities that respect the
- # LS_COLORS variable. Prefer ~/.dir_colors, per bug #64489.
- if hash dircolors 2>/dev/null; then
- if [[ -f ~/.dir_colors ]]; then
- eval "$(dircolors -b -- ~/.dir_colors)"
- elif [[ -f /etc/DIR_COLORS ]]; then
- eval "$(dircolors -b /etc/DIR_COLORS)"
- else
- eval "$(dircolors -b)"
- fi
- fi
-fi
-
-unset -v gentoo_color
diff --git a/app-shells/bash/files/bashrc.d/10-gentoo-title-r1.bash b/app-shells/bash/files/bashrc.d/10-gentoo-title-r1.bash
deleted file mode 100644
index 8e78b09a9daf..000000000000
--- a/app-shells/bash/files/bashrc.d/10-gentoo-title-r1.bash
+++ /dev/null
@@ -1,81 +0,0 @@
-# /etc/bash/bashrc.d/10-gentoo-title.bash
-
-# For information regarding the control sequences used, please refer to
-# https://invisible-island.net/xterm/ctlseqs/ctlseqs.html.
-
-genfun_set_win_title() {
- # Advertise the fact that the presently running interactive shell will
- # update the title. Doing so allows for its subprocesses to determine
- # whether it is safe to set the title of their own accord. Note that 0
- # refers to the value of Ps within the OSC Ps ; Pt BEL sequence.
- export SHELL_SETS_TITLE=0
-
- # Assigns the basename of the current working directory, having
- # sanitised it with @Q parameter expansion. Useful for paths containing
- # newlines and such. As a special case, names consisting entirely of
- # graphemes shall not undergo the expansion, for reasons of cleanliness.
- genfun_sanitise_cwd() {
- _cwd=${PWD##*/}
- if [[ ! ${_cwd} ]]; then
- _cwd=${PWD}
- elif [[ ${_cwd} == *[![:graph:]]* ]]; then
- _cwd=${_cwd@Q}
- fi
- }
-
- # Sets the window title with the Set Text Parameters control sequence.
- # For screen, the sequence defines the hardstatus (%h) and for tmux, the
- # pane_title (#T). For graphical terminal emulators, it is normal for
- # the title bar to be affected.
- genfun_set_win_title() {
- genfun_sanitise_cwd
- printf '\033]0;%s@%s - %s\007' "${USER}" "${HOSTNAME%%.*}" "${_cwd}"
- }
-
- genfun_set_win_title
-}
-
-unset -v SHELL_SETS_TITLE
-
-# Determine whether the terminal can handle the Set Text Parameters sequence.
-# The only terminals permitted here are those for which there is empirical
-# evidence that the sequence is supported and that the UTF-8 character encoding
-# is handled correctly. Quite rightly, this precludes many vintage terminals.
-case ${TERM} in
- alacritty|foot*|tmux*)
- # The terminal emulator also supports XTWINOPS. If the PTY was
- # created by sshd(8) then push the current window title to the
- # stack and arrange for it to be popped upon exiting. Xterm also
- # supports this but there are far too many terminal emulators
- # that falsely identify as being xterm-compatible.
- if [[ ${SSH_TTY} && ${SSH_TTY} == "$(tty)" ]]; then
- trap 'printf "\033[23;0t"' EXIT
- printf '\033[22;0t'
- fi
- ;;
- rxvt-unicode*|st-256color|xterm*)
- # If the PTY was created by sshd(8) then proceed no further.
- # Alas, there exist many operating environments in which the
- # title would otherwise not be restored upon ssh(1) exiting.
- # Those wanting for the title to be set regardless may adjust
- # ~/.bashrc or create a bashrc.d drop-in to set PROMPT_COMMAND.
- # For example, PROMPT_COMMAND=(genfun_set_win_title).
- if [[ ${SSH_TTY} && ${SSH_TTY} == "$(tty)" ]]; then
- return
- fi
- ;;
- screen*)
- # If the PTY was created by sshd(8) and screen(1) was launched
- # prior to the SSH session beginning, as opposed to afterwards,
- # proceed no further. It is another case in which there would be
- # no guarantee of the title being restored upon ssh(1) exiting.
- if [[ ! ${WINDOW} && ${SSH_TTY} && ${SSH_TTY} == "$(tty)" ]]; then
- return
- fi
- ;;
- *)
- return
-esac
-
-# Arrange for the title to be updated each time the primary prompt is displayed.
-PROMPT_COMMAND+=('genfun_set_win_title')
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/bashrc.d/
@ 2025-09-30 20:14 Sam James
0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2025-09-30 20:14 UTC (permalink / raw
To: gentoo-commits
commit: 3fe09cee79878a77ed9fddc417a9d54cd6c7f97d
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat Sep 20 01:13:30 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Sep 30 20:14:03 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3fe09cee
app-shells/bash: drop files/bashrc.d/15-gentoo-bashrc-check.bash
Drop the "15-gentoo-bashrc-check.bash" drop-in, whose retirement was
overdue. Do so by:
- dropping 5.2_p37-r3
- dropping the 5.4 snapshots, except for the latest
- revision-bumping the latest 5.4 snapshot
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
app-shells/bash/Manifest | 2 -
app-shells/bash/bash-5.2_p37-r3.ebuild | 419 ---------------------
app-shells/bash/bash-5.4_alpha_pre20250822.ebuild | 410 --------------------
.../bash/bash-5.4_alpha_pre20250904-r1.ebuild | 411 --------------------
app-shells/bash/bash-5.4_alpha_pre20250904.ebuild | 411 --------------------
...ebuild => bash-5.4_alpha_pre20250918-r1.ebuild} | 3 -
.../files/bashrc.d/15-gentoo-bashrc-check.bash | 24 --
7 files changed, 1680 deletions(-)
diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
index 4afbac6a24d3..78f0fd367bcd 100644
--- a/app-shells/bash/Manifest
+++ b/app-shells/bash/Manifest
@@ -24,8 +24,6 @@ DIST bash-5.2.tar.gz 10950833 BLAKE2B 51b196e710794ebad8eac28c31c93eb99ac1a7db30
DIST bash-5.2.tar.gz.sig 95 BLAKE2B 2991b7c46ef1cdca08062f419be47fca7551f4c5d9aad8a5c1da74974f5e7707d23914b4cecf9b6c9610471146b2c49b611bb62a5d974f1c37cceb77b719851c SHA512 a161664f124f906be32709f66702f8f780e6d52e558ea45e71ec60a959c9435ff68477ee65a0a9f6c0051d5592f5044fb3b410cf3cd3ae5a8a323789b01be258
DIST bash-5.3.tar.gz 11355854 BLAKE2B 82d1b54322bbd1e8c2a93380f1b2888a42a1d7186e504f41cee705a0fdd41463d8f20baa1755051e1396192f8ebd089524767d933a9e0b5fb76f2588601539bb SHA512 426702c8b0fb9e0c9956259973ce5b657890fd47f4f807a64febf20077bb48d0b91474ed6e843d2ef277186b46c5fffa79b808da9b48d4ec027d5e2de1b28ed8
DIST bash-5.3.tar.gz.sig 95 BLAKE2B 2fb04e4f699fdee6e583581821cf9a5fa435a00febf7893a344371f11ccb964545386c98dfb2d8f5d0efc74aafe9d491b544e90ae4716bdc286ac48d942430f0 SHA512 c77c0898f03e80a042574a486686cc296b96426f6cdb7a6d2376ecd5182ba03477bfcbd95ea3db499c11866d3f4ae99012a37662ccb6f83dfd6b59f671349dc7
-DIST bash-5.4_alpha_pre20250822-ab17ddb7af948ee6e1a6370aac4ee57b4179cd9c.tar.gz 16121182 BLAKE2B 2802ab3bea45fe40f515d668baeaf5ca04797b992dcb764ee38b707701bc6aac845f091b16770a51c84bfdd2ba3953b12b1fded9fdbfde035df7088f4376c236 SHA512 af7182bcad82bc7256d2b806a6f8c3ee1855fa1b3e4b3695cd8b3618e56263285899a01d6ef49fe2862e812731718fc9d309836ff260e39d30e7e02fab044c72
-DIST bash-5.4_alpha_pre20250904-a451bfc3f57201bc0933b62c2fb721940a4c33f5.tar.gz 16571099 BLAKE2B c4661bfe261ac4c653444d7ff4ed17b7335d0c32b12b342e8ae683a5022d098f922a2ac0b2312eb4eb672e53bdbd7e0518d565ee7119f463bc5650ac2663a07b SHA512 9d0f7aecb8809c34828ada19fd69f0e5889a30c5bc4177ce32d3e3c7dc26803d1311a9ef4e2386845d884fa6aa6c1212263253e1347f413350ed2ea42d961036
DIST bash-5.4_alpha_pre20250918-cf8a2518c8b94f75b330d398f5daa0ee21417e1b.tar.gz 16611222 BLAKE2B 4c6f4713da5f1b103176980b5def4c8643ca43b2c97faf3cab61f64baf562c3871bb0f5843164de617eb4f9dcab5c5a11ddd1f31e8614ddc5ff00c41893c4ef7 SHA512 2d0b90277c6e9130064d712c6167e5a2871b0485251cca746a57055e08626b9a11be0cb134f082446ee8db82043eb1eb7f8b20fa58e8cdc859638f50cb16d56d
DIST bash205b-001 1132 BLAKE2B 0c5eef29777d54ef05957ea3d63b1556fb380bd20c238dc28993d822b37bc4e78ff4048ad069f6b8cd25da77ccdeb7aecd86c4349cb9d81e5e94c7001eeae5e6 SHA512 5ce4357468821b05e747201f3aa57225ad8f540c9e2c87051720490e039c30b478b9b662a68f14a0800fefe40184e4495e2645665200f9d75e9a115b2ac08071
DIST bash205b-002 755 BLAKE2B 6a6ed5679d451f02f8104b345c1722d11718ce3b4043b581c17786d40d8da69a34786fb56d0c363dba277b8e9dd33f12f70c9cc73a9fc39ba4a8319406f0458d SHA512 46947b0229478d5c2cfeff68b8ebc00e4ef0c8b94e336ca12f72b4490ba3622c0240c01c17c1641c3b07adc2c64ec94d6d780365e8990768ec8888f3a9526883
diff --git a/app-shells/bash/bash-5.2_p37-r3.ebuild b/app-shells/bash/bash-5.2_p37-r3.ebuild
deleted file mode 100644
index 452f64acfa04..000000000000
--- a/app-shells/bash/bash-5.2_p37-r3.ebuild
+++ /dev/null
@@ -1,419 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/chetramey.asc
-inherit flag-o-matic toolchain-funcs prefix verify-sig
-
-# Uncomment if we have a patchset.
-#GENTOO_PATCH_DEV="sam"
-#GENTOO_PATCH_VER="${PV}"
-
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-MY_PATCHES=()
-
-# Determine the patchlevel. See https://ftp.gnu.org/gnu/bash/bash-5.2-patches/.
-case ${PV} in
- *_p*)
- PLEVEL=${PV##*_p}
- ;;
- 9999|*_alpha*|*_beta*|*_rc*)
- # Set a negative patchlevel to indicate that it's a pre-release.
- PLEVEL=-1
- ;;
- *)
- PLEVEL=0
-esac
-
-# The version of readline this bash normally ships with. Note that we only use
-# the bundled copy of readline for pre-releases.
-READLINE_VER="8.2_p1"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
-
-if [[ ${PV} == 9999 ]]; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
- EGIT_BRANCH=devel
- inherit git-r3
-else
- my_urls=( "mirror://gnu/bash/${MY_P}.tar.gz" )
-
- # bash-5.1 -> bash51
- my_p=${PN}$(ver_cut 1-2) my_p=${my_p/.}
-
- for (( my_patch_idx = 1; my_patch_idx <= PLEVEL; my_patch_idx++ )); do
- printf -v my_patch_ver %s-%03d "${my_p}" "${my_patch_idx}"
- my_urls+=( "mirror://gnu/bash/${MY_P}-patches/${my_patch_ver}" )
- MY_PATCHES+=( "${DISTDIR}/${my_patch_ver}" )
- done
-
- SRC_URI="${my_urls[*]} verify-sig? ( ${my_urls[*]/%/.sig} )"
-
- unset -v my_urls my_p my_patch_idx my_patch_ver
-fi
-
-if [[ ${GENTOO_PATCH_VER} ]]; then
- SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV:?}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER:?}-patches.tar.xz"
-fi
-
-S=${WORKDIR}/${MY_P}
-
-LICENSE="GPL-3+"
-SLOT="0"
-if (( PLEVEL >= 0 )); then
- KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
-fi
-IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
-
-DEPEND="
- >=sys-libs/ncurses-5.2-r2:=
- nls? ( virtual/libintl )
-"
-if (( PLEVEL >= 0 )); then
- DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
-fi
-RDEPEND="
- ${DEPEND}
-"
-# We only need bison (yacc) when the .y files get patched (bash42-005, bash51-011).
-BDEPEND="
- pgo? ( dev-util/gperf )
- verify-sig? ( sec-keys/openpgp-keys-chetramey )
-"
-
-# EAPI 8 tries to append it but it doesn't exist here.
-QA_CONFIGURE_OPTIONS="--disable-static"
-
-PATCHES=(
- #"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
-
- # Patches to or from Chet, posted to the bug-bash mailing list.
- "${FILESDIR}/${PN}-5.0-syslog-history-extern.patch"
- "${FILESDIR}/${PN}-5.2_p15-random-ub.patch"
- "${FILESDIR}/${PN}-5.2_p15-configure-clang16.patch"
- "${FILESDIR}/${PN}-5.2_p21-wpointer-to-int.patch"
- "${FILESDIR}/${PN}-5.2_p32-memory-leaks.patch"
- "${FILESDIR}/${PN}-5.2_p32-invalid-continuation-byte-ignored-as-delimiter-1.patch"
- "${FILESDIR}/${PN}-5.2_p32-invalid-continuation-byte-ignored-as-delimiter-2.patch"
- "${FILESDIR}/${PN}-5.2_p32-erroneous-delimiter-pushback-condition.patch"
-)
-
-pkg_setup() {
- # bug #7332
- if is-flag -malign-double; then
- eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
- eerror "as it breaks LFS (struct stat64) on x86."
- die "remove -malign-double from your CFLAGS mr ricer"
- fi
-
- if use bashlogger; then
- ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
- ewarn "This will log ALL output you enter into the shell, you have been warned."
- fi
-}
-
-src_unpack() {
- local patch
-
- if [[ ${PV} == 9999 ]]; then
- git-r3_src_unpack
- else
- if use verify-sig; then
- verify-sig_verify_detached "${DISTDIR}/${MY_P}.tar.gz"{,.sig}
-
- for patch in "${MY_PATCHES[@]}"; do
- verify-sig_verify_detached "${patch}"{,.sig}
- done
- fi
-
- unpack "${MY_P}.tar.gz"
-
- if [[ ${GENTOO_PATCH_VER} ]]; then
- unpack "${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
- fi
- fi
-}
-
-src_prepare() {
- # Include official patches.
- (( PLEVEL > 0 )) && eapply -p0 "${MY_PATCHES[@]}"
-
- # Clean out local libs so we know we use system ones w/releases. The
- # touch utility is invoked for the benefit of config.status.
- if (( PLEVEL >= 0 )); then
- rm -rf lib/{readline,termcap}/* \
- && touch lib/{readline,termcap}/Makefile.in \
- && sed -i -E 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in \
- || die
- fi
-
- # Prefixify hardcoded path names. No-op for non-prefix.
- hprefixify pathnames.h.in
-
- # Avoid regenerating docs after patches, bug #407985.
- sed -i -E '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in \
- && touch -r . doc/* \
- || die
-
- # Sometimes hangs (more noticeable w/ pgo), bug #907403.
- rm tests/run-jobs || die
-
- eapply -p0 "${PATCHES[@]}"
- eapply_user
-}
-
-src_configure() {
- local -a myconf
-
- # Upstream only test with Bison and require GNUisms like YYEOF and
- # YYERRCODE. The former at least may be in POSIX soon:
- # https://www.austingroupbugs.net/view.php?id=1269.
- # configure warns on use of non-Bison but doesn't abort. The result
- # may misbehave at runtime.
- unset -v YACC
-
- # bash 5.3 drops unprototyped functions, earlier versions are
- # incompatible with C23.
- append-cflags $(test-flags-CC -std=gnu17)
-
- if tc-is-cross-compiler; then
- export CFLAGS_FOR_BUILD="${BUILD_CFLAGS} -std=gnu17"
- fi
-
- myconf=(
- --disable-profiling
-
- # Force linking with system curses ... the bundled termcap lib
- # sucks bad compared to ncurses. For the most part, ncurses
- # is here because readline needs it. But bash itself calls
- # ncurses in one or two small places :(.
- --with-curses
-
- $(use_enable mem-scramble)
- $(use_enable net net-redirections)
- $(use_enable readline)
- $(use_enable readline bang-history)
- $(use_enable readline history)
- $(use_with afs)
- $(use_with mem-scramble bash-malloc)
- )
-
- # For descriptions of these, see config-top.h.
- # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
- append-cppflags \
- -DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \
- -DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \
- -DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \
- -DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
- -DNON_INTERACTIVE_LOGIN_SHELLS \
- -DSSH_SOURCE_BASHRC \
- $(use bashlogger && echo -DSYSLOG_HISTORY)
-
- use nls || myconf+=( --disable-nls )
-
- if (( PLEVEL >= 0 )); then
- # Historically, we always used the builtin readline, but since
- # our handling of SONAME upgrades has gotten much more stable
- # in the PM (and the readline ebuild itself preserves the old
- # libs during upgrades), linking against the system copy should
- # be safe.
- # Exact cached version here doesn't really matter as long as it
- # is at least what's in the DEPEND up above.
- export ac_cv_rl_version=${READLINE_VER%%_*}
-
- # Use system readline only with released versions.
- myconf+=( --with-installed-readline=. )
- fi
-
- if use plugins; then
- append-ldflags "-Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/bash"
- else
- # Disable the plugins logic by hand since bash doesn't provide
- # a way of doing it.
- export ac_cv_func_dl{close,open,sym}=no \
- ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-
- sed -i -e '/LOCAL_LDFLAGS=/s:-rdynamic::' configure || die
- fi
-
- # bug #444070
- tc-export AR
-
- econf "${myconf[@]}"
-}
-
-src_compile() {
- local -a pgo_generate_flags pgo_use_flags
- local flag
-
- # -fprofile-partial-training because upstream notes the test suite isn't
- # super comprehensive.
- # https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
- if use pgo; then
- pgo_generate_flags=(
- -fprofile-update=atomic
- -fprofile-dir="${T}"/pgo
- -fprofile-generate="${T}"/pgo
- )
- pgo_use_flags=(
- -fprofile-use="${T}"/pgo
- -fprofile-dir="${T}"/pgo
- )
- if flag=$(test-flags-CC -fprofile-partial-training); then
- pgo_generate_flags+=( "${flag}" )
- pgo_use_flags+=( "${flag}" )
- fi
- fi
-
- emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}"
- use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" all others
-
- # Build Bash and run its tests to generate profiles.
- if (( ${#pgo_generate_flags[@]} )); then
- # Used in test suite.
- unset -v A
-
- emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" -k check
-
- if tc-is-clang; then
- llvm-profdata merge "${T}"/pgo --output="${T}"/pgo/default.profdata || die
- fi
-
- # Rebuild Bash using the profiling data we just generated.
- emake clean
- emake CFLAGS="${CFLAGS} ${pgo_use_flags[*]}"
- use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_use_flags[*]}" all others
- fi
-}
-
-src_test() {
- # Used in test suite.
- unset -v A
-
- default
-}
-
-src_install() {
- local d f
-
- default
-
- my_prefixify() {
- while read -r; do
- if [[ $REPLY == *$1* ]]; then
- REPLY=${REPLY/"/etc/"/"${EPREFIX}/etc/"}
- fi
- printf '%s\n' "${REPLY}" || ! break
- done < "$2" || die
- }
-
- dodir /bin
- mv -- "${ED}"/usr/bin/bash "${ED}"/bin/ || die
- dosym bash /bin/rbash
-
- insinto /etc/bash
- doins "${FILESDIR}"/bash_logout
- my_prefixify bashrc.d "${FILESDIR}"/bashrc-r1 | newins - bashrc
-
- insinto /etc/bash/bashrc.d
- my_prefixify DIR_COLORS "${FILESDIR}"/bashrc.d/10-gentoo-color-r2.bash | newins - 10-gentoo-color.bash
- newins "${FILESDIR}"/bashrc.d/10-gentoo-title-r2.bash 10-gentoo-title.bash
- if [[ ! ${EPREFIX} ]]; then
- doins "${FILESDIR}"/bashrc.d/15-gentoo-bashrc-check.bash
- fi
-
- insinto /etc/skel
- for f in bash{_logout,_profile,rc}; do
- newins "${FILESDIR}/skel/dot-${f}" ".${f}"
- done
-
- if use plugins; then
- exeinto "/usr/$(get_libdir)/bash"
- set -- examples/loadables/*.o
- doexe "${@%.o}"
-
- insinto /usr/include/bash-plugins
- doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
- fi
-
- if use examples; then
- for d in examples/{functions,misc,scripts,startup-files}; do
- exeinto "/usr/share/doc/${PF}/${d}"
- docinto "${d}"
- for f in "${d}"/*; do
- if [[ ${f##*/} != @(PERMISSION|*README) ]]; then
- doexe "${f}"
- else
- dodoc "${f}"
- fi
- done
- done
- fi
-
- # Install bash_builtins.1 and rbash.1.
- emake -C doc DESTDIR="${D}" install_builtins
- sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
- doman "${T}"/rbash.1
-
- newdoc CWRU/changelog ChangeLog
- dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
- if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]]; then
- mkdir -p -- "${EROOT}"/etc/bash \
- && mv -f -- "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/ \
- || die
- fi
-}
-
-pkg_postinst() {
- local IFS old_ver ver
- local -a versions
-
- # If /bin/sh does not exist, provide it.
- if [[ ! -e ${EROOT}/bin/sh ]]; then
- ln -sf -- bash "${EROOT}"/bin/sh || die
- fi
-
- read -rd '' -a versions <<<"${REPLACING_VERSIONS}"
- for ver in "${versions[@]}"; do
- if [[ ! ${old_ver} ]] || ver_test "${ver}" -lt "${old_ver}"; then
- old_ver=${ver}
- fi
- done
-
- if [[ ! $old_ver ]]; then
- :
- elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r8"; then
- return
- fi
-
- while read -r; do ewarn "${REPLY}"; done <<'EOF'
-Files under /etc/bash/bashrc.d must now have a suffix of .sh or .bash.
-
-Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the
-characteristics of the operating environment, it may contain a command to set
-the terminal's window title. Those who were already choosing to customise the
-PROMPT_COMMAND variable are now advised to append their commands like so:
-
-PROMPT_COMMAND+=('custom command goes here')
-
-Gentoo no longer defaults to having bash set the window title in the case
-that the terminal is controlled by sshd(8), unless screen is launched on the
-remote side or the terminal reliably supports saving and restoring the title
-(as alacritty, foot and tmux do). Those wanting for the title to be set
-regardless may adjust ~/.bashrc - or create a custom /etc/bash/bashrc.d
-drop-in - to set PROMPT_COMMMAND like so:
-
-PROMPT_COMMAND=(genfun_set_win_title)
-
-Those who would prefer for bash never to interfere with the window title may
-now opt out of the default title setting behaviour, either with the "unset -v
-PROMPT_COMMAND" command or by re-defining PROMPT_COMMAND as desired.
-EOF
-}
diff --git a/app-shells/bash/bash-5.4_alpha_pre20250822.ebuild b/app-shells/bash/bash-5.4_alpha_pre20250822.ebuild
deleted file mode 100644
index c255328c6eab..000000000000
--- a/app-shells/bash/bash-5.4_alpha_pre20250822.ebuild
+++ /dev/null
@@ -1,410 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/chetramey.asc
-inherit flag-o-matic toolchain-funcs prefix verify-sig
-
-# Uncomment if we have a patchset.
-#GENTOO_PATCH_DEV="sam"
-#GENTOO_PATCH_VER="${PV}"
-
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-MY_PATCHES=()
-
-# Determine the patchlevel.
-case ${PV} in
- 9999|*_alpha*|*_beta*|*_rc*)
- # Set a negative patchlevel to indicate that it's a pre-release.
- PLEVEL=-1
- ;;
- *_p*)
- PLEVEL=${PV##*_p}
- ;;
- *)
- PLEVEL=0
- ;;
-esac
-
-# The version of readline this bash normally ships with. Note that we only use
-# the bundled copy of readline for pre-releases.
-READLINE_VER="8.3"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
-
-if [[ ${PV} == 9999 ]]; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
- EGIT_BRANCH=devel
- inherit git-r3
-elif (( PLEVEL < 0 )) && [[ ${PV} == *_p* ]] ; then
- # It can be useful to have snapshots in the pre-release period once
- # the first alpha is out, as various bugs get reported and fixed from
- # the alpha, and the next pre-release is usually quite far away.
- #
- # i.e. if it's worth packaging the alpha, it's worth packaging a followup.
- BASH_COMMIT="ab17ddb7af948ee6e1a6370aac4ee57b4179cd9c"
- SRC_URI="https://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-${BASH_COMMIT}.tar.gz -> ${P}-${BASH_COMMIT}.tar.gz"
- S=${WORKDIR}/${PN}-${BASH_COMMIT}
-else
- my_urls=( "mirror://gnu/bash/${MY_P}.tar.gz" )
-
- # bash-5.1 -> bash51
- my_p=${PN}$(ver_cut 1-2) my_p=${my_p/.}
-
- for (( my_patch_idx = 1; my_patch_idx <= PLEVEL; my_patch_idx++ )); do
- printf -v my_patch_ver %s-%03d "${my_p}" "${my_patch_idx}"
- my_urls+=( "mirror://gnu/bash/${MY_P}-patches/${my_patch_ver}" )
- MY_PATCHES+=( "${DISTDIR}/${my_patch_ver}" )
- done
-
- SRC_URI="${my_urls[*]} verify-sig? ( ${my_urls[*]/%/.sig} )"
- S=${WORKDIR}/${MY_P}
-
- unset -v my_urls my_p my_patch_idx my_patch_ver
-fi
-
-if [[ ${GENTOO_PATCH_VER} ]]; then
- SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV:?}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER:?}-patches.tar.xz"
-fi
-
-LICENSE="GPL-3+"
-SLOT="0"
-if (( PLEVEL >= 0 )); then
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
-fi
-IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
-
-DEPEND="
- >=sys-libs/ncurses-5.2-r2:=
- nls? ( virtual/libintl )
-"
-if (( PLEVEL >= 0 )); then
- DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
-fi
-RDEPEND="
- ${DEPEND}
-"
-# We only need bison (yacc) when the .y files get patched (bash42-005, bash51-011).
-BDEPEND="
- pgo? ( dev-util/gperf )
- verify-sig? ( sec-keys/openpgp-keys-chetramey )
-"
-
-# EAPI 8 tries to append it but it doesn't exist here.
-QA_CONFIGURE_OPTIONS="--disable-static"
-
-PATCHES=(
- #"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
-
- # Patches to or from Chet, posted to the bug-bash mailing list.
- "${FILESDIR}/${PN}-5.0-syslog-history-extern.patch"
-)
-
-pkg_setup() {
- # bug #7332
- if is-flag -malign-double; then
- eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
- eerror "as it breaks LFS (struct stat64) on x86."
- die "remove -malign-double from your CFLAGS mr ricer"
- fi
-
- if use bashlogger; then
- ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
- ewarn "This will log ALL output you enter into the shell, you have been warned."
- fi
-}
-
-src_unpack() {
- local patch
-
- if [[ ${PV} == 9999 ]]; then
- git-r3_src_unpack
- elif (( PLEVEL < 0 )) && [[ ${PV} == *_p* ]] ; then
- default
- else
- if use verify-sig; then
- verify-sig_verify_detached "${DISTDIR}/${MY_P}.tar.gz"{,.sig}
-
- for patch in "${MY_PATCHES[@]}"; do
- verify-sig_verify_detached "${patch}"{,.sig}
- done
- fi
-
- unpack "${MY_P}.tar.gz"
-
- if [[ ${GENTOO_PATCH_VER} ]]; then
- unpack "${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
- fi
- fi
-}
-
-src_prepare() {
- # Include official patches.
- (( PLEVEL > 0 )) && eapply -p0 "${MY_PATCHES[@]}"
-
- # Prefixify hardcoded path names. No-op for non-prefix.
- hprefixify pathnames.h.in
-
- # Avoid regenerating docs after patches, bug #407985.
- sed -i -E '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in \
- && touch -r . doc/* \
- || die
-
- # Sometimes hangs (more noticeable w/ pgo), bug #907403.
- rm tests/run-jobs || die
-
- eapply -p0 "${PATCHES[@]}"
- eapply_user
-}
-
-src_configure() {
- local -a myconf
-
- # Upstream only test with Bison and require GNUisms like YYEOF and
- # YYERRCODE. The former at least may be in POSIX soon:
- # https://www.austingroupbugs.net/view.php?id=1269.
- # configure warns on use of non-Bison but doesn't abort. The result
- # may misbehave at runtime.
- unset -v YACC
-
- if tc-is-cross-compiler; then
- export CFLAGS_FOR_BUILD="${BUILD_CFLAGS} -std=gnu17"
- fi
-
- myconf=(
- --disable-profiling
-
- # Force linking with system curses ... the bundled termcap lib
- # sucks bad compared to ncurses. For the most part, ncurses
- # is here because readline needs it. But bash itself calls
- # ncurses in one or two small places :(.
- --with-curses
-
- $(use_enable mem-scramble)
- $(use_enable net net-redirections)
- $(use_enable readline)
- $(use_enable readline bang-history)
- $(use_enable readline history)
- $(use_with afs)
- $(use_with mem-scramble bash-malloc)
- )
-
- # For descriptions of these, see config-top.h.
- # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
- append-cppflags \
- -DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \
- -DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \
- -DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \
- -DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
- -DNON_INTERACTIVE_LOGIN_SHELLS \
- -DSSH_SOURCE_BASHRC \
- $(use bashlogger && echo -DSYSLOG_HISTORY)
-
- use nls || myconf+=( --disable-nls )
-
- if (( PLEVEL >= 0 )); then
- # Historically, we always used the builtin readline, but since
- # our handling of SONAME upgrades has gotten much more stable
- # in the PM (and the readline ebuild itself preserves the old
- # libs during upgrades), linking against the system copy should
- # be safe.
- # Exact cached version here doesn't really matter as long as it
- # is at least what's in the DEPEND up above.
- export ac_cv_rl_version=${READLINE_VER%%_*}
-
- # Use system readline only with released versions.
- myconf+=( --with-installed-readline=. )
- fi
-
- if use plugins; then
- append-ldflags "-Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/bash"
- else
- # Disable the plugins logic by hand since bash doesn't provide
- # a way of doing it.
- export ac_cv_func_dl{close,open,sym}=no \
- ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-
- sed -i -e '/LOCAL_LDFLAGS=/s:-rdynamic::' configure || die
- fi
-
- # bug #444070
- tc-export AR
-
- econf "${myconf[@]}"
-}
-
-src_compile() {
- local -a pgo_generate_flags pgo_use_flags
- local flag
-
- # -fprofile-partial-training because upstream notes the test suite isn't
- # super comprehensive.
- # https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
- if use pgo; then
- pgo_generate_flags=(
- -fprofile-update=atomic
- -fprofile-dir="${T}"/pgo
- -fprofile-generate="${T}"/pgo
- )
- pgo_use_flags=(
- -fprofile-use="${T}"/pgo
- -fprofile-dir="${T}"/pgo
- )
- if flag=$(test-flags-CC -fprofile-partial-training); then
- pgo_generate_flags+=( "${flag}" )
- pgo_use_flags+=( "${flag}" )
- fi
- fi
-
- emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}"
- use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" all others
-
- # Build Bash and run its tests to generate profiles.
- if (( ${#pgo_generate_flags[@]} )); then
- # Used in test suite.
- unset -v A
-
- emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" -k check
-
- if tc-is-clang; then
- llvm-profdata merge "${T}"/pgo --output="${T}"/pgo/default.profdata || die
- fi
-
- # Rebuild Bash using the profiling data we just generated.
- emake clean
- emake CFLAGS="${CFLAGS} ${pgo_use_flags[*]}"
- use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_use_flags[*]}" all others
- fi
-}
-
-src_test() {
- # Used in test suite.
- unset -v A
-
- default
-}
-
-src_install() {
- local d f
-
- default
-
- my_prefixify() {
- while read -r; do
- if [[ $REPLY == *$1* ]]; then
- REPLY=${REPLY/"/etc/"/"${EPREFIX}/etc/"}
- fi
- printf '%s\n' "${REPLY}" || ! break
- done < "$2" || die
- }
-
- dodir /bin
- mv -- "${ED}"/usr/bin/bash "${ED}"/bin/ || die
- dosym bash /bin/rbash
-
- insinto /etc/bash
- doins "${FILESDIR}"/bash_logout
- my_prefixify bashrc.d "${FILESDIR}"/bashrc-r1 | newins - bashrc
-
- insinto /etc/bash/bashrc.d
- my_prefixify DIR_COLORS "${FILESDIR}"/bashrc.d/10-gentoo-color-r2.bash | newins - 10-gentoo-color.bash
- newins "${FILESDIR}"/bashrc.d/10-gentoo-title-r2.bash 10-gentoo-title.bash
- if [[ ! ${EPREFIX} ]]; then
- doins "${FILESDIR}"/bashrc.d/15-gentoo-bashrc-check.bash
- fi
-
- insinto /etc/skel
- for f in bash{_logout,_profile,rc}; do
- newins "${FILESDIR}/skel/dot-${f}" ".${f}"
- done
-
- if use plugins; then
- exeinto "/usr/$(get_libdir)/bash"
- set -- examples/loadables/*.o
- doexe "${@%.o}"
-
- insinto /usr/include/bash-plugins
- doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
- fi
-
- if use examples; then
- for d in examples/{functions,misc,scripts,startup-files}; do
- exeinto "/usr/share/doc/${PF}/${d}"
- docinto "${d}"
- for f in "${d}"/*; do
- if [[ ${f##*/} != @(PERMISSION|*README) ]]; then
- doexe "${f}"
- else
- dodoc "${f}"
- fi
- done
- done
- fi
-
- # Install bash_builtins.1 and rbash.1.
- emake -C doc DESTDIR="${D}" install_builtins
- sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
- doman "${T}"/rbash.1
-
- newdoc CWRU/changelog ChangeLog
- dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
- if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]]; then
- mkdir -p -- "${EROOT}"/etc/bash \
- && mv -f -- "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/ \
- || die
- fi
-}
-
-pkg_postinst() {
- local IFS old_ver ver
- local -a versions
-
- # If /bin/sh does not exist, provide it.
- if [[ ! -e ${EROOT}/bin/sh ]]; then
- ln -sf -- bash "${EROOT}"/bin/sh || die
- fi
-
- read -rd '' -a versions <<<"${REPLACING_VERSIONS}"
- for ver in "${versions[@]}"; do
- if [[ ! ${old_ver} ]] || ver_test "${ver}" -lt "${old_ver}"; then
- old_ver=${ver}
- fi
- done
-
- if [[ ! $old_ver ]]; then
- :
- elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r8"; then
- return
- fi
-
- while read -r; do ewarn "${REPLY}"; done <<'EOF'
-Files under /etc/bash/bashrc.d must now have a suffix of .sh or .bash.
-
-Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the
-characteristics of the operating environment, it may contain a command to set
-the terminal's window title. Those who were already choosing to customise the
-PROMPT_COMMAND variable are now advised to append their commands like so:
-
-PROMPT_COMMAND+=('custom command goes here')
-
-Gentoo no longer defaults to having bash set the window title in the case
-that the terminal is controlled by sshd(8), unless screen is launched on the
-remote side or the terminal reliably supports saving and restoring the title
-(as alacritty, foot and tmux do). Those wanting for the title to be set
-regardless may adjust ~/.bashrc - or create a custom /etc/bash/bashrc.d
-drop-in - to set PROMPT_COMMMAND like so:
-
-PROMPT_COMMAND=(genfun_set_win_title)
-
-Those who would prefer for bash never to interfere with the window title may
-now opt out of the default title setting behaviour, either with the "unset -v
-PROMPT_COMMAND" command or by re-defining PROMPT_COMMAND as desired.
-EOF
-}
diff --git a/app-shells/bash/bash-5.4_alpha_pre20250904-r1.ebuild b/app-shells/bash/bash-5.4_alpha_pre20250904-r1.ebuild
deleted file mode 100644
index df5d6f6d400d..000000000000
--- a/app-shells/bash/bash-5.4_alpha_pre20250904-r1.ebuild
+++ /dev/null
@@ -1,411 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/chetramey.asc
-inherit flag-o-matic toolchain-funcs prefix verify-sig
-
-# Uncomment if we have a patchset.
-#GENTOO_PATCH_DEV="sam"
-#GENTOO_PATCH_VER="${PV}"
-
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-MY_PATCHES=()
-
-# Determine the patchlevel.
-case ${PV} in
- 9999|*_alpha*|*_beta*|*_rc*)
- # Set a negative patchlevel to indicate that it's a pre-release.
- PLEVEL=-1
- ;;
- *_p*)
- PLEVEL=${PV##*_p}
- ;;
- *)
- PLEVEL=0
- ;;
-esac
-
-# The version of readline this bash normally ships with. Note that we only use
-# the bundled copy of readline for pre-releases.
-READLINE_VER="8.3"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
-
-if [[ ${PV} == 9999 ]]; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
- EGIT_BRANCH=devel
- inherit git-r3
-elif (( PLEVEL < 0 )) && [[ ${PV} == *_p* ]] ; then
- # It can be useful to have snapshots in the pre-release period once
- # the first alpha is out, as various bugs get reported and fixed from
- # the alpha, and the next pre-release is usually quite far away.
- #
- # i.e. if it's worth packaging the alpha, it's worth packaging a followup.
- BASH_COMMIT="a451bfc3f57201bc0933b62c2fb721940a4c33f5"
- SRC_URI="https://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-${BASH_COMMIT}.tar.gz -> ${P}-${BASH_COMMIT}.tar.gz"
- S=${WORKDIR}/${PN}-${BASH_COMMIT}
-else
- my_urls=( "mirror://gnu/bash/${MY_P}.tar.gz" )
-
- # bash-5.1 -> bash51
- my_p=${PN}$(ver_cut 1-2) my_p=${my_p/.}
-
- for (( my_patch_idx = 1; my_patch_idx <= PLEVEL; my_patch_idx++ )); do
- printf -v my_patch_ver %s-%03d "${my_p}" "${my_patch_idx}"
- my_urls+=( "mirror://gnu/bash/${MY_P}-patches/${my_patch_ver}" )
- MY_PATCHES+=( "${DISTDIR}/${my_patch_ver}" )
- done
-
- SRC_URI="${my_urls[*]} verify-sig? ( ${my_urls[*]/%/.sig} )"
- S=${WORKDIR}/${MY_P}
-
- unset -v my_urls my_p my_patch_idx my_patch_ver
-fi
-
-if [[ ${GENTOO_PATCH_VER} ]]; then
- SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV:?}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER:?}-patches.tar.xz"
-fi
-
-LICENSE="GPL-3+"
-SLOT="0"
-if (( PLEVEL >= 0 )); then
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
-fi
-IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
-
-DEPEND="
- >=sys-libs/ncurses-5.2-r2:=
- nls? ( virtual/libintl )
-"
-if (( PLEVEL >= 0 )); then
- DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
-fi
-RDEPEND="
- ${DEPEND}
-"
-# We only need bison (yacc) when the .y files get patched (bash42-005, bash51-011).
-BDEPEND="
- pgo? ( dev-util/gperf )
- verify-sig? ( sec-keys/openpgp-keys-chetramey )
-"
-
-# EAPI 8 tries to append it but it doesn't exist here.
-QA_CONFIGURE_OPTIONS="--disable-static"
-
-PATCHES=(
- #"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
-
- # Patches to or from Chet, posted to the bug-bash mailing list.
- "${FILESDIR}/${PN}-5.0-syslog-history-extern.patch"
-)
-
-pkg_setup() {
- # bug #7332
- if is-flag -malign-double; then
- eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
- eerror "as it breaks LFS (struct stat64) on x86."
- die "remove -malign-double from your CFLAGS mr ricer"
- fi
-
- if use bashlogger; then
- ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
- ewarn "This will log ALL output you enter into the shell, you have been warned."
- fi
-}
-
-src_unpack() {
- local patch
-
- if [[ ${PV} == 9999 ]]; then
- git-r3_src_unpack
- elif (( PLEVEL < 0 )) && [[ ${PV} == *_p* ]] ; then
- default
- else
- if use verify-sig; then
- verify-sig_verify_detached "${DISTDIR}/${MY_P}.tar.gz"{,.sig}
-
- for patch in "${MY_PATCHES[@]}"; do
- verify-sig_verify_detached "${patch}"{,.sig}
- done
- fi
-
- unpack "${MY_P}.tar.gz"
-
- if [[ ${GENTOO_PATCH_VER} ]]; then
- unpack "${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
- fi
- fi
-}
-
-src_prepare() {
- # Include official patches.
- (( PLEVEL > 0 )) && eapply -p0 "${MY_PATCHES[@]}"
-
- # Prefixify hardcoded path names. No-op for non-prefix.
- hprefixify pathnames.h.in
-
- # Avoid regenerating docs after patches, bug #407985.
- sed -i -E '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in \
- && touch -r . doc/* \
- || die
-
- # Sometimes hangs (more noticeable w/ pgo), bug #907403.
- rm tests/run-jobs || die
-
- eapply -p0 "${PATCHES[@]}"
- eapply_user
-}
-
-src_configure() {
- local -a myconf
-
- # Upstream only test with Bison and require GNUisms like YYEOF and
- # YYERRCODE. The former at least may be in POSIX soon:
- # https://www.austingroupbugs.net/view.php?id=1269.
- # configure warns on use of non-Bison but doesn't abort. The result
- # may misbehave at runtime.
- unset -v YACC
-
- if tc-is-cross-compiler; then
- export CFLAGS_FOR_BUILD="${BUILD_CFLAGS} -std=gnu17"
- fi
-
- myconf=(
- --disable-profiling
-
- # Force linking with system curses ... the bundled termcap lib
- # sucks bad compared to ncurses. For the most part, ncurses
- # is here because readline needs it. But bash itself calls
- # ncurses in one or two small places :(.
- --with-curses
-
- $(use_enable mem-scramble)
- $(use_enable net net-redirections)
- $(use_enable readline)
- $(use_enable readline bang-history)
- $(use_enable readline history)
- $(use_with afs)
- $(use_with mem-scramble bash-malloc)
- )
-
- # For descriptions of these, see config-top.h.
- # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
- append-cppflags \
- -DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \
- -DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \
- -DDEFAULT_LOADABLE_BUILTINS_PATH=\'\""${EPREFIX}"/usr/local/$(get_libdir)/bash:"${EPREFIX}"/usr/$(get_libdir)/bash\"\' \
- -DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \
- -DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
- -DNON_INTERACTIVE_LOGIN_SHELLS \
- -DSSH_SOURCE_BASHRC \
- $(use bashlogger && echo -DSYSLOG_HISTORY)
-
- use nls || myconf+=( --disable-nls )
-
- if (( PLEVEL >= 0 )); then
- # Historically, we always used the builtin readline, but since
- # our handling of SONAME upgrades has gotten much more stable
- # in the PM (and the readline ebuild itself preserves the old
- # libs during upgrades), linking against the system copy should
- # be safe.
- # Exact cached version here doesn't really matter as long as it
- # is at least what's in the DEPEND up above.
- export ac_cv_rl_version=${READLINE_VER%%_*}
-
- # Use system readline only with released versions.
- myconf+=( --with-installed-readline=. )
- fi
-
- if use plugins; then
- append-ldflags "-Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/bash"
- else
- # Disable the plugins logic by hand since bash doesn't provide
- # a way of doing it.
- export ac_cv_func_dl{close,open,sym}=no \
- ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-
- sed -i -e '/LOCAL_LDFLAGS=/s:-rdynamic::' configure || die
- fi
-
- # bug #444070
- tc-export AR
-
- econf "${myconf[@]}"
-}
-
-src_compile() {
- local -a pgo_generate_flags pgo_use_flags
- local flag
-
- # -fprofile-partial-training because upstream notes the test suite isn't
- # super comprehensive.
- # https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
- if use pgo; then
- pgo_generate_flags=(
- -fprofile-update=atomic
- -fprofile-dir="${T}"/pgo
- -fprofile-generate="${T}"/pgo
- )
- pgo_use_flags=(
- -fprofile-use="${T}"/pgo
- -fprofile-dir="${T}"/pgo
- )
- if flag=$(test-flags-CC -fprofile-partial-training); then
- pgo_generate_flags+=( "${flag}" )
- pgo_use_flags+=( "${flag}" )
- fi
- fi
-
- emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}"
- use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" all others
-
- # Build Bash and run its tests to generate profiles.
- if (( ${#pgo_generate_flags[@]} )); then
- # Used in test suite.
- unset -v A
-
- emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" -k check
-
- if tc-is-clang; then
- llvm-profdata merge "${T}"/pgo --output="${T}"/pgo/default.profdata || die
- fi
-
- # Rebuild Bash using the profiling data we just generated.
- emake clean
- emake CFLAGS="${CFLAGS} ${pgo_use_flags[*]}"
- use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_use_flags[*]}" all others
- fi
-}
-
-src_test() {
- # Used in test suite.
- unset -v A
-
- default
-}
-
-src_install() {
- local d f
-
- default
-
- my_prefixify() {
- while read -r; do
- if [[ $REPLY == *$1* ]]; then
- REPLY=${REPLY/"/etc/"/"${EPREFIX}/etc/"}
- fi
- printf '%s\n' "${REPLY}" || ! break
- done < "$2" || die
- }
-
- dodir /bin
- mv -- "${ED}"/usr/bin/bash "${ED}"/bin/ || die
- dosym bash /bin/rbash
-
- insinto /etc/bash
- doins "${FILESDIR}"/bash_logout
- my_prefixify bashrc.d "${FILESDIR}"/bashrc-r1 | newins - bashrc
-
- insinto /etc/bash/bashrc.d
- my_prefixify DIR_COLORS "${FILESDIR}"/bashrc.d/10-gentoo-color-r2.bash | newins - 10-gentoo-color.bash
- newins "${FILESDIR}"/bashrc.d/10-gentoo-title-r2.bash 10-gentoo-title.bash
- if [[ ! ${EPREFIX} ]]; then
- doins "${FILESDIR}"/bashrc.d/15-gentoo-bashrc-check.bash
- fi
-
- insinto /etc/skel
- for f in bash{_logout,_profile,rc}; do
- newins "${FILESDIR}/skel/dot-${f}" ".${f}"
- done
-
- if use plugins; then
- exeinto "/usr/$(get_libdir)/bash"
- set -- examples/loadables/*.o
- doexe "${@%.o}"
-
- insinto /usr/include/bash-plugins
- doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
- fi
-
- if use examples; then
- for d in examples/{functions,misc,scripts,startup-files}; do
- exeinto "/usr/share/doc/${PF}/${d}"
- docinto "${d}"
- for f in "${d}"/*; do
- if [[ ${f##*/} != @(PERMISSION|*README) ]]; then
- doexe "${f}"
- else
- dodoc "${f}"
- fi
- done
- done
- fi
-
- # Install bash_builtins.1 and rbash.1.
- emake -C doc DESTDIR="${D}" install_builtins
- sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
- doman "${T}"/rbash.1
-
- newdoc CWRU/changelog ChangeLog
- dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
- if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]]; then
- mkdir -p -- "${EROOT}"/etc/bash \
- && mv -f -- "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/ \
- || die
- fi
-}
-
-pkg_postinst() {
- local IFS old_ver ver
- local -a versions
-
- # If /bin/sh does not exist, provide it.
- if [[ ! -e ${EROOT}/bin/sh ]]; then
- ln -sf -- bash "${EROOT}"/bin/sh || die
- fi
-
- read -rd '' -a versions <<<"${REPLACING_VERSIONS}"
- for ver in "${versions[@]}"; do
- if [[ ! ${old_ver} ]] || ver_test "${ver}" -lt "${old_ver}"; then
- old_ver=${ver}
- fi
- done
-
- if [[ ! $old_ver ]]; then
- :
- elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r8"; then
- return
- fi
-
- while read -r; do ewarn "${REPLY}"; done <<'EOF'
-Files under /etc/bash/bashrc.d must now have a suffix of .sh or .bash.
-
-Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the
-characteristics of the operating environment, it may contain a command to set
-the terminal's window title. Those who were already choosing to customise the
-PROMPT_COMMAND variable are now advised to append their commands like so:
-
-PROMPT_COMMAND+=('custom command goes here')
-
-Gentoo no longer defaults to having bash set the window title in the case
-that the terminal is controlled by sshd(8), unless screen is launched on the
-remote side or the terminal reliably supports saving and restoring the title
-(as alacritty, foot and tmux do). Those wanting for the title to be set
-regardless may adjust ~/.bashrc - or create a custom /etc/bash/bashrc.d
-drop-in - to set PROMPT_COMMMAND like so:
-
-PROMPT_COMMAND=(genfun_set_win_title)
-
-Those who would prefer for bash never to interfere with the window title may
-now opt out of the default title setting behaviour, either with the "unset -v
-PROMPT_COMMAND" command or by re-defining PROMPT_COMMAND as desired.
-EOF
-}
diff --git a/app-shells/bash/bash-5.4_alpha_pre20250904.ebuild b/app-shells/bash/bash-5.4_alpha_pre20250904.ebuild
deleted file mode 100644
index df5d6f6d400d..000000000000
--- a/app-shells/bash/bash-5.4_alpha_pre20250904.ebuild
+++ /dev/null
@@ -1,411 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/chetramey.asc
-inherit flag-o-matic toolchain-funcs prefix verify-sig
-
-# Uncomment if we have a patchset.
-#GENTOO_PATCH_DEV="sam"
-#GENTOO_PATCH_VER="${PV}"
-
-MY_PV=${PV/_p*}
-MY_PV=${MY_PV/_/-}
-MY_P=${PN}-${MY_PV}
-MY_PATCHES=()
-
-# Determine the patchlevel.
-case ${PV} in
- 9999|*_alpha*|*_beta*|*_rc*)
- # Set a negative patchlevel to indicate that it's a pre-release.
- PLEVEL=-1
- ;;
- *_p*)
- PLEVEL=${PV##*_p}
- ;;
- *)
- PLEVEL=0
- ;;
-esac
-
-# The version of readline this bash normally ships with. Note that we only use
-# the bundled copy of readline for pre-releases.
-READLINE_VER="8.3"
-
-DESCRIPTION="The standard GNU Bourne again shell"
-HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
-
-if [[ ${PV} == 9999 ]]; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
- EGIT_BRANCH=devel
- inherit git-r3
-elif (( PLEVEL < 0 )) && [[ ${PV} == *_p* ]] ; then
- # It can be useful to have snapshots in the pre-release period once
- # the first alpha is out, as various bugs get reported and fixed from
- # the alpha, and the next pre-release is usually quite far away.
- #
- # i.e. if it's worth packaging the alpha, it's worth packaging a followup.
- BASH_COMMIT="a451bfc3f57201bc0933b62c2fb721940a4c33f5"
- SRC_URI="https://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-${BASH_COMMIT}.tar.gz -> ${P}-${BASH_COMMIT}.tar.gz"
- S=${WORKDIR}/${PN}-${BASH_COMMIT}
-else
- my_urls=( "mirror://gnu/bash/${MY_P}.tar.gz" )
-
- # bash-5.1 -> bash51
- my_p=${PN}$(ver_cut 1-2) my_p=${my_p/.}
-
- for (( my_patch_idx = 1; my_patch_idx <= PLEVEL; my_patch_idx++ )); do
- printf -v my_patch_ver %s-%03d "${my_p}" "${my_patch_idx}"
- my_urls+=( "mirror://gnu/bash/${MY_P}-patches/${my_patch_ver}" )
- MY_PATCHES+=( "${DISTDIR}/${my_patch_ver}" )
- done
-
- SRC_URI="${my_urls[*]} verify-sig? ( ${my_urls[*]/%/.sig} )"
- S=${WORKDIR}/${MY_P}
-
- unset -v my_urls my_p my_patch_idx my_patch_ver
-fi
-
-if [[ ${GENTOO_PATCH_VER} ]]; then
- SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV:?}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER:?}-patches.tar.xz"
-fi
-
-LICENSE="GPL-3+"
-SLOT="0"
-if (( PLEVEL >= 0 )); then
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
-fi
-IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
-
-DEPEND="
- >=sys-libs/ncurses-5.2-r2:=
- nls? ( virtual/libintl )
-"
-if (( PLEVEL >= 0 )); then
- DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
-fi
-RDEPEND="
- ${DEPEND}
-"
-# We only need bison (yacc) when the .y files get patched (bash42-005, bash51-011).
-BDEPEND="
- pgo? ( dev-util/gperf )
- verify-sig? ( sec-keys/openpgp-keys-chetramey )
-"
-
-# EAPI 8 tries to append it but it doesn't exist here.
-QA_CONFIGURE_OPTIONS="--disable-static"
-
-PATCHES=(
- #"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
-
- # Patches to or from Chet, posted to the bug-bash mailing list.
- "${FILESDIR}/${PN}-5.0-syslog-history-extern.patch"
-)
-
-pkg_setup() {
- # bug #7332
- if is-flag -malign-double; then
- eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
- eerror "as it breaks LFS (struct stat64) on x86."
- die "remove -malign-double from your CFLAGS mr ricer"
- fi
-
- if use bashlogger; then
- ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
- ewarn "This will log ALL output you enter into the shell, you have been warned."
- fi
-}
-
-src_unpack() {
- local patch
-
- if [[ ${PV} == 9999 ]]; then
- git-r3_src_unpack
- elif (( PLEVEL < 0 )) && [[ ${PV} == *_p* ]] ; then
- default
- else
- if use verify-sig; then
- verify-sig_verify_detached "${DISTDIR}/${MY_P}.tar.gz"{,.sig}
-
- for patch in "${MY_PATCHES[@]}"; do
- verify-sig_verify_detached "${patch}"{,.sig}
- done
- fi
-
- unpack "${MY_P}.tar.gz"
-
- if [[ ${GENTOO_PATCH_VER} ]]; then
- unpack "${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
- fi
- fi
-}
-
-src_prepare() {
- # Include official patches.
- (( PLEVEL > 0 )) && eapply -p0 "${MY_PATCHES[@]}"
-
- # Prefixify hardcoded path names. No-op for non-prefix.
- hprefixify pathnames.h.in
-
- # Avoid regenerating docs after patches, bug #407985.
- sed -i -E '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in \
- && touch -r . doc/* \
- || die
-
- # Sometimes hangs (more noticeable w/ pgo), bug #907403.
- rm tests/run-jobs || die
-
- eapply -p0 "${PATCHES[@]}"
- eapply_user
-}
-
-src_configure() {
- local -a myconf
-
- # Upstream only test with Bison and require GNUisms like YYEOF and
- # YYERRCODE. The former at least may be in POSIX soon:
- # https://www.austingroupbugs.net/view.php?id=1269.
- # configure warns on use of non-Bison but doesn't abort. The result
- # may misbehave at runtime.
- unset -v YACC
-
- if tc-is-cross-compiler; then
- export CFLAGS_FOR_BUILD="${BUILD_CFLAGS} -std=gnu17"
- fi
-
- myconf=(
- --disable-profiling
-
- # Force linking with system curses ... the bundled termcap lib
- # sucks bad compared to ncurses. For the most part, ncurses
- # is here because readline needs it. But bash itself calls
- # ncurses in one or two small places :(.
- --with-curses
-
- $(use_enable mem-scramble)
- $(use_enable net net-redirections)
- $(use_enable readline)
- $(use_enable readline bang-history)
- $(use_enable readline history)
- $(use_with afs)
- $(use_with mem-scramble bash-malloc)
- )
-
- # For descriptions of these, see config-top.h.
- # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
- append-cppflags \
- -DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \
- -DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \
- -DDEFAULT_LOADABLE_BUILTINS_PATH=\'\""${EPREFIX}"/usr/local/$(get_libdir)/bash:"${EPREFIX}"/usr/$(get_libdir)/bash\"\' \
- -DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \
- -DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
- -DNON_INTERACTIVE_LOGIN_SHELLS \
- -DSSH_SOURCE_BASHRC \
- $(use bashlogger && echo -DSYSLOG_HISTORY)
-
- use nls || myconf+=( --disable-nls )
-
- if (( PLEVEL >= 0 )); then
- # Historically, we always used the builtin readline, but since
- # our handling of SONAME upgrades has gotten much more stable
- # in the PM (and the readline ebuild itself preserves the old
- # libs during upgrades), linking against the system copy should
- # be safe.
- # Exact cached version here doesn't really matter as long as it
- # is at least what's in the DEPEND up above.
- export ac_cv_rl_version=${READLINE_VER%%_*}
-
- # Use system readline only with released versions.
- myconf+=( --with-installed-readline=. )
- fi
-
- if use plugins; then
- append-ldflags "-Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/bash"
- else
- # Disable the plugins logic by hand since bash doesn't provide
- # a way of doing it.
- export ac_cv_func_dl{close,open,sym}=no \
- ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
-
- sed -i -e '/LOCAL_LDFLAGS=/s:-rdynamic::' configure || die
- fi
-
- # bug #444070
- tc-export AR
-
- econf "${myconf[@]}"
-}
-
-src_compile() {
- local -a pgo_generate_flags pgo_use_flags
- local flag
-
- # -fprofile-partial-training because upstream notes the test suite isn't
- # super comprehensive.
- # https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
- if use pgo; then
- pgo_generate_flags=(
- -fprofile-update=atomic
- -fprofile-dir="${T}"/pgo
- -fprofile-generate="${T}"/pgo
- )
- pgo_use_flags=(
- -fprofile-use="${T}"/pgo
- -fprofile-dir="${T}"/pgo
- )
- if flag=$(test-flags-CC -fprofile-partial-training); then
- pgo_generate_flags+=( "${flag}" )
- pgo_use_flags+=( "${flag}" )
- fi
- fi
-
- emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}"
- use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" all others
-
- # Build Bash and run its tests to generate profiles.
- if (( ${#pgo_generate_flags[@]} )); then
- # Used in test suite.
- unset -v A
-
- emake CFLAGS="${CFLAGS} ${pgo_generate_flags[*]}" -k check
-
- if tc-is-clang; then
- llvm-profdata merge "${T}"/pgo --output="${T}"/pgo/default.profdata || die
- fi
-
- # Rebuild Bash using the profiling data we just generated.
- emake clean
- emake CFLAGS="${CFLAGS} ${pgo_use_flags[*]}"
- use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} ${pgo_use_flags[*]}" all others
- fi
-}
-
-src_test() {
- # Used in test suite.
- unset -v A
-
- default
-}
-
-src_install() {
- local d f
-
- default
-
- my_prefixify() {
- while read -r; do
- if [[ $REPLY == *$1* ]]; then
- REPLY=${REPLY/"/etc/"/"${EPREFIX}/etc/"}
- fi
- printf '%s\n' "${REPLY}" || ! break
- done < "$2" || die
- }
-
- dodir /bin
- mv -- "${ED}"/usr/bin/bash "${ED}"/bin/ || die
- dosym bash /bin/rbash
-
- insinto /etc/bash
- doins "${FILESDIR}"/bash_logout
- my_prefixify bashrc.d "${FILESDIR}"/bashrc-r1 | newins - bashrc
-
- insinto /etc/bash/bashrc.d
- my_prefixify DIR_COLORS "${FILESDIR}"/bashrc.d/10-gentoo-color-r2.bash | newins - 10-gentoo-color.bash
- newins "${FILESDIR}"/bashrc.d/10-gentoo-title-r2.bash 10-gentoo-title.bash
- if [[ ! ${EPREFIX} ]]; then
- doins "${FILESDIR}"/bashrc.d/15-gentoo-bashrc-check.bash
- fi
-
- insinto /etc/skel
- for f in bash{_logout,_profile,rc}; do
- newins "${FILESDIR}/skel/dot-${f}" ".${f}"
- done
-
- if use plugins; then
- exeinto "/usr/$(get_libdir)/bash"
- set -- examples/loadables/*.o
- doexe "${@%.o}"
-
- insinto /usr/include/bash-plugins
- doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
- fi
-
- if use examples; then
- for d in examples/{functions,misc,scripts,startup-files}; do
- exeinto "/usr/share/doc/${PF}/${d}"
- docinto "${d}"
- for f in "${d}"/*; do
- if [[ ${f##*/} != @(PERMISSION|*README) ]]; then
- doexe "${f}"
- else
- dodoc "${f}"
- fi
- done
- done
- fi
-
- # Install bash_builtins.1 and rbash.1.
- emake -C doc DESTDIR="${D}" install_builtins
- sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
- doman "${T}"/rbash.1
-
- newdoc CWRU/changelog ChangeLog
- dosym bash.info /usr/share/info/bashref.info
-}
-
-pkg_preinst() {
- if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]]; then
- mkdir -p -- "${EROOT}"/etc/bash \
- && mv -f -- "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/ \
- || die
- fi
-}
-
-pkg_postinst() {
- local IFS old_ver ver
- local -a versions
-
- # If /bin/sh does not exist, provide it.
- if [[ ! -e ${EROOT}/bin/sh ]]; then
- ln -sf -- bash "${EROOT}"/bin/sh || die
- fi
-
- read -rd '' -a versions <<<"${REPLACING_VERSIONS}"
- for ver in "${versions[@]}"; do
- if [[ ! ${old_ver} ]] || ver_test "${ver}" -lt "${old_ver}"; then
- old_ver=${ver}
- fi
- done
-
- if [[ ! $old_ver ]]; then
- :
- elif ver_test "$old_ver" -ge "5.2" && ver_test "$old_ver" -ge "5.2_p26-r8"; then
- return
- fi
-
- while read -r; do ewarn "${REPLY}"; done <<'EOF'
-Files under /etc/bash/bashrc.d must now have a suffix of .sh or .bash.
-
-Gentoo now defaults to defining PROMPT_COMMAND as an array. Depending on the
-characteristics of the operating environment, it may contain a command to set
-the terminal's window title. Those who were already choosing to customise the
-PROMPT_COMMAND variable are now advised to append their commands like so:
-
-PROMPT_COMMAND+=('custom command goes here')
-
-Gentoo no longer defaults to having bash set the window title in the case
-that the terminal is controlled by sshd(8), unless screen is launched on the
-remote side or the terminal reliably supports saving and restoring the title
-(as alacritty, foot and tmux do). Those wanting for the title to be set
-regardless may adjust ~/.bashrc - or create a custom /etc/bash/bashrc.d
-drop-in - to set PROMPT_COMMMAND like so:
-
-PROMPT_COMMAND=(genfun_set_win_title)
-
-Those who would prefer for bash never to interfere with the window title may
-now opt out of the default title setting behaviour, either with the "unset -v
-PROMPT_COMMAND" command or by re-defining PROMPT_COMMAND as desired.
-EOF
-}
diff --git a/app-shells/bash/bash-5.4_alpha_pre20250918.ebuild b/app-shells/bash/bash-5.4_alpha_pre20250918-r1.ebuild
similarity index 99%
rename from app-shells/bash/bash-5.4_alpha_pre20250918.ebuild
rename to app-shells/bash/bash-5.4_alpha_pre20250918-r1.ebuild
index 3f2d6fea7893..657225a804f9 100644
--- a/app-shells/bash/bash-5.4_alpha_pre20250918.ebuild
+++ b/app-shells/bash/bash-5.4_alpha_pre20250918-r1.ebuild
@@ -314,9 +314,6 @@ src_install() {
insinto /etc/bash/bashrc.d
my_prefixify DIR_COLORS "${FILESDIR}"/bashrc.d/10-gentoo-color-r2.bash | newins - 10-gentoo-color.bash
newins "${FILESDIR}"/bashrc.d/10-gentoo-title-r2.bash 10-gentoo-title.bash
- if [[ ! ${EPREFIX} ]]; then
- doins "${FILESDIR}"/bashrc.d/15-gentoo-bashrc-check.bash
- fi
insinto /etc/skel
for f in bash{_logout,_profile,rc}; do
diff --git a/app-shells/bash/files/bashrc.d/15-gentoo-bashrc-check.bash b/app-shells/bash/files/bashrc.d/15-gentoo-bashrc-check.bash
deleted file mode 100644
index 8f2b0405c6b9..000000000000
--- a/app-shells/bash/files/bashrc.d/15-gentoo-bashrc-check.bash
+++ /dev/null
@@ -1,24 +0,0 @@
-# /etc/bash/bashrc.d/15-gentoo-bashrc-check.bash
-
-# Some users have ~/.bashrc as a copy of ${FILESDIR}/bashrc which either matches
-# exactly or is only trivially modified. Such is an improper state of affairs
-# and results in the bashrc.d drop-ins being sourced twice. Warn them that they
-# should use the skeleton file instead. This drop-in should be removed no sooner
-# than one year from the date of its introduction.
-
-if [[ -e ${TMPDIR:-/tmp}/.gentoo-bashrc-check-${EUID} || ! -f ~/.bashrc ]]; then
- return
-fi
-
-{
- if grep -qxF 'for sh in /etc/bash/bashrc.d/* ; do' -- ~/.bashrc; then
- cat >&3 <<'EOF'
-WARNING! Your ~/.bashrc file is based on an old copy of /etc/bash/bashrc, which
-is not intended for use within a home directory. Please either delete ~/.bashrc
-or replace it with a copy of /etc/skel/.bashrc before optionally customizing it
-further. Neglecting to do so may result in bash behaving unexpectedly.
-
-EOF
- fi
- touch -- "${TMPDIR:-/tmp}/.gentoo-bashrc-check-${EUID}"
-} 3>&2 2>/dev/null
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-09-30 20:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-30 20:14 [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/, app-shells/bash/files/bashrc.d/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2025-08-18 15:55 Sam James
2025-05-04 4:59 Sam James
2024-07-07 0:18 Sam James
2024-06-30 17:31 Sam James
2024-06-15 4:40 Sam James
2024-04-27 23:15 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox