From 3b6fd3c1dea070cb1882b8810e18a45158a356f2 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Tue, 20 Apr 2021 13:02:02 +0200 Subject: tools: shellcheck-ify most of the tool scripts --- tools/meson-make-symlink.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tools/meson-make-symlink.sh') diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh index 96f5892281..653a73b0bd 100755 --- a/tools/meson-make-symlink.sh +++ b/tools/meson-make-symlink.sh @@ -2,6 +2,9 @@ # SPDX-License-Identifier: LGPL-2.1-or-later set -eu +SOURCE="${1:?}" +TARGET="${2:?}" + if [ "${MESON_INSTALL_QUIET:-0}" = 1 ] ; then VERBOSE="" else @@ -11,9 +14,9 @@ fi # this is needed mostly because $DESTDIR is provided as a variable, # and we need to create the target directory... -mkdir -${VERBOSE}p "$(dirname "${DESTDIR:-}$2")" -if [ "$(dirname $1)" = . -o "$(dirname $1)" = .. ]; then - ln -${VERBOSE}fs -T -- "$1" "${DESTDIR:-}$2" +mkdir -${VERBOSE}p "$(dirname "${DESTDIR:-}$TARGET")" +if [ "$(dirname "$SOURCE")" = . ] || [ "$(dirname "$SOURCE")" = .. ]; then + ln -${VERBOSE}fs -T -- "$SOURCE" "${DESTDIR:-}$TARGET" else - ln -${VERBOSE}fs -T --relative -- "${DESTDIR:-}$1" "${DESTDIR:-}$2" + ln -${VERBOSE}fs -T --relative -- "${DESTDIR:-}$SOURCE" "${DESTDIR:-}$TARGET" fi -- cgit v1.2.3