From b35701d05b15a831d8319c046203f7a70be339cb Mon Sep 17 00:00:00 2001 From: Kerin Millar Date: Sat, 15 Jun 2024 04:59:11 +0100 Subject: [PATCH 1/2] 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 Bug: https://bugs.gentoo.org/934309 Signed-off-by: Sam James --- ...p16-r10.ebuild => bash-5.1_p16-r11.ebuild} | 0 ...2_p26-r3.ebuild => bash-5.2_p26-r4.ebuild} | 0 ...pha-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(-) rename app-shells/bash/{bash-5.1_p16-r10.ebuild => bash-5.1_p16-r11.ebuild} (100%) rename app-shells/bash/{bash-5.2_p26-r3.ebuild => bash-5.2_p26-r4.ebuild} (100%) rename app-shells/bash/{bash-5.3_alpha-r2.ebuild => bash-5.3_alpha-r3.ebuild} (100%) 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 1fbf17c263276..0246d4fa36f0d 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 From 1d03c3c3f2a135377fcfcae80c85231bd77b291d Mon Sep 17 00:00:00 2001 From: Sam James Date: Sat, 15 Jun 2024 05:42:50 +0100 Subject: [PATCH 2/2] dev-libs/libgit2: Stabilize 1.8.1 arm64, #934326 Signed-off-by: Sam James --- dev-libs/libgit2/libgit2-1.8.1.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-libs/libgit2/libgit2-1.8.1.ebuild b/dev-libs/libgit2/libgit2-1.8.1.ebuild index baf3a901a1f5b..6afcecb8e0a0a 100644 --- a/dev-libs/libgit2/libgit2-1.8.1.ebuild +++ b/dev-libs/libgit2/libgit2-1.8.1.ebuild @@ -16,7 +16,7 @@ S=${WORKDIR}/${P/_/-} LICENSE="GPL-2-with-linking-exception" SLOT="0/$(ver_cut 1-2)" -KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-macos" +KEYWORDS="~amd64 ~arm arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-macos" IUSE="examples gssapi +ssh test +threads trace" RESTRICT="!test? ( test )"