diff options
author | Erich Eckner <git@eckner.net> | 2018-12-20 12:09:19 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-12-25 12:57:08 +0100 |
commit | 1a0fce5899210c8cecde287950ab987fd24e4fed (patch) | |
tree | 00c256fb7db86eae77e2505f264f92c4964a463b /bin/why-dont-you | |
parent | c10443178aab50929b40d9bb9b6edd25e0a5d4ac (diff) | |
download | builder-1a0fce5899210c8cecde287950ab987fd24e4fed.tar.xz |
bin/why-dont-you: can now filter by architecture
Diffstat (limited to 'bin/why-dont-you')
-rwxr-xr-x | bin/why-dont-you | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/bin/why-dont-you b/bin/why-dont-you index 614cd15..a3c2aa2 100755 --- a/bin/why-dont-you +++ b/bin/why-dont-you @@ -24,9 +24,8 @@ case "${action}" in # shellcheck disable=SC2016 { - printf 'CREATE TEMPORARY TABLE `pkgbases` (`pkgbase` VARCHAR(64));\n' - printf 'INSERT INTO `pkgbases` VALUES ' - # TODO: allow to filter by architecture + printf 'CREATE TEMPORARY TABLE `searches` (`search` VARCHAR(64));\n' + printf 'INSERT INTO `searches` VALUES ' # shellcheck disable=SC2046 printf '(from_base64("%s")),' \ $( @@ -54,9 +53,9 @@ case "${action}" in 'to_build' 'is_blocked' \ 'deps' 'pkgbase' \ 'build_slaves' 'name' \ - 'pkgbases' 'pkgbase' - # at least one row for each given `pkgbase` - printf ' FROM `pkgbases`' + 'to_build' 'pkgbase' + # at least one row for each given `search` + printf ' FROM `searches`' printf ' LEFT JOIN ' printf '(' # join the tables for the to-be-built packages: @@ -76,8 +75,10 @@ case "${action}" in printf ' WHERE `tb_bir`.`repository`=%s' \ "${repository_ids__any_build_list}" printf ') AS `to_build`' - printf ' ON `to_build`.`pkgbase`=`pkgbases`.`pkgbase`' - printf ' LEFT JOIN ' + printf ' ON (' + printf '`to_build`.`pkgbase`=`searches`.`search`' + printf ' OR `searches`.`search`=CONCAT(`to_build`.`baa_name`,"/",`to_build`.`pkgbase`)' + printf ') LEFT JOIN ' printf '(' # same join as above, but with different names - for the # potential dependencies |