1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 01:27:11 +03:00
systemd/units/meson-add-wants.sh
2017-12-25 19:48:49 +01:00

29 lines
543 B
Bash
Executable File

#!/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 -p -m 0755 "$dir"
;;
*)
mkdir -p -m 0755 "$(basename "$dir")"
;;
esac
ln -vfs --relative "$unitpath" "$dir"