From bfa69561d1b5c91d2eeea2822c7762da4c68c6eb Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 26 Feb 2020 14:11:27 +0100 Subject: bin/why-dont-you: ignore packages that are requested to being moved --- bin/why-dont-you | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'bin') 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' -- cgit v1.2.3-70-g09d2