Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/why-dont-you
diff options
context:
space:
mode:
Diffstat (limited to 'bin/why-dont-you')
-rwxr-xr-xbin/why-dont-you18
1 files changed, 14 insertions, 4 deletions
diff --git a/bin/why-dont-you b/bin/why-dont-you
index 9b50427..61eae34 100755
--- a/bin/why-dont-you
+++ b/bin/why-dont-you
@@ -263,12 +263,19 @@ case "${action}" in
# shellcheck disable=SC2016
{
- printf 'CREATE TEMPORARY TABLE `bpirs` ('
- printf '`id` BIGINT,'
- printf 'UNIQUE KEY `id`(`id`)'
- printf ');\n'
+ for copy in '' '_2'; do
+ printf 'CREATE TEMPORARY TABLE `bpirs%s` (' \
+ "${copy}"
+ printf '`id` BIGINT,'
+ printf 'UNIQUE KEY `id`(`id`)'
+ printf ');\n'
+ done
printf 'LOAD DATA LOCAL INFILE "%s" INTO TABLE `bpirs`;\n' \
"${tmp_dir}/packages"
+ printf 'INSERT INTO `bpirs_2`(`id`)'
+ printf ' SELECT '
+ printf '`bpirs`.`id`'
+ printf ' FROM `bpirs`;\n'
printf 'SELECT CONCAT('
printf '"\\"",'
@@ -302,6 +309,9 @@ case "${action}" in
mysql_join_binary_packages_in_repositories_repositories 'itp_bpir' 'itp_r'
printf ' AND `itp_r`.`architecture`=`repositories`.`architecture`'
printf ' AND `repositories`.`stability`=`itp_r`.`stability`'
+ printf ' LEFT JOIN `bpirs_2`'
+ printf ' ON `bpirs_2`.`id`=`itp_bpir`.`id`'
+ printf ' WHERE `bpirs_2`.`id` IS NULL'
printf ') AS `sub_q`'
printf ' GROUP BY `sub_q`.`id`;\n'