]> git.ipfire.org Git - thirdparty/systemd.git/blame - tools/meson-make-symlink.sh
tools: shellcheck-ify most of the tool scripts
[thirdparty/systemd.git] / tools / meson-make-symlink.sh
CommitLineData
7629744a 1#!/bin/sh
9ee03516 2# SPDX-License-Identifier: LGPL-2.1-or-later
7629744a 3set -eu
7b76fce1 4
3b6fd3c1
FS
5SOURCE="${1:?}"
6TARGET="${2:?}"
7
09422f9a
DDM
8if [ "${MESON_INSTALL_QUIET:-0}" = 1 ] ; then
9 VERBOSE=""
10else
11 VERBOSE="v"
12fi
13
7b76fce1
ZJS
14# this is needed mostly because $DESTDIR is provided as a variable,
15# and we need to create the target directory...
16
3b6fd3c1
FS
17mkdir -${VERBOSE}p "$(dirname "${DESTDIR:-}$TARGET")"
18if [ "$(dirname "$SOURCE")" = . ] || [ "$(dirname "$SOURCE")" = .. ]; then
19 ln -${VERBOSE}fs -T -- "$SOURCE" "${DESTDIR:-}$TARGET"
7b76fce1 20else
3b6fd3c1 21 ln -${VERBOSE}fs -T --relative -- "${DESTDIR:-}$SOURCE" "${DESTDIR:-}$TARGET"
7b76fce1 22fi