From 1a0fce5899210c8cecde287950ab987fd24e4fed Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 20 Dec 2018 12:09:19 +0100 Subject: bin/why-dont-you: can now filter by architecture --- bin/why-dont-you | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'bin/why-dont-you') 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 -- cgit v1.2.3-54-g00ecf