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

detect the actual tar version present on the system #139

Merged
merged 2 commits into from
Mar 11, 2022

Conversation

Ptival
Copy link
Contributor

@Ptival Ptival commented Jan 27, 2022

The current script does not work on my machine because it assumes that any
machine running Darwin will also have bsdtar. I am running Darwin, but have
also installed the superior GNU tar, so the assumption does not hold.

Instead, I made it read the --version output to see if we identify either GNU
or BSD version of tar.

@Ptival Ptival requested a review from pnwamk January 27, 2022 21:40
if [[ "$OSTYPE" == "darwin"* ]]; then
TARVER=`tar --version | head -n 1`
if [[ "$TARVER" =~ "tar (GNU tar)" ]]; then
tar --overwrite -xf $TAR_FILE
Copy link
Contributor

Choose a reason for hiding this comment

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

Per our discussion elsewhere, the --overwrite flag might be better left off so this script can be rerun. (That would also match the bsdtar behavior, which uses the -k Keep (don't overwrite) existing files flag.)

Copy link
Contributor

@pnwamk pnwamk left a comment

Choose a reason for hiding this comment

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

LGTM modulo maybe removing the --overwrite flag as noted in my comment.

@Ptival Ptival force-pushed the vr/detect-actual-tar-version branch from 53223bf to 1158f3d Compare March 4, 2022 21:12
Ptival added 2 commits March 11, 2022 14:43
The current script does not work on my machine because it assumes that any
machine running Darwin will also have bsdtar.  I am running Darwin, but have
also installed the superior GNU tar, so the assumption does not hold.

Instead, I made it read the `--version` output to see if we identify either GNU
or BSD version of tar.
@Ptival Ptival force-pushed the vr/detect-actual-tar-version branch from 1158f3d to bfde034 Compare March 11, 2022 22:43
@Ptival Ptival merged commit 70074af into main Mar 11, 2022
@Ptival Ptival deleted the vr/detect-actual-tar-version branch March 11, 2022 23:36
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.

2 participants