summaryrefslogtreecommitdiffstats
path: root/data/meson-add-wants.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:09:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:09:04 +0000
commit829aea9a4dce048f63c6d9568b50ab4bdb7609e3 (patch)
tree7c5d5ac80e81dc5186f19649f48387a67df20425 /data/meson-add-wants.sh
parentInitial commit. (diff)
downloadgnome-initial-setup-829aea9a4dce048f63c6d9568b50ab4bdb7609e3.tar.xz
gnome-initial-setup-829aea9a4dce048f63c6d9568b50ab4bdb7609e3.zip
Adding upstream version 3.38.4.upstream/3.38.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'data/meson-add-wants.sh')
-rwxr-xr-xdata/meson-add-wants.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/data/meson-add-wants.sh b/data/meson-add-wants.sh
new file mode 100755
index 0000000..c33d1b4
--- /dev/null
+++ b/data/meson-add-wants.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+set -eu
+
+# Script copied from systemd
+
+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"