MageSlayer / paludis-gentoo-patches

Unofficial Gentoo patches for Paludis package manager
GNU General Public License v2.0
14 stars 7 forks source link

ebuild: work around bash bug related to BASH_COMPAT and shopt compat* options. #48

Closed Ionic closed 1 year ago

Ionic commented 1 year ago

Some bash versions (notably at least 5.1) reset BASH_COMPAT to the default value (for 5.1, that's 51) if a compat shell option is unset, even if it was previously unset. Normally, such a sequence should be a no-op, but due to the bug, it isn't.

Work around this by saving the ${BASH_COMPAT} value before the eval "$(shopt -p)" call and restore it if ${BASH_COMPAT} does not match the original value any longer.

Just a safe bugfix, merging right away.

Ionic commented 1 year ago

Bug report and resolution at https://lists.gnu.org/archive/html/bug-bash/2022-02/msg00121.html .