1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00
systemd/units/meson-add-wants.sh
Daan De Meyer 09422f9a28 meson: Respect MESON_INSTALL_QUIET
MESON_INSTALL_QUIET is set when --quiet is passed to meson install.
Make sure we check the variable in our custom install scripts and
don't output anything if it is set.
2020-12-06 22:11:11 +00:00

35 lines
577 B
Bash
Executable File

#!/bin/sh
set -eu
unitdir="$1"
target="$2"
unit="$3"
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"