File: meson-add-wants.sh

package info (click to toggle)
gnome-settings-daemon 48.1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 16,160 kB
  • sloc: ansic: 33,525; python: 1,340; xml: 603; sh: 101; makefile: 32; perl: 19
file content (30 lines) | stat: -rwxr-xr-x 494 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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"