Przeglądaj źródła

Avoid deploying skeletons inside a directory

We had to switch to recursive mode so that we can control more precisely
what gets installed.
Alois Mahdal 7 lat temu
rodzic
commit
c5cb812218
1 zmienionych plików z 7 dodań i 6 usunięć
  1. 7
    6
      src/include/deploy.sh

+ 7
- 6
src/include/deploy.sh Wyświetl plik

@@ -28,13 +28,14 @@ _deploy_item() {
28 28
     local src=$1                            # source path
29 29
     local dst=$2                            # destination path
30 30
     local mode=${3:-$MKIT_DEFAULT_MODE}     # mode
31
-    local chmod_item                        # each file to chmod in directory
31
+    local item                              # each in directory
32 32
     if test -d "$src"; then
33
-        _maybe mkdir -vp "$(dirname "$dst")"
34
-        _maybe cp -Tvr "$src" "$dst"
35
-        find "$dst" -type f \
36
-          | while read -r chmod_item; do
37
-                _maybe chmod "$mode" "$chmod_item"
33
+        find "$src" -type f \
34
+          | while read -r item; do
35
+                [[ $item =~ .skel$ ]] \
36
+                 && grep -q "${item%.skel}" "$MKIT_LOCAL/built.lst" \
37
+                 && continue
38
+                _deploy_item "$item" "$dst${item#$src}" "$mode"
38 39
             done
39 40
     else
40 41
         _maybe install -DTvm "$mode" "$src" "$dst"