]> git.ipfire.org Git - thirdparty/systemd.git/blame - units/meson-add-wants.sh
test-string-util: add another test for stripping slashes
[thirdparty/systemd.git] / units / meson-add-wants.sh
CommitLineData
86b3ca7a 1#!/bin/sh -eu
2d9f0c68
ZJS
2
3unitdir="$1"
4target="$2"
5unit="$3"
6
7case "$target" in
b884196c
ZJS
8 */?*) # a path, but not just a slash at the end
9 dir="${DESTDIR:-}${target}"
10 ;;
11 *)
12 dir="${DESTDIR:-}${unitdir}/${target}"
13 ;;
2d9f0c68
ZJS
14esac
15
dc25d2ad 16unitpath="${DESTDIR:-}${unitdir}/${unit}"
2d9f0c68
ZJS
17
18case "$target" in
b884196c
ZJS
19 */)
20 mkdir -p -m 0755 "$dir"
21 ;;
22 *)
23 mkdir -p -m 0755 "$(basename "$dir")"
24 ;;
2d9f0c68
ZJS
25esac
26
27ln -vfs --relative "$unitpath" "$dir"