]> git.ipfire.org Git - thirdparty/systemd.git/blob - units/meson-add-wants.sh
travis: turn on nonnull-attribute on Fuzzit
[thirdparty/systemd.git] / units / meson-add-wants.sh
1 #!/bin/sh
2 set -eu
3
4 unitdir="$1"
5 target="$2"
6 unit="$3"
7
8 case "$target" in
9 */?*) # a path, but not just a slash at the end
10 dir="${DESTDIR:-}${target}"
11 ;;
12 *)
13 dir="${DESTDIR:-}${unitdir}/${target}"
14 ;;
15 esac
16
17 unitpath="${DESTDIR:-}${unitdir}/${unit}"
18
19 case "$target" in
20 */)
21 mkdir -vp -m 0755 "$dir"
22 ;;
23 *)
24 mkdir -vp -m 0755 "$(dirname "$dir")"
25 ;;
26 esac
27
28 ln -vfs --relative "$unitpath" "$dir"