Skip to content

gh-120291: Fix a bashism in python-config.sh.in #120292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Jun 9, 2024

Replace the use of bash-specific [[ ... ]] with POSIX-compliant [ ... ] to make the python-config shell script work with non-bash shells again.

Fixes #120291

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also check that the script is in sync with python-config.in as asked?

Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes python#120291
@sobolevn sobolevn merged commit 7d24471 into python:main Jun 11, 2024
27 checks passed
@miss-islington-app
Copy link

Thanks @mgorny for the PR, and @sobolevn for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 11, 2024
pythongh-120291: Fix bashisms in python-config.sh.in

Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes pythonGH-120291
(cherry picked from commit 7d24471)

Co-authored-by: Michał Górny <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Jun 11, 2024

GH-120341 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jun 11, 2024
@sobolevn
Copy link
Member

Thank you! Backport will be merged as soon as the CI will pass.

I wonder if we can use shellcheck for that in our CI. Since most people do make this mistake of mixing shell dialects quite common.

sobolevn pushed a commit that referenced this pull request Jun 11, 2024
…120341)

gh-120291: Fix a bashism in python-config.sh.in (GH-120292)

gh-120291: Fix bashisms in python-config.sh.in

Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes GH-120291
(cherry picked from commit 7d24471)

Co-authored-by: Michał Górny <[email protected]>
@mgorny mgorny deleted the fix-bashism branch June 11, 2024 13:22
@mgorny
Copy link
Contributor Author

mgorny commented Jun 11, 2024

Thanks!

mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
pythongh-120291: Fix bashisms in python-config.sh.in

Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes python#120291
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
pythongh-120291: Fix bashisms in python-config.sh.in

Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes python#120291
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
pythongh-120291: Fix bashisms in python-config.sh.in

Replace the use of bash-specific `[[ ... ]]` with POSIX-compliant
`[ ... ]` to make the `python-config` shell script work with non-bash
shells again.  While at it, use `local` in a safer way, since it is
not in POSIX either (though universally supported).

Fixes python#120291
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[3.13] shell version of python-config started using bashisms
5 participants