#1104049 bash-completion: bashism in /etc/profile.d/ snippet

#1104049#5
Date:
2025-04-25 00:59:56 UTC
From:
To:
/etc/profile.d/bash_completion.sh has:

if [ "x${BASH_VERSION-}" != x -a "x${PS1-}" != x -a "x${BASH_COMPLETION_VERSINFO-}" = x ]; then

This in itself is already a bashism; [(1) has no -a in POSIX.

Suggested fix (full disclosure, I’m the mksh developer, which does
have -a as an extension as well, but I know a bit about POSIX sh):

if test -n "${BASH_VERSION-}" && test -n "${PS1-}" && test -z "${BASH_COMPLETION_VERSINFO-}"; then

Thanks for fixing!

#1104049#12
Date:
2025-04-26 04:15:23 UTC
From:
To:
Dixi quod:

Policy has an extra requirement on top of POSIX that -a is supported,
but /etc/profile can be read by shells not suitable for /bin/sh in
Debian, so a fix would still be appreciated, but I don’t insist on rc
severity.

bye,
//mirabilos

#1104049#17
Date:
2025-05-14 04:02:16 UTC
From:
To:
Hi, Thorsten,

Thanks for your bug report, patch, and for the justification.

I would like to use your suggested patch, but I would like to defer it
until the release of trixie. While I don't anticipate issues, it would
be better to have it tested at the early stages of forky.

I'll decrease the severity level to non RC.