From 87586ac5eb66b5638a83cbb619de817b7b3d581c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 26 Mar 2026 21:02:35 +0900 Subject: [PATCH] Only use --no-same-owner with tar when supported Fix #4740 Fix #4741 --- install | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install b/install index 7eee4d8a..545c989a 100755 --- a/install +++ b/install @@ -112,10 +112,15 @@ link_fzf_in_path() { return 1 } +tar_opts="-xzf -" +if tar --no-same-owner -tf /dev/null 2> /dev/null; then + tar_opts="--no-same-owner $tar_opts" +fi + try_curl() { command -v curl > /dev/null && if [[ $1 =~ tar.gz$ ]]; then - curl -fL $1 | tar --no-same-owner -xzf - + curl -fL $1 | tar $tar_opts else local temp=${TMPDIR:-/tmp}/fzf.zip curl -fLo "$temp" $1 && unzip -o "$temp" && rm -f "$temp" @@ -125,7 +130,7 @@ try_curl() { try_wget() { command -v wget > /dev/null && if [[ $1 =~ tar.gz$ ]]; then - wget -O - $1 | tar --no-same-owner -xzf - + wget -O - $1 | tar $tar_opts else local temp=${TMPDIR:-/tmp}/fzf.zip wget -O "$temp" $1 && unzip -o "$temp" && rm -f "$temp"