|
@@ -17,7 +17,7 @@ __build1() {
|
17
|
17
|
test -n "$ftype" || ftype=$(__guess_ftype "$dstpath")
|
18
|
18
|
debug_var srcpath dstpath ftype
|
19
|
19
|
<"$srcpath" __build1_ftype "$ftype" >"$dstpath"
|
20
|
|
- rec_built "$dstpath"
|
|
20
|
+ __rec_built "$dstpath"
|
21
|
21
|
}
|
22
|
22
|
|
23
|
23
|
__build1_ftype() {
|
|
@@ -100,9 +100,43 @@ __cached() {
|
100
|
100
|
# arguments).
|
101
|
101
|
#
|
102
|
102
|
local name=$1
|
103
|
|
- local_get "$name" && return 0
|
104
|
|
- "$name" | local_putb "$name"
|
105
|
|
- local_get "$name"
|
|
103
|
+ __local_get "$name" && return 0
|
|
104
|
+ "$name" | __local_putb "$name"
|
|
105
|
+ __local_get "$name"
|
|
106
|
+}
|
|
107
|
+
|
|
108
|
+__local_putb() {
|
|
109
|
+ #
|
|
110
|
+ # Make file $1 in $MKIT_LOCAL from stdin and mark as built
|
|
111
|
+ #
|
|
112
|
+ local fpath=$1
|
|
113
|
+ __local_put "$fpath" && __rec_built "$MKIT_LOCAL/$fpath"
|
|
114
|
+}
|
|
115
|
+
|
|
116
|
+__local_put() {
|
|
117
|
+ #
|
|
118
|
+ # Make file $1 in $MKIT_LOCAL from stdin
|
|
119
|
+ #
|
|
120
|
+ local fpath="$MKIT_LOCAL/$1"
|
|
121
|
+ { mkdir -p "${fpath%/*}" && cat >"$fpath"; } \
|
|
122
|
+ || die "cannot write to local cache: $fpath"
|
|
123
|
+}
|
|
124
|
+
|
|
125
|
+__local_get() {
|
|
126
|
+ #
|
|
127
|
+ # Read file $1 in $MKIT_LOCAL
|
|
128
|
+ #
|
|
129
|
+ local fpath="$MKIT_LOCAL/$1"
|
|
130
|
+ cat "$fpath" 2>/dev/null
|
|
131
|
+}
|
|
132
|
+
|
|
133
|
+__rec_built() {
|
|
134
|
+ #
|
|
135
|
+ # Record file $1 for deletion on `clean`
|
|
136
|
+ #
|
|
137
|
+ local file=$1
|
|
138
|
+ mkdir -p "$MKIT_LOCAL"
|
|
139
|
+ echo "$file" >> "$MKIT_LOCAL/built.lst"
|
106
|
140
|
}
|
107
|
141
|
|
108
|
142
|
_mkit_data() {
|
|
@@ -177,7 +211,7 @@ debstuff() {
|
177
|
211
|
mv "${MKIT_PROJ_PKGNAME}-$version.tar.gz" \
|
178
|
212
|
"${MKIT_PROJ_PKGNAME}_$version.orig.tar.gz" \
|
179
|
213
|
|| die "could not rename tarball"
|
180
|
|
- rec_built "${MKIT_PROJ_PKGNAME}_$version.orig.tar.gz"
|
|
214
|
+ __rec_built "${MKIT_PROJ_PKGNAME}_$version.orig.tar.gz"
|
181
|
215
|
|
182
|
216
|
# read content of each mandatory file from debian_skel
|
183
|
217
|
#
|
|
@@ -191,7 +225,7 @@ debstuff() {
|
191
|
225
|
mkdir -p "$(dirname "$dftgt")"
|
192
|
226
|
__build1 "$dfsrc" "$dftgt" debstuff
|
193
|
227
|
done
|
194
|
|
- rec_built debian
|
|
228
|
+ __rec_built debian
|
195
|
229
|
}
|
196
|
230
|
|
197
|
231
|
dist() {
|
|
@@ -214,7 +248,7 @@ dist() {
|
214
|
248
|
echo -n "$git_lasthash" > "$dirname/.mkit/git_lasthash"
|
215
|
249
|
tar -cf "$dirname.tar" "$dirname"
|
216
|
250
|
gzip -f "$dirname.tar" # see above FIXME
|
217
|
|
- rec_built "$dirname.tar.gz"
|
|
251
|
+ __rec_built "$dirname.tar.gz"
|
218
|
252
|
rm -rf "$dirname"
|
219
|
253
|
}
|
220
|
254
|
|