1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 15:21:37 +03:00
systemd/units/meson-add-wants.sh

29 lines
464 B
Bash
Raw Normal View History

2017-12-24 09:53:20 +03:00
#!/bin/sh
set -eu
unitdir="$1"
target="$2"
unit="$3"
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 -vp -m 0755 "$dir"
;;
*)
mkdir -vp -m 0755 "$(dirname "$dir")"
;;
esac
ln -vfs --relative "$unitpath" "$dir"