contrib/check-config.sh: Make script POSIX#42410
Merged
thaJeztah merged 4 commits intomoby:masterfrom May 27, 2021
joakimr-axis:joakimr-axis_check-config-posix
Merged
contrib/check-config.sh: Make script POSIX#42410thaJeztah merged 4 commits intomoby:masterfrom joakimr-axis:joakimr-axis_check-config-posix
thaJeztah merged 4 commits intomoby:masterfrom
joakimr-axis:joakimr-axis_check-config-posix
Conversation
Member
On systems that do not have bash, the current bash-based check-config.sh won't run. Making check-config.sh a POSIX shell script instead makes it more portable. Signed-off-by: Joakim Roubert <joakim.roubert@axis.com>
Member
|
@tianon ptal |
tianon
reviewed
May 27, 2021
Member
tianon
left a comment
There was a problem hiding this comment.
Overall, I'm a little sad about all the nice Bash features we have to give up (esp. local and arrays that let us have long lists without \ on every line), but I agree with the goal. 😄 👍
Co-authored-by: Tianon Gravi <admwiggin@gmail.com> Signed-off-by: Joakim Roubert <joakimr@axis.com>
Co-authored-by: Tianon Gravi <admwiggin@gmail.com> Signed-off-by: Joakim Roubert <joakimr@axis.com>
Co-authored-by: Tianon Gravi <admwiggin@gmail.com> Signed-off-by: Joakim Roubert <joakimr@axis.com>
thaJeztah
approved these changes
May 27, 2021
Member
thaJeztah
left a comment
There was a problem hiding this comment.
LGTM, thanks!
tested it locally, and the world didn't explode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

- What I did
I needed to run
check-config.shon a small system that doesn't havebash. So I did the changes needed to make it a POSIX shell script and thus remove the bash dependency. Having done that for my own needs, I thought I'd share this more portable version upstreams.- How I did it
Replaced bashisms with POSIX
- How to verify it
Explicitly run
check-config.shwith a POSIX shell such as e.g.dash.- Description for the changelog
check-config.shis now a POSIX shell script (and not depending on bash).- A picture of a cute animal (not mandatory but encouraged)
