]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - units/meson-add-wants.sh
test-network: replace check_link_exists() with wait_online()
[thirdparty/systemd.git] / units / meson-add-wants.sh
index 7fbf5ed6fc9c62cf9311642bd86a51599ffd12f8..a483d75b86f36d0b81223cae62fa12043c64d015 100755 (executable)
@@ -1,4 +1,5 @@
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
 
 unitdir="$1"
 target="$2"
@@ -6,21 +7,21 @@ unit="$3"
 
 case "$target" in
     */?*) # a path, but not just a slash at the end
-        dir="${DESTDIR}${target}"
+        dir="${DESTDIR:-}${target}"
         ;;
     *)
-        dir="${DESTDIR}${unitdir}/${target}"
+        dir="${DESTDIR:-}${unitdir}/${target}"
         ;;
 esac
 
-unitpath="${DESTDIR}${unitdir}/${unit}"
+unitpath="${DESTDIR:-}${unitdir}/${unit}"
 
 case "$target" in
     */)
-        mkdir -p -m 0755 "$dir"
+        mkdir -vp -m 0755 "$dir"
         ;;
     *)
-        mkdir -p -m 0755 "$(basename "$dir")"
+        mkdir -vp -m 0755 "$(dirname "$dir")"
         ;;
 esac