Browse Source

Update MKit to v0.0.39

Alois Mahdal 4 years ago
parent
commit
f40b74432d
3 changed files with 30 additions and 10 deletions
  1. 26
    7
      utils/mkit/include/build.sh
  2. 3
    2
      utils/mkit/include/release.sh
  3. 1
    1
      utils/mkit/include/vars.sh

+ 26
- 7
utils/mkit/include/build.sh View File

@@ -161,7 +161,7 @@ __rec_built() {
161 161
     #
162 162
     local file=$1
163 163
     mkdir -p "$MKIT_LOCAL"
164
-    echo "$file" >> "$MKIT_LOCAL/built.lst"
164
+    echo "1:$file" >> "$MKIT_LOCAL/built.lst"
165 165
 }
166 166
 
167 167
 _mkit_data() {
@@ -212,12 +212,31 @@ clean() {
212 212
     #
213 213
     # Clean up tree after building
214 214
     #
215
-    test -f "$MKIT_LOCAL/built.lst" && {
216
-        <"$MKIT_LOCAL/built.lst" grep -v -e '\.\.' -e ^/ \
217
-          | xargs -r rm -rf
218
-        rm -f "$MKIT_LOCAL/built.lst"
219
-        rmdir --ignore-fail-on-non-empty "$MKIT_LOCAL"
220
-    }
215
+    local path
216
+    local line
217
+    local depth
218
+    test -f "$MKIT_LOCAL/built.lst" || return 0
219
+    {
220
+        cat "$MKIT_LOCAL/built.lst"
221
+        echo "1:$MKIT_LOCAL/built.lst"
222
+        echo "1:$MKIT_LOCAL"
223
+    } \
224
+      | grep -v -e '\.\.' -e ^/ -e '^~' \
225
+      | while IFS=: read -r depth path; do
226
+            test -e "$path" || continue
227
+            case $depth in
228
+                1)  warn "removing: $path"
229
+                    test -d "$path" \
230
+                     && rmdir -p --ignore-fail-on-non-empty "$path"
231
+                    test -f "$path" && rm "$path"
232
+                    ;;
233
+                r)  warn "removing recursively: $path"
234
+                    rm -r "$path"
235
+                    ;;
236
+                *)  warn "invalid built.lst format!"
237
+                    ;;
238
+            esac
239
+        done
221 240
     true
222 241
 }
223 242
 

+ 3
- 2
utils/mkit/include/release.sh View File

@@ -154,7 +154,7 @@ __vbump() {
154 154
     git add mkit.ini \
155 155
       || die "failed to add mkit.ini to the index"
156 156
     cache=$(mktemp -t "mkit._vbump_gitmsg.XXXXXXXX")
157
-    _vbump_gitmsg > "$cache"
157
+    _vbump_gitmsg "$nextver" > "$cache"
158 158
     git commit -e -F "$cache"   # note: reading from stdin will break vim
159 159
     rm "$cache"
160 160
 }
@@ -163,7 +163,8 @@ _vbump_gitmsg() {
163 163
     #
164 164
     # Compose git message template for 'Bump version' commit
165 165
     #
166
-    echo "Bump version"
166
+    local nextver=$1
167
+    echo "Bump version to $nextver"
167 168
     echo ""
168 169
     echo "Overview of changes:"
169 170
     echo ""

+ 1
- 1
utils/mkit/include/vars.sh View File

@@ -86,4 +86,4 @@ MKIT_TSTAMP=${MKIT_TSTAMP:-ctime}
86 86
 #
87 87
 # This MKit version
88 88
 #
89
-MKIT_VERSION=0.0.37
89
+MKIT_VERSION=0.0.39