mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-27 01:55:32 +03:00
2d9f0c6878
This is the equivalent of $(SYSTEM_UNIT_ALIASES) and $(GENERAL_ALIASES) in Makefile.am. ninja-build uninstall does not remove the symlinks, see https://github.com/mesonbuild/meson/issues/1602. I don't consider this a blocker: after all either one installs into $DESTDIR, where uninstallation doesn't make much sense, or into a real system, where a successfull uninstallation would likely destroy the system. v2: - remove bashisms - add various forgotten symlinks and fix service/timer/target confusions
28 lines
452 B
Bash
28 lines
452 B
Bash
#!/bin/sh -e
|
|
|
|
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"
|