diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh index 2241fc26a2..b7f57a5e2c 100755 --- a/units/meson-add-wants.sh +++ b/units/meson-add-wants.sh @@ -1,34 +1,39 @@ #!/bin/sh set -eu -unitdir="$1" -target="$2" -unit="$3" +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 + 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 + 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}" + unitpath="${DESTDIR:-}${unitdir}/${unit}" -case "$target" in - */) - mkdir -${VERBOSE}p -m 0755 "$dir" - ;; - *) - mkdir -${VERBOSE}p -m 0755 "$(dirname "$dir")" - ;; -esac + case "$target" in + */) + mkdir -${VERBOSE}p -m 0755 "$dir" + ;; + *) + mkdir -${VERBOSE}p -m 0755 "$(dirname "$dir")" + ;; + esac -ln -${VERBOSE}fs --relative "$unitpath" "$dir" + ln -${VERBOSE}fs --relative "$unitpath" "$dir" + + i=$((i + 3)) +done diff --git a/units/meson.build b/units/meson.build index ba60eb7fc1..8b8fd1173f 100644 --- a/units/meson.build +++ b/units/meson.build @@ -247,6 +247,8 @@ m4_units = [ ['serial-getty@.service', ''], ] +add_wants = [] + foreach tuple : in_units file = tuple[0] @@ -270,7 +272,7 @@ foreach tuple : in_units if install and tuple.length() > 2 foreach target : tuple[2].split() - meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) + add_wants += [systemunitdir, target, file] endforeach endif endforeach @@ -295,7 +297,7 @@ foreach tuple : m4_units if tuple.length() > 2 and install foreach target : tuple[2].split() - meson.add_install_script('meson-add-wants.sh', systemunitdir, target, file) + add_wants += [systemunitdir, target, file] endforeach endif endforeach @@ -314,13 +316,14 @@ foreach tuple : units if tuple.length() > 2 foreach target : tuple[2].split() - meson.add_install_script( - 'meson-add-wants.sh', systemunitdir, target, file) + add_wants += [systemunitdir, target, file] endforeach endif endif endforeach +meson.add_install_script('meson-add-wants.sh', add_wants) + install_data('user-.slice.d/10-defaults.conf', install_dir : systemunitdir + '/user-.slice.d')