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 tar detection and usage on OpenBSD #545

Merged
merged 2 commits into from Dec 3, 2023
Merged

Conversation

clarkema
Copy link
Contributor

@clarkema clarkema commented Dec 3, 2023

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 in ls-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 in extract.

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.
Update the invocation of tar in `ls-files` to use `-z`, mirroring
the usage in `extract`.

GNU tar will list a gzipped tar without complaint using just
`-t -f`; OpenBSD tar will not and requires the `-z` option.
@ugexe ugexe merged commit 5420923 into ugexe:main Dec 3, 2023
1 check passed
@clarkema clarkema deleted the openbsd-tar-fix branch December 3, 2023 20:54
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