Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-05-25 19:20:12 +0200
committerErich Eckner <git@eckner.net>2018-05-25 19:20:12 +0200
commit7f1100ee43c2628277d4affd51d604a816835958 (patch)
treeeb637e93ead88608bca4acdc96ec438e9bd6592a
parent3c9fe12e3eaf882e49c7498cc0344d24c1a0ae58 (diff)
lib/common-functions: remove_old_package_versions(): remove binary_packages_in_repositories, too
-rwxr-xr-xlib/common-functions3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/common-functions b/lib/common-functions
index 50dc6f1..7fe91ef 100755
--- a/lib/common-functions
+++ b/lib/common-functions
@@ -126,8 +126,6 @@ ls_master_mirror() {
remove_old_package_versions() {
-# TODO: needs to remove binary_packages_in_repositories, too
-
( # the new shell is intentional
tmp_dir=$(mktemp -d 'tmp.common-functions.remove_old_package_versions.XXXXXXXXXX' --tmpdir)
trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT
@@ -230,6 +228,7 @@ remove_old_package_versions() {
printf 'CREATE TEMPORARY TABLE `del` (`id` BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`));\n'
printf 'LOAD DATA LOCAL INFILE "%s" INTO TABLE `del` (`id`);\n' "${tmp_dir}/db-removes"
printf 'DELETE `binary_packages` FROM `binary_packages` JOIN `del` ON `binary_packages`.`id`=`del`.`id`;\n'
+ printf 'DELETE `binary_packages_in_repositories` FROM `binary_packages_in_repositories` JOIN `del` ON `binary_packages_in_repositories`.`package`=`del`.`id`;\n'
} | \
mysql_run_query
fi