summaryrefslogtreecommitdiff
path: root/bin/delete-packages
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-07-23 15:06:31 +0200
committerErich Eckner <git@eckner.net>2018-07-23 15:06:31 +0200
commit96773fdedcae8354aa720c63fb289140d482529d (patch)
treebaa606aae5fb7abd22c42815d35e8053c942ba1a /bin/delete-packages
parent4726ed62362267d10ea571da4f7ab75b0859b78d (diff)
downloadbuilder-96773fdedcae8354aa720c63fb289140d482529d.tar.xz
do not address deletion-list directly, but rather by its stability "forbidden"
Diffstat (limited to 'bin/delete-packages')
-rwxr-xr-xbin/delete-packages25
1 files changed, 17 insertions, 8 deletions
diff --git a/bin/delete-packages b/bin/delete-packages
index 58d15e3..5109e4c 100755
--- a/bin/delete-packages
+++ b/bin/delete-packages
@@ -363,11 +363,26 @@ fi
printf 'LOAD DATA LOCAL INFILE "%s" INTO TABLE `bpir_to_delete`;\n' \
"${tmp_dir}/package-in-repository-ids"
+ printf 'UPDATE `binary_packages_in_repositories`'
+ printf ' JOIN `bpir_to_delete`'
+ printf ' ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
+ mysql_join_binary_packages_in_repositories_repositories
+ printf ' JOIN `repositories` AS `d_r`'
+ printf ' ON `d_r`.`stability`=%s' \
+ "${repository_stability_ids__forbidden}"
+ printf ' AND `d_r`.`architecture`=`repositories`.`architecture`'
+ printf ' SET `binary_packages_in_repositories`.`repository`=`d_r`.`id`'
+ # shellcheck disable=SC2154
+ printf ' WHERE `repositories`.`stability`!=%s;\n' \
+ "${repository_stability_ids__standalone}"
+
printf 'DELETE `binary_packages_in_repositories`'
printf ' FROM `binary_packages_in_repositories`'
- printf ' JOIN `bpir_to_delete` ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
+ printf ' JOIN `bpir_to_delete`'
+ printf ' ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
mysql_join_binary_packages_in_repositories_repositories
- printf ' WHERE `repositories`.`name`="build-support";\n'
+ printf ' WHERE `repositories`.`stability`!=%s;\n' \
+ "${repository_stability_ids__forbidden}"
printf 'DELETE `binary_packages`'
printf ' FROM `binary_packages`'
@@ -375,12 +390,6 @@ fi
printf 'SELECT 1 FROM `binary_packages_in_repositories`'
printf ' WHERE `binary_packages_in_repositories`.`package`=`binary_packages`.`id`'
printf ');\n'
-
- printf 'UPDATE `binary_packages_in_repositories`'
- printf ' JOIN `bpir_to_delete` ON `bpir_to_delete`.`id`=`binary_packages_in_repositories`.`id`'
- # shellcheck disable=SC2154
- printf ' SET `binary_packages_in_repositories`.`repository`=%s;\n' \
- "${repository_ids__any_deletion_list}"
} | \
mysql_run_query