Browse Source

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.
master
Daan De Meyer 2 years ago
parent
commit
09422f9a28
  1. 12
      tools/meson-make-symlink.sh
  2. 12
      units/meson-add-wants.sh

12
tools/meson-make-symlink.sh

@ -1,12 +1,18 @@
#!/bin/sh
set -eu
if [ "${MESON_INSTALL_QUIET:-0}" = 1 ] ; then
VERBOSE=""
else
VERBOSE="v"
fi
# this is needed mostly because $DESTDIR is provided as a variable,
# and we need to create the target directory...
mkdir -vp "$(dirname "${DESTDIR:-}$2")"
mkdir -${VERBOSE}p "$(dirname "${DESTDIR:-}$2")"
if [ "$(dirname $1)" = . -o "$(dirname $1)" = .. ]; then
ln -vfs -T -- "$1" "${DESTDIR:-}$2"
ln -${VERBOSE}fs -T -- "$1" "${DESTDIR:-}$2"
else
ln -vfs -T --relative -- "${DESTDIR:-}$1" "${DESTDIR:-}$2"
ln -${VERBOSE}fs -T --relative -- "${DESTDIR:-}$1" "${DESTDIR:-}$2"
fi

12
units/meson-add-wants.sh

@ -5,6 +5,12 @@ 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}"
@ -18,11 +24,11 @@ unitpath="${DESTDIR:-}${unitdir}/${unit}"
case "$target" in
*/)
mkdir -vp -m 0755 "$dir"
mkdir -${VERBOSE}p -m 0755 "$dir"
;;
*)
mkdir -vp -m 0755 "$(dirname "$dir")"
mkdir -${VERBOSE}p -m 0755 "$(dirname "$dir")"
;;
esac
ln -vfs --relative "$unitpath" "$dir"
ln -${VERBOSE}fs --relative "$unitpath" "$dir"

Loading…
Cancel
Save