Browse Source

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 years ago
parent
commit
c5cb812218
1 changed files with 7 additions and 6 deletions
  1. 7
    6
      src/include/deploy.sh

+ 7
- 6
src/include/deploy.sh View File

28
     local src=$1                            # source path
28
     local src=$1                            # source path
29
     local dst=$2                            # destination path
29
     local dst=$2                            # destination path
30
     local mode=${3:-$MKIT_DEFAULT_MODE}     # mode
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
     if test -d "$src"; then
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
             done
39
             done
39
     else
40
     else
40
         _maybe install -DTvm "$mode" "$src" "$dst"
41
         _maybe install -DTvm "$mode" "$src" "$dst"