Make tests pass on busybox (#912)

-t option to ln is not defined under POSIX and (at least) busybox does
not implement it. Rewrite the code to use only POSIX options to ln.
This commit is contained in:
graywolf-at-work 2022-05-26 22:24:17 +00:00 committed by GitHub
parent 324dbd13cf
commit 5d391cfe9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -139,7 +139,7 @@ if [[ -f "$1" ]]; then
dest="$target/$(basename \"$1\")"
cp "$1" "$dest" && chmod +w "$dest" && touch -r "$1" "$dest"
else
ln -s -f -t "$target" "$1"
ln -sf "$1" "$target/${1##*/}"
fi
elif [[ -L "$1" && ! -d "$1" ]]; then
cp -pR "$1" "$2"

View File

@ -216,9 +216,9 @@ def _symlink_to_dir(source, target):
mkdir -p ${target}
if [[ -d $1 ]]; then
ln -s -t ${target} $1
ln -s "$1" "$target/${1##*/}"
elif [[ -f $1 ]]; then
ln -s -t ${target} $1
ln -s "$1" "$target/${1##*/}"
elif [[ -L $1 ]]; then
cp --no-target-directory $1 ${target}
else
@ -249,9 +249,9 @@ local target="$2"
mkdir -p ${target}
if [[ -d $1 ]]; then
ln -s -t ${target} $1
ln -s "$1" "$target/${1##*/}"
elif [[ -f $1 ]]; then
ln -s -t ${target} $1
ln -s "$1" "$target/${1##*/}"
elif [[ -L $1 ]]; then
cp --no-target-directory $1 ${target}
else

View File

@ -43,7 +43,7 @@ if [[ "$1" == *.pc || "$1" == *.la || "$1" == *-config || "$1" == *.mk || "$1" =
dest="$target/$(basename "$1")"
cp "$1" "$dest" && chmod +w "$dest" && touch -r "$1" "$dest"
else
ln -s -f -t "$target" "$1"
ln -sf "$1" "$target/${1##*/}"
fi
elif [[ -L "$1" && ! -d "$1" ]]; then
cp -pR "$1" "$2"