mirror of
https://github.com/systemd/systemd
synced 2024-09-06 16:56:43 +00:00
![Zbigniew Jędrzejewski-Szmek](/assets/img/avatar_default.png)
Even though many of those scripts are very simple, it is easier to include the header than to try to say whether each of those files is trivial enough not to require one.
41 lines
821 B
Bash
Executable file
41 lines
821 B
Bash
Executable file
#!/bin/sh
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
set -eu
|
|
|
|
i=1
|
|
while [ $i -lt $# ] ; do
|
|
eval unitdir="\${$i}"
|
|
eval target="\${$((i + 1))}"
|
|
eval unit="\${$((i + 2))}"
|
|
|
|
if [ "${MESON_INSTALL_QUIET:-0}" = 1 ] ; then
|
|
VERBOSE=""
|
|
else
|
|
VERBOSE="v"
|
|
fi
|
|
|
|
case "$target" in
|
|
*/?*) # a path, but not just a slash at the end
|
|
dir="${DESTDIR:-}${target}"
|
|
;;
|
|
*)
|
|
dir="${DESTDIR:-}${unitdir}/${target}"
|
|
;;
|
|
esac
|
|
|
|
unitpath="${DESTDIR:-}${unitdir}/${unit}"
|
|
|
|
case "$target" in
|
|
*/)
|
|
mkdir -${VERBOSE}p -m 0755 "$dir"
|
|
;;
|
|
*)
|
|
mkdir -${VERBOSE}p -m 0755 "$(dirname "$dir")"
|
|
;;
|
|
esac
|
|
|
|
ln -${VERBOSE}fs --relative "$unitpath" "$dir"
|
|
|
|
i=$((i + 3))
|
|
done
|