1 |
Use an easier-to-read "upload" function in place of "${cmd[@]}" array |
2 |
syntax. Added a helper var UPLOAD_DEST to be set in advance so that |
3 |
upload function takes only a list of filenames to be uploaded. |
4 |
|
5 |
Signed-off-by: Ben Kohler <bkohler@g.o> |
6 |
--- |
7 |
tools/catalyst-auto-amd64-experimental.conf | 48 +++++++++++---------- |
8 |
tools/catalyst-auto-amd64.conf | 48 +++++++++++---------- |
9 |
tools/catalyst-auto-x86-experimental.conf | 29 +++++++------ |
10 |
tools/catalyst-auto-x86.conf | 29 +++++++------ |
11 |
4 files changed, 86 insertions(+), 68 deletions(-) |
12 |
|
13 |
diff --git a/tools/catalyst-auto-amd64-experimental.conf b/tools/catalyst-auto-amd64-experimental.conf |
14 |
index 2aa91a03..f09cdb3b 100644 |
15 |
--- a/tools/catalyst-auto-amd64-experimental.conf |
16 |
+++ b/tools/catalyst-auto-amd64-experimental.conf |
17 |
@@ -26,7 +26,6 @@ SET_minimal_nomultilib_OPTIONAL_SPECS="stage4-nomultilib-minimal.spec" |
18 |
|
19 |
SET_x32_SPECS="stage1-x32.spec stage2-x32.spec stage3-x32.spec" |
20 |
|
21 |
- |
22 |
SET_hardened_multilib_SPECS="hardened/stage1.spec hardened/stage2.spec hardened/stage3.spec" |
23 |
SET_hardened_multilib_OPTIONAL_SPECS="hardened/admincd-stage1.spec hardened/admincd-stage2.spec" |
24 |
SET_minimal_hardened_multilib_OPTIONAL_SPECS="hardened/stage4-minimal.spec" |
25 |
@@ -62,16 +61,19 @@ update_symlinks() { |
26 |
done |
27 |
} |
28 |
|
29 |
+upload() { |
30 |
+ rsync \ |
31 |
+ -e 'ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no' \ |
32 |
+ -a \ |
33 |
+ --omit-dir-times \ |
34 |
+ --delay-updates \ |
35 |
+ "$@" \ |
36 |
+ "${UPLOAD_DEST}" |
37 |
+} |
38 |
+ |
39 |
post_build() { |
40 |
local set=$1 spec=$2 |
41 |
|
42 |
- cmd=( |
43 |
- rsync |
44 |
- -e 'ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no' |
45 |
- -a |
46 |
- --omit-dir-times |
47 |
- --delay-updates |
48 |
- ) |
49 |
case $HOSTNAME in |
50 |
# If you ever need to ensure it's copied somewhere local, drop a hostname in here! |
51 |
LOCAL) |
52 |
@@ -85,53 +87,55 @@ post_build() { |
53 |
esac |
54 |
|
55 |
pushd "${BUILD_SRCDIR_BASE}"/default >/dev/null || exit |
56 |
+ UPLOAD_DEST=${DEST_DEFAULT} |
57 |
case ${spec} in |
58 |
stage3.spec) |
59 |
- "${cmd[@]}" stage3-amd64-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
60 |
+ upload stage3-amd64-${TIMESTAMP}.tar.xz* |
61 |
;; |
62 |
installcd-stage2-minimal.spec) |
63 |
- "${cmd[@]}" install-amd64-minimal-${TIMESTAMP}.iso* "${DEST_DEFAULT}" |
64 |
+ upload install-amd64-minimal-${TIMESTAMP}.iso* |
65 |
;; |
66 |
stage4-minimal.spec) |
67 |
- "${cmd[@]}" stage4-amd64-minimal-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
68 |
+ upload stage4-amd64-minimal-${TIMESTAMP}.tar.xz* |
69 |
;; |
70 |
stage3-nomultilib.spec) |
71 |
- "${cmd[@]}" stage3-amd64-nomultilib-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
72 |
+ upload stage3-amd64-nomultilib-${TIMESTAMP}.tar.xz* |
73 |
;; |
74 |
stage4-nomultilib-minimal.spec) |
75 |
- "${cmd[@]}" stage4-amd64-minimal-nomultilib-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
76 |
+ upload stage4-amd64-minimal-nomultilib-${TIMESTAMP}.tar.xz* |
77 |
;; |
78 |
stage3-x32.spec) |
79 |
- "${cmd[@]}" stage3-x32-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
80 |
+ upload stage3-x32-${TIMESTAMP}.tar.xz* |
81 |
;; |
82 |
esac |
83 |
popd >/dev/null || exit |
84 |
|
85 |
pushd "${BUILD_SRCDIR_BASE}"/hardened >/dev/null || exit |
86 |
+ UPLOAD_DEST=${DEST_HARDENED} |
87 |
case ${spec} in |
88 |
hardened/stage3.spec) |
89 |
- "${cmd[@]}" stage3-amd64-hardened-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
90 |
+ upload stage3-amd64-hardened-${TIMESTAMP}.tar.xz* |
91 |
;; |
92 |
hardened/admincd-stage2.spec) |
93 |
- "${cmd[@]}" admincd-amd64-${TIMESTAMP}.iso* "${DEST_HARDENED}" |
94 |
+ upload admincd-amd64-${TIMESTAMP}.iso* |
95 |
;; |
96 |
hardened/stage4-minimal.spec) |
97 |
- "${cmd[@]}" stage4-amd64-hardened+minimal-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
98 |
+ upload stage4-amd64-hardened+minimal-${TIMESTAMP}.tar.xz* |
99 |
;; |
100 |
hardened/stage3-nomultilib.spec) |
101 |
- "${cmd[@]}" stage3-amd64-hardened+nomultilib-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
102 |
+ upload stage3-amd64-hardened+nomultilib-${TIMESTAMP}.tar.xz* |
103 |
;; |
104 |
hardened/stage4-nomultilib-minimal.spec) |
105 |
- "${cmd[@]}" stage4-amd64-hardened+minimal-nomultilib-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
106 |
+ upload stage4-amd64-hardened+minimal-nomultilib-${TIMESTAMP}.tar.xz* |
107 |
;; |
108 |
hardened/stage3-selinux.spec) |
109 |
- "${cmd[@]}" stage3-amd64-hardened-selinux-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
110 |
+ upload stage3-amd64-hardened-selinux-${TIMESTAMP}.tar.xz* |
111 |
;; |
112 |
hardened/admincd-stage2-selinux.spec) |
113 |
- "${cmd[@]}" admincd-amd64-${TIMESTAMP}.iso* "${DEST_HARDENED}" |
114 |
+ upload admincd-amd64-${TIMESTAMP}.iso* |
115 |
;; |
116 |
hardened/stage3-selinux-nomultilib.spec) |
117 |
- "${cmd[@]}" stage3-amd64-hardened-selinux+nomultilib-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
118 |
+ upload stage3-amd64-hardened-selinux+nomultilib-${TIMESTAMP}.tar.xz* |
119 |
;; |
120 |
esac |
121 |
popd >/dev/null || exit |
122 |
diff --git a/tools/catalyst-auto-amd64.conf b/tools/catalyst-auto-amd64.conf |
123 |
index 585c22c6..15f691d4 100644 |
124 |
--- a/tools/catalyst-auto-amd64.conf |
125 |
+++ b/tools/catalyst-auto-amd64.conf |
126 |
@@ -26,7 +26,6 @@ SET_minimal_nomultilib_OPTIONAL_SPECS="stage4-nomultilib-minimal.spec" |
127 |
|
128 |
SET_x32_SPECS="stage1-x32.spec stage2-x32.spec stage3-x32.spec" |
129 |
|
130 |
- |
131 |
SET_hardened_multilib_SPECS="hardened/stage1.spec hardened/stage2.spec hardened/stage3.spec" |
132 |
SET_hardened_multilib_OPTIONAL_SPECS="hardened/admincd-stage1.spec hardened/admincd-stage2.spec" |
133 |
SET_minimal_hardened_multilib_OPTIONAL_SPECS="hardened/stage4-minimal.spec" |
134 |
@@ -62,16 +61,19 @@ update_symlinks() { |
135 |
done |
136 |
} |
137 |
|
138 |
+upload() { |
139 |
+ rsync \ |
140 |
+ -e 'ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no' \ |
141 |
+ -a \ |
142 |
+ --omit-dir-times \ |
143 |
+ --delay-updates \ |
144 |
+ "$@" \ |
145 |
+ "${UPLOAD_DEST}" |
146 |
+} |
147 |
+ |
148 |
post_build() { |
149 |
local set=$1 spec=$2 |
150 |
|
151 |
- cmd=( |
152 |
- rsync |
153 |
- -e 'ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no' |
154 |
- -a |
155 |
- --omit-dir-times |
156 |
- --delay-updates |
157 |
- ) |
158 |
case $HOSTNAME in |
159 |
# If you ever need to ensure it's copied somewhere local, drop a hostname in here! |
160 |
LOCAL) |
161 |
@@ -85,53 +87,55 @@ post_build() { |
162 |
esac |
163 |
|
164 |
pushd "${BUILD_SRCDIR_BASE}"/default >/dev/null || exit |
165 |
+ UPLOAD_DEST=${DEST_DEFAULT} |
166 |
case ${spec} in |
167 |
stage3.spec) |
168 |
- "${cmd[@]}" stage3-amd64-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
169 |
+ upload stage3-amd64-${TIMESTAMP}.tar.xz* |
170 |
;; |
171 |
installcd-stage2-minimal.spec) |
172 |
- "${cmd[@]}" install-amd64-minimal-${TIMESTAMP}.iso* "${DEST_DEFAULT}" |
173 |
+ upload install-amd64-minimal-${TIMESTAMP}.iso* |
174 |
;; |
175 |
stage4-minimal.spec) |
176 |
- "${cmd[@]}" stage4-amd64-minimal-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
177 |
+ upload stage4-amd64-minimal-${TIMESTAMP}.tar.xz* |
178 |
;; |
179 |
stage3-nomultilib.spec) |
180 |
- "${cmd[@]}" stage3-amd64-nomultilib-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
181 |
+ upload stage3-amd64-nomultilib-${TIMESTAMP}.tar.xz* |
182 |
;; |
183 |
stage4-nomultilib-minimal.spec) |
184 |
- "${cmd[@]}" stage4-amd64-minimal-nomultilib-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
185 |
+ upload stage4-amd64-minimal-nomultilib-${TIMESTAMP}.tar.xz* |
186 |
;; |
187 |
stage3-x32.spec) |
188 |
- "${cmd[@]}" stage3-x32-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
189 |
+ upload stage3-x32-${TIMESTAMP}.tar.xz* |
190 |
;; |
191 |
esac |
192 |
popd >/dev/null || exit |
193 |
|
194 |
pushd "${BUILD_SRCDIR_BASE}"/hardened >/dev/null || exit |
195 |
+ UPLOAD_DEST=${DEST_HARDENED} |
196 |
case ${spec} in |
197 |
hardened/stage3.spec) |
198 |
- "${cmd[@]}" stage3-amd64-hardened-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
199 |
+ upload stage3-amd64-hardened-${TIMESTAMP}.tar.xz* |
200 |
;; |
201 |
hardened/admincd-stage2.spec) |
202 |
- "${cmd[@]}" admincd-amd64-${TIMESTAMP}.iso* "${DEST_HARDENED}" |
203 |
+ upload admincd-amd64-${TIMESTAMP}.iso* |
204 |
;; |
205 |
hardened/stage4-minimal.spec) |
206 |
- "${cmd[@]}" stage4-amd64-hardened+minimal-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
207 |
+ upload stage4-amd64-hardened+minimal-${TIMESTAMP}.tar.xz* |
208 |
;; |
209 |
hardened/stage3-nomultilib.spec) |
210 |
- "${cmd[@]}" stage3-amd64-hardened+nomultilib-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
211 |
+ upload stage3-amd64-hardened+nomultilib-${TIMESTAMP}.tar.xz* |
212 |
;; |
213 |
hardened/stage4-nomultilib-minimal.spec) |
214 |
- "${cmd[@]}" stage4-amd64-hardened+minimal-nomultilib-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
215 |
+ upload stage4-amd64-hardened+minimal-nomultilib-${TIMESTAMP}.tar.xz* |
216 |
;; |
217 |
hardened/stage3-selinux.spec) |
218 |
- "${cmd[@]}" stage3-amd64-hardened-selinux-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
219 |
+ upload stage3-amd64-hardened-selinux-${TIMESTAMP}.tar.xz* |
220 |
;; |
221 |
hardened/admincd-stage2-selinux.spec) |
222 |
- "${cmd[@]}" admincd-amd64-${TIMESTAMP}.iso* "${DEST_HARDENED}" |
223 |
+ upload admincd-amd64-${TIMESTAMP}.iso* |
224 |
;; |
225 |
hardened/stage3-selinux-nomultilib.spec) |
226 |
- "${cmd[@]}" stage3-amd64-hardened-selinux+nomultilib-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
227 |
+ upload stage3-amd64-hardened-selinux+nomultilib-${TIMESTAMP}.tar.xz* |
228 |
;; |
229 |
esac |
230 |
popd >/dev/null || exit |
231 |
diff --git a/tools/catalyst-auto-x86-experimental.conf b/tools/catalyst-auto-x86-experimental.conf |
232 |
index 061cab92..5f0e475e 100644 |
233 |
--- a/tools/catalyst-auto-x86-experimental.conf |
234 |
+++ b/tools/catalyst-auto-x86-experimental.conf |
235 |
@@ -48,16 +48,19 @@ update_symlinks() { |
236 |
done |
237 |
} |
238 |
|
239 |
+upload() { |
240 |
+ rsync \ |
241 |
+ -e 'ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no' \ |
242 |
+ -a \ |
243 |
+ --omit-dir-times \ |
244 |
+ --delay-updates \ |
245 |
+ "$@" \ |
246 |
+ "${UPLOAD_DEST}" |
247 |
+} |
248 |
+ |
249 |
post_build() { |
250 |
local set=$1 spec=$2 |
251 |
|
252 |
- cmd=( |
253 |
- rsync |
254 |
- -e 'ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no' |
255 |
- -a |
256 |
- --omit-dir-times |
257 |
- --delay-updates |
258 |
- ) |
259 |
case $HOSTNAME in |
260 |
# If you ever need to ensure it's copied somewhere local, drop a hostname in here! |
261 |
LOCAL) |
262 |
@@ -71,26 +74,28 @@ post_build() { |
263 |
esac |
264 |
|
265 |
pushd "${BUILD_SRCDIR_BASE}"/default >/dev/null || exit |
266 |
+ UPLOAD_DEST=${DEST_DEFAULT} |
267 |
case ${spec} in |
268 |
stage3.spec) |
269 |
- "${cmd[@]}" stage3-i486-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
270 |
+ upload stage3-i486-${TIMESTAMP}.tar.xz* |
271 |
;; |
272 |
installcd-stage2-minimal.spec) |
273 |
- "${cmd[@]}" install-x86-minimal-${TIMESTAMP}.iso* "${DEST_DEFAULT}" |
274 |
+ upload install-x86-minimal-${TIMESTAMP}.iso* |
275 |
;; |
276 |
i686/stage3.spec) |
277 |
- "${cmd[@]}" stage3-i686-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
278 |
+ upload stage3-i686-${TIMESTAMP}.tar.xz* |
279 |
;; |
280 |
esac |
281 |
popd >/dev/null || exit |
282 |
|
283 |
pushd "${BUILD_SRCDIR_BASE}"/hardened >/dev/null || exit |
284 |
+ UPLOAD_DEST=${DEST_HARDENED} |
285 |
case ${spec} in |
286 |
hardened/stage3.spec) |
287 |
- "${cmd[@]}" stage3-i686-hardened-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
288 |
+ upload stage3-i686-hardened-${TIMESTAMP}.tar.xz* |
289 |
;; |
290 |
hardened/admincd-stage2.spec) |
291 |
- "${cmd[@]}" admincd-x86-${TIMESTAMP}.iso* "${DEST_HARDENED}" |
292 |
+ upload admincd-x86-${TIMESTAMP}.iso* |
293 |
;; |
294 |
esac |
295 |
popd >/dev/null || exit |
296 |
diff --git a/tools/catalyst-auto-x86.conf b/tools/catalyst-auto-x86.conf |
297 |
index e778ce8e..aa00dde1 100644 |
298 |
--- a/tools/catalyst-auto-x86.conf |
299 |
+++ b/tools/catalyst-auto-x86.conf |
300 |
@@ -48,16 +48,19 @@ update_symlinks() { |
301 |
done |
302 |
} |
303 |
|
304 |
+upload() { |
305 |
+ rsync \ |
306 |
+ -e 'ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no' \ |
307 |
+ -a \ |
308 |
+ --omit-dir-times \ |
309 |
+ --delay-updates \ |
310 |
+ "$@" \ |
311 |
+ "${UPLOAD_DEST}" |
312 |
+} |
313 |
+ |
314 |
post_build() { |
315 |
local set=$1 spec=$2 |
316 |
|
317 |
- cmd=( |
318 |
- rsync |
319 |
- -e 'ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no' |
320 |
- -a |
321 |
- --omit-dir-times |
322 |
- --delay-updates |
323 |
- ) |
324 |
case $HOSTNAME in |
325 |
# If you ever need to ensure it's copied somewhere local, drop a hostname in here! |
326 |
LOCAL) |
327 |
@@ -71,26 +74,28 @@ post_build() { |
328 |
esac |
329 |
|
330 |
pushd "${BUILD_SRCDIR_BASE}"/default >/dev/null || exit |
331 |
+ UPLOAD_DEST=${DEST_DEFAULT} |
332 |
case ${spec} in |
333 |
stage3.spec) |
334 |
- "${cmd[@]}" stage3-i486-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
335 |
+ upload stage3-i486-${TIMESTAMP}.tar.xz* |
336 |
;; |
337 |
installcd-stage2-minimal.spec) |
338 |
- "${cmd[@]}" install-x86-minimal-${TIMESTAMP}.iso* "${DEST_DEFAULT}" |
339 |
+ upload install-x86-minimal-${TIMESTAMP}.iso* |
340 |
;; |
341 |
i686/stage3.spec) |
342 |
- "${cmd[@]}" stage3-i686-${TIMESTAMP}.tar.xz* "${DEST_DEFAULT}" |
343 |
+ upload stage3-i686-${TIMESTAMP}.tar.xz* |
344 |
;; |
345 |
esac |
346 |
popd >/dev/null || exit |
347 |
|
348 |
pushd "${BUILD_SRCDIR_BASE}"/hardened >/dev/null || exit |
349 |
+ UPLOAD_DEST=${DEST_HARDENED} |
350 |
case ${spec} in |
351 |
hardened/stage3.spec) |
352 |
- "${cmd[@]}" stage3-i686-hardened-${TIMESTAMP}.tar.xz* "${DEST_HARDENED}" |
353 |
+ upload stage3-i686-hardened-${TIMESTAMP}.tar.xz* |
354 |
;; |
355 |
hardened/admincd-stage2.spec) |
356 |
- "${cmd[@]}" admincd-x86-${TIMESTAMP}.iso* "${DEST_HARDENED}" |
357 |
+ upload admincd-x86-${TIMESTAMP}.iso* |
358 |
;; |
359 |
esac |
360 |
popd >/dev/null || exit |
361 |
-- |
362 |
2.26.2 |