how to use/control rebuilderd on Debian (temporary URL)

(version 0.1, feedback much welcome.)

general
=======
run all commands as the user rebuilderd is running.


watching the queue
==================
watch -n 60 -c /opt/usr/bin/rebuildctl -H http://127.0.0.1:8484/ queue ls -C --head


reschedule known temporarily (or fixed) failures
================================================
echo "update packages
set status = 'UNKWN', build_id = null
where build_id in (select p.build_id
FROM packages p
JOIN builds b ON b.id = p.build_id
JOIN queue q ON q.pkgbase_id = p.pkgbase_id
WHERE p.status = 'BAD' and
 (CAST(b.build_log AS TEXT) like '%/opt/usr/libexec/rebuilderd/rebuilder-debian.sh: 4: /debrebuild/debrebuild.py: not found%'
 or CAST(b.build_log AS TEXT) like '%debsnap failed%'
 or CAST(b.build_log AS TEXT) like '%debootsnap failed at /usr/bin/debrebuild line%'
 or CAST(b.build_log AS TEXT) like '%AssertionError: environment bootstrapped from buildinfo file does not match environment in buildinfo file%'
 or CAST(b.build_log AS TEXT) like '%fakeroot not found, either install the fakeroot%'
 or CAST(b.build_log AS TEXT) like '%debrebuild: error: cannot read %'
 or CAST(b.build_log AS TEXT) like '%dscverify failed%'
 or CAST(b.build_log AS TEXT) like '%Failed to download build input from%' ))"  | sqlite3 rebuilderd.db


reschedule specific packages
============================
PKGS="bash vim"
for i in $PKGS ; do
echo "update packages
set status = 'UNKWN', build_id = null
where build_id in (select p.build_id
FROM packages p
JOIN builds b ON b.id = p.build_id
JOIN queue q ON q.pkgbase_id = p.pkgbase_id
WHERE p.name = \"$i\"
)"| sqlite3 rebuilderd.db
done

to empty the queue and schedule all UNKWN packages again:
=========================================================
echo 'delete from queue;' | sqlite3 rebuilderd.db
env REBUILDERD_COOKIE_PATH=~/.local/share/rebuilderd-auth-cookie /opt/usr/bin/rebuildctl -H http://127.0.0.1:8484 pkgs requeue --status UNKWN
# < kpcyrd> also while looking into the code further, I think setting the status back to
#	    UNKWN through sql may cause the package to be stuck in that status indefintely, maybe we shouldn't be doing that anymore
# < h01ger> kpcyrd: how do i empty the queue with rebuildctl? :)
# < kpcyrd> h01ger: rebuildctl queue drop + scripting