Skip to content
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

libticalcs: fix erroneous bashism in configure script #87

Merged
merged 1 commit into from Mar 29, 2024

Conversation

eli-schwartz
Copy link
Contributor

configure scripts are POSIX /bin/sh scripts and cannot have bash-specific syntax. The test xxx == yyy construct with double equals is a bash-specific alias for single equals. It does exactly the same thing as single equals -- it provides no additional functionality, no behavior changes, it is exactly the same but with an additional alternate spelling. In exchange for doing nothing, it breaks muscle memory when writing POSIX sh scripts and tricks developers into writing the wrong thing.

It should never be used under any circumstances. Ideally it would be removed altogether from GNU bash.

Bug: https://bugs.gentoo.org/723452

configure scripts are POSIX /bin/sh scripts and cannot have
bash-specific syntax. The `test xxx == yyy` construct with double equals
is a bash-specific alias for single equals. It does exactly the same
thing as single equals -- it provides no additional functionality, no
behavior changes, it is *exactly* the same but with an additional
alternate spelling. In exchange for doing nothing, it breaks muscle
memory when writing POSIX sh scripts and tricks developers into writing
the wrong thing.

It should never be used under any circumstances. Ideally it would be
removed altogether from GNU bash.

Bug: https://bugs.gentoo.org/723452
@debrouxl debrouxl merged commit 3c47cf6 into debrouxl:master Mar 29, 2024
10 checks passed
@debrouxl
Copy link
Owner

Right, thanks :)
Being a Debian user, I'm aware of the need to try and avoid superfluous bashisms, but that one slipped through... and I even copy-pasted it to tifileutil on the experimental2 branch, boo.

@eli-schwartz eli-schwartz deleted the bashism branch March 29, 2024 12:39
@eli-schwartz
Copy link
Contributor Author

I believe that Debian unfortunately still configures their dash package without LINENO support, specifically to make GNU autoconf detect it as a "crippled" shell and search for bash to see if it can re-exec using that.

Which means it's hard to actually test this on Debian. :(

gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Mar 29, 2024
 * QA Notice: Abnormal configure code
 *
 * checking for the host compiler... ./configure: 17678: test: xx86_64-pc-linux-gnu: unexpected operator

Bug: debrouxl/tilibs#87
Closes: https://bugs.gentoo.org/723452
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
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.

None yet

2 participants