You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
577 B
34 lines
577 B
#!/bin/sh |
|
set -eu |
|
|
|
unitdir="$1" |
|
target="$2" |
|
unit="$3" |
|
|
|
if [ "${MESON_INSTALL_QUIET:-0}" = 1 ] ; then |
|
VERBOSE="" |
|
else |
|
VERBOSE="v" |
|
fi |
|
|
|
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 -${VERBOSE}p -m 0755 "$dir" |
|
;; |
|
*) |
|
mkdir -${VERBOSE}p -m 0755 "$(dirname "$dir")" |
|
;; |
|
esac |
|
|
|
ln -${VERBOSE}fs --relative "$unitpath" "$dir"
|
|
|