Update tar syntax to support OpenBSD.#2693
Merged
ljharb merged 2 commits intonvm-sh:masterfrom Dec 20, 2021
opsbob:openbsd-install
Merged
Update tar syntax to support OpenBSD.#2693ljharb merged 2 commits intonvm-sh:masterfrom opsbob:openbsd-install
ljharb merged 2 commits intonvm-sh:masterfrom
opsbob:openbsd-install
Conversation
ljharb
reviewed
Dec 19, 2021
Member
ljharb
left a comment
There was a problem hiding this comment.
This looks great! You'll also need to add nvm_extract_tarball to the nvm unload list. It'd also be ideal to add a unit test for this function - even if all it does is check that it requires 4 arguments (altho a step up from that would be overriding the PATH to point to a faked tar/gtar/xzcat and actually test that the right thing is invoked in each scenario)
ljharb
approved these changes
Dec 20, 2021
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.
This PR special-cases the archive extraction code when executed on OpenBSD. This is to workaround the use of the
-Jand--strip-componentsoptions, which OpenBSD'stardoes not support. If thexzformat archive was downloaded, it correctly callsxzcatand pipes the output totar. If not, it correctly calls thetarwith the normal compression flag. In either case, it does not append the--strip-components=1option, but rather uses the-soption to performed(1)-style basic regex replacement on the path.This is tested to execute correctly on OpenBSD 7.0 (current release as of this PR). It does not address compilation issues of the downloaded
nodesource code, as mentioned in #2134, which will likely require upstreaming of some subset of the OpenBSD-specific source patches that were developed for the OpenBSD ports build ofnode(see the OpenBSD patches for node-12.22.7 here or the implementation of binary builds for OpenBSD, but it does allow you to reach that step without error. This should, however, fully address #2660.Fixes #2660.