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

fix use of locate in check_os_dependency #4166

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Jan 6, 2023

locate may not set an error exit code when it does not find a dependency so the function may wrongly succeed.
Use the -c option to get a number of matches and check that this is more than zero (and an integer) in addition to the exit code.

Fixes #4165

`locate` may not set an error exit code when it does not find a
dependency so the function may wronly succeed.
Use the `-c` option to get a number of matches and check that this is
more than zero (and an integer) in addition to the exit code.

Fixes easybuilders#4165
@boegel boegel added the bug fix label Jan 8, 2023
@boegel boegel added this to the release after 4.7.0 milestone Jan 8, 2023
@boegel boegel changed the title Fix check_os_dependency fix use of locate in check_os_dependency Jan 18, 2023
@boegel
Copy link
Member

boegel commented Jan 18, 2023

@Flamefire Can we enhance the tests for check_os_dependency to cover this bug fix?

@Flamefire
Copy link
Contributor Author

I don't think so. It depends on how the OS locate behaves (if that even is used) so we would need to mock it which IMO isn't wort the effort.

Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

lgtm

@boegel boegel merged commit e4506c1 into easybuilders:develop Feb 1, 2023
@Flamefire Flamefire deleted the fix-check-os-dep branch February 1, 2023 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

check_os_dependency wrongly succeeds using locate
2 participants