|
@@ -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
|
|