|
@@ -80,6 +80,7 @@ __expand_macros() {
|
80
|
80
|
MacroMap[__MKIT_PROJ_MAINTAINER__]=$(ini 1value project:maintainer)
|
81
|
81
|
MacroMap[__MKIT_PROJ_VCS_BROWSER__]=$(ini 1value project:vcs_browser)
|
82
|
82
|
MacroMap[__MKIT_PROJ_GIT_LASTHASH__]=$(__cached git_lasthash)
|
|
83
|
+ MacroMap[__MKIT_PROJ_GIT_LASTSUMMARY__]=$(__cached git_lastsummary)
|
83
|
84
|
MacroMap[__MKIT_PROJ_VERSION__]=$(__cached semver)
|
84
|
85
|
for section in "$@"; do
|
85
|
86
|
for mname in $(ini lskeys "$section"); do
|
|
@@ -161,7 +162,7 @@ __rec_built() {
|
161
|
162
|
#
|
162
|
163
|
local file=$1
|
163
|
164
|
mkdir -p "$MKIT_LOCAL"
|
164
|
|
- echo "$file" >> "$MKIT_LOCAL/built.lst"
|
|
165
|
+ echo "1:$file" >> "$MKIT_LOCAL/built.lst"
|
165
|
166
|
}
|
166
|
167
|
|
167
|
168
|
_mkit_data() {
|
|
@@ -185,6 +186,7 @@ _mkit_data() {
|
185
|
186
|
echo " x_MKIT_PROJ_MAINTAINER__ => '__MKIT_PROJ_MAINTAINER__'"
|
186
|
187
|
echo " x_MKIT_PROJ_VCS_BROWSER__ => '__MKIT_PROJ_VCS_BROWSER__'"
|
187
|
188
|
echo " x_MKIT_PROJ_GIT_LASTHASH__ => '__MKIT_PROJ_GIT_LASTHASH__'"
|
|
189
|
+ echo " x_MKIT_PROJ_GIT_LASTSUMMARY__ => '__MKIT_PROJ_GIT_LASTSUMMARY__'"
|
188
|
190
|
echo " x_MKIT_PROJ_VERSION__ => '__MKIT_PROJ_VERSION__'"
|
189
|
191
|
for section in "${sections[@]}"; do
|
190
|
192
|
echo "$section:"
|
|
@@ -212,12 +214,31 @@ clean() {
|
212
|
214
|
#
|
213
|
215
|
# Clean up tree after building
|
214
|
216
|
#
|
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
|
|
- }
|
|
217
|
+ local path
|
|
218
|
+ local line
|
|
219
|
+ local depth
|
|
220
|
+ test -f "$MKIT_LOCAL/built.lst" || return 0
|
|
221
|
+ {
|
|
222
|
+ cat "$MKIT_LOCAL/built.lst"
|
|
223
|
+ echo "1:$MKIT_LOCAL/built.lst"
|
|
224
|
+ echo "1:$MKIT_LOCAL"
|
|
225
|
+ } \
|
|
226
|
+ | grep -v -e '\.\.' -e ^/ -e '^~' \
|
|
227
|
+ | while IFS=: read -r depth path; do
|
|
228
|
+ test -e "$path" || continue
|
|
229
|
+ case $depth in
|
|
230
|
+ 1) warn "removing: $path"
|
|
231
|
+ test -d "$path" \
|
|
232
|
+ && rmdir -p --ignore-fail-on-non-empty "$path"
|
|
233
|
+ test -f "$path" && rm "$path"
|
|
234
|
+ ;;
|
|
235
|
+ r) warn "removing recursively: $path"
|
|
236
|
+ rm -r "$path"
|
|
237
|
+ ;;
|
|
238
|
+ *) warn "invalid built.lst format!"
|
|
239
|
+ ;;
|
|
240
|
+ esac
|
|
241
|
+ done
|
221
|
242
|
true
|
222
|
243
|
}
|
223
|
244
|
|