Skip to content

Commit ff912af

Browse files
classabbyampthe-maldridge
authored andcommitted
buildbot: keep built packages separate with xbps-src -r, sync multilib properly
1 parent 8cec123 commit ff912af

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

services/nomad/build/buildbot.cfg

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ def make_xbps_bulk_cmd(props):
203203
'-h', hostdir,
204204
'-d', distdir(''),
205205
'-m', buildroot(),
206+
'-c', util.Interpolate(f'-r %(prop:target)s-%(prop:buildnumber)s'),
206207
'-t', '-s', '-S',
207208
]
208209
if props.getProperty('cross') == 'True':
@@ -220,28 +221,45 @@ def make_xbps_bulk_cmd(props):
220221
def make_rsync_cmd(props):
221222
return ['bash', '-e', '-c',
222223
util.Interpolate("""
224+
BUILDREPO="%(prop:target)s-%(prop:buildnumber)s"
223225
echo "=> Syncing packages to the shadow repository..."
224226
rsync -vurk --delete-after --remove-source-files \
225227
--filter='+ */' --filter='+ *.%(prop:target)s.xbps' \
226228
--filter='- .*' --filter='- *' \
227-
--password-file=/secrets/rsync/password /hostdir/binpkgs/ \
229+
--password-file=/secrets/rsync/password /hostdir/binpkgs/$BUILDREPO/ \
228230
{{ range nomadService 1 $allocID "build-rsyncd" -}}
229231
rsync://buildsync@{{ .Address }}:{{ .Port }}/incoming-%(prop:target)s
230232
{{ end -}}
231-
RSYNC_EXIT="$?"
232-
echo "=> Cleaning repodatas..."
233-
find /hostdir/binpkgs -name '%(prop:target)s-repodata' -print -delete
234-
case "$RSYNC_EXIT" in
235-
0|23|24) exit 0 ;;
233+
case "$?" in
234+
0|23|24) ;;
236235
*) exit 1 ;;
237236
esac
237+
if [ "%(prop:target)s" = i686 ] && [ -d "/hostdir/binpkgs/$BUILDREPO/multilib" ]; then
238+
echo "=> Syncing packages to the shadow repository..."
239+
rsync -vurk --delete-after --remove-source-files \
240+
--filter='+ */' --filter='+ *.x86_64.xbps' \
241+
--filter='- .*' --filter='- *' \
242+
--password-file=/secrets/rsync/password /hostdir/binpkgs/$BUILDREPO/multilib/ \
243+
{{ range nomadService 1 $allocID "build-rsyncd" -}}
244+
rsync://buildsync@{{ .Address }}:{{ .Port }}/incoming-%(prop:target)s/multilib/
245+
{{ end -}}
246+
case "$?" in
247+
0|23|24) ;;
248+
*) exit 1 ;;
249+
esac
250+
fi
251+
echo "=> Cleaning repodatas..."
252+
find /hostdir/binpkgs/$BUILDREPO -name '%(prop:target)s-repodata' -print -delete
253+
if [ "%(prop:target)s" = i686 ] && [ -d "/hostdir/binpkgs/$BUILDREPO/multilib" ]; then
254+
find /hostdir/binpkgs/$BUILDREPO/multilib -name 'x86_64-repodata' -print -delete
255+
fi
238256
""")]
239257

240258

241259
@util.renderer
242260
def make_update_repo_cmd(props):
243261
return ['bash', '-e', '-c',
244-
util.Interpolate(f"""
262+
util.Interpolate("""
245263
echo "=> Moving packages to the shadow repository..."
246264
rsync -vurk --delete-after --password-file=/secrets/rsync/password \
247265
{{ range nomadService 1 $allocID "build-rsyncd" -}}
@@ -262,11 +280,7 @@ esac
262280

263281
@util.renderer
264282
def make_clean_cmd(props):
265-
return [
266-
'find', '/hostdir/binpkgs', '(',
267-
'-name', util.Interpolate('*.%(prop:target)s.xbps'), '-o', '-name', util.Interpolate('%(prop:target)s-repodata'),
268-
')', '-print', '-delete',
269-
],
283+
return ['rm', '-vr', util.Interpolate('/hostdir/binpkgs/%(prop:target)s-%(prop:buildnumber)s')]
270284

271285

272286
@util.renderer

0 commit comments

Comments
 (0)