Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/copy-to-build-support4
-rwxr-xr-xbin/db-update3
-rwxr-xr-xbin/get-package-updates8
-rwxr-xr-xbin/return-assignment4
-rwxr-xr-xlib/mysql-functions4
5 files changed, 14 insertions, 9 deletions
diff --git a/bin/copy-to-build-support b/bin/copy-to-build-support
index a42ca31..addd45c 100755
--- a/bin/copy-to-build-support
+++ b/bin/copy-to-build-support
@@ -126,9 +126,9 @@ sed -n '
# shellcheck disable=SC2016
{
printf 'INSERT IGNORE INTO `binary_packages_in_repositories`'
- printf ' (`repository`,`package`)'
+ printf ' (`repository`,`package`,`is_to_be_deleted`)'
# shellcheck disable=SC2154
- printf ' VALUES (%s,%s);\n' \
+ printf ' VALUES (%s,%s,0);\n' \
"${repository_ids__i686_build_support}" \
"${id}"
printf 'SELECT LAST_INSERT_ID();\n'
diff --git a/bin/db-update b/bin/db-update
index ae79389..4834a1d 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -411,7 +411,8 @@ for source_stability in 'testing' 'staging'; do
printf ' JOIN `moved_binary_packages` ON `binary_packages`.`id`=`moved_binary_packages`.`id`'
mysql_join_binary_packages_binary_packages_in_repositories
printf ' SET `binary_packages_in_repositories`.`repository`=`moved_binary_packages`.`new_repository`,'
- printf '`binary_packages`.`last_moved`=NOW()'
+ printf '`binary_packages`.`last_moved`=NOW(),'
+ printf '`binary_packages_in_repositories`.`last_moved`=NOW()'
printf ' WHERE `binary_packages_in_repositories`.`repository`!=`moved_binary_packages`.`new_repository`;\n'
} | \
mysql_run_query
diff --git a/bin/get-package-updates b/bin/get-package-updates
index 34e9753..6c4c5f9 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -128,9 +128,13 @@ delete_package() {
mysql_join_binary_packages_build_assignments
mysql_join_build_assignments_package_sources
mysql_join_binary_packages_binary_packages_in_repositories
+ printf ' SET '
# shellcheck disable=SC2154
- printf ' SET `binary_packages_in_repositories`.`repository`=%s' \
- "${repository_ids__any_deletion_list}"
+ printf '`binary_packages_in_repositories`.`%s`=%s,' \
+ 'repository' "${repository_ids__any_deletion_list}" \
+ 'is_to_be_deleted' '1' \
+ 'last_moved' 'NOW()' | \
+ sed 's/,$//'
# shellcheck disable=SC2154
printf ' WHERE `binary_packages_in_repositories`.`repository` in (%s,%s)' \
"${repository_ids__any_build_list}" \
diff --git a/bin/return-assignment b/bin/return-assignment
index 2df6ad6..0488a7d 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -602,8 +602,8 @@ trigger_mirror_refreshs
# insert into appropriate repositories and retrieve ids
while read -r package_id _; do
- printf 'INSERT INTO `binary_packages_in_repositories` (`package`,`repository`) VALUES '
- printf '(%s,%s);\n' \
+ printf 'INSERT INTO `binary_packages_in_repositories` (`package`,`repository`,`is_to_be_deleted`) VALUES '
+ printf '(%s,%s,0);\n' \
"${package_id}" "${destination_id}"
printf 'SELECT LAST_INSERT_ID();\n'
done < \
diff --git a/lib/mysql-functions b/lib/mysql-functions
index b00e17d..52f0ef2 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -477,8 +477,8 @@ mysql_generate_package_metadata() {
printf ' `architectures`.`name` = from_base64("%s")' \
"${arch}"
printf ';\n'
- printf 'INSERT IGNORE INTO `binary_packages_in_repositories` (`package`,`repository`)'
- printf ' SELECT LAST_INSERT_ID(),%s;\n' \
+ printf 'INSERT IGNORE INTO `binary_packages_in_repositories` (`package`,`repository`,`is_to_be_deleted`)'
+ printf ' SELECT LAST_INSERT_ID(),%s,0;\n' \
"${current_repository_id}"
printf 'COMMIT;\n'
} | \