Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Add -o pipefail to bash when checking kernel version #189

Merged
merged 1 commit into from
Jul 16, 2019

Conversation

twelho
Copy link
Contributor

@twelho twelho commented Jul 16, 2019

This enables bash to return an error if any of the commands in the
pipeline fail (such as when the strings binary is missing).
Fixes #181.

This enables bash to return an error if any of the commands in the
pipeline fail (such as when the `strings` binary is missing).
@twelho
Copy link
Contributor Author

twelho commented Jul 16, 2019

FYI pipefail also works with ksh and zsh in addition to bash, so this solution is quite universal. Requiring the kernel version to be numeric or match a regexp is not a good solution in my opinion, as custom kernels can have multiple string tags in the version etc.

Copy link
Contributor

@luxas luxas left a comment

Choose a reason for hiding this comment

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

Thanks! This works equally well IMO 👍

LGTM

@luxas luxas merged commit 9bd9d55 into master Jul 16, 2019
@luxas luxas self-assigned this Jul 16, 2019
@luxas luxas added this to the v0.4.2 milestone Jul 16, 2019
@luxas luxas deleted the kernel-version-fix branch July 16, 2019 16:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Require the kernel version to be numeric
2 participants