Fix tar detection and usage on OpenBSD #545
Merged
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.
This address two issues with
Zef::Service::Shell::tar
on OpenBSD.The first is detecting tar in the first place.
Previously zef tried to detect tar on OpenBSD by looking for some magic words in the output of
tar
, since there's no--help
or--version
option.Currently (as of OpenBSD 7.4) running bare
tar
doesn't produce any of those magic words, so detection fails -- this is true back until at least OpenBSD 6.8.This patch changes the detection to run
tar -cf -
, which will exit silently with code 0 if tar is runnable.The second issue is a missing
-z
inls-files
; GNU tar will list a gzipped tar without complaint using just-t -f
; OpenBSD tar will not and requires the-z
option. Adding this mirrors usage inextract
.