From 1924781bb65c2be4f000c92ad5dc67c4b0c33f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Fri, 26 Aug 2022 13:18:30 +0200 Subject: [PATCH] batch-viz: Get UUIDs with distinct inputs This should result in less complaints about visualizations already existing. --- packaging/batch-viz.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packaging/batch-viz.sh b/packaging/batch-viz.sh index 358eb6c..12002a4 100755 --- a/packaging/batch-viz.sh +++ b/packaging/batch-viz.sh @@ -127,8 +127,22 @@ fi ATTEMPTED_VIZS=0 FAILED_VIZS=0 -for i in $(find "${DATA_DIR}" -type f -path \*output/bin\*); do - UUID=$(echo "${i}" | rev | cut -d '/' -f 4 | rev) +distinct-input () { + { + sqlite3 "${DATA_DIR}/builder.sqlite3" "SELECT b.uuid + FROM build b + JOIN build_artifact opam ON opam.build = b.id + WHERE opam.filepath = 'opam-switch' AND b.main_binary NOT NULL + GROUP BY opam.sha256;" + sqlite3 "${DATA_DIR}/builder.sqlite3" "SELECT b.uuid + FROM build b + JOIN build_artifact debug ON debug.build = b.id + WHERE debug.filepath LIKE '%.debug' AND b.main_binary NOT NULL + GROUP BY debug.sha256;" + } | sort -u +} + +for UUID in $(distinct-input); do if ! "$VISUALIZATIONS_CMD" \ --data-dir="${DATA_DIR}" \ --cache-dir="${CACHE_DIR}" \