Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/db-update
diff options
context:
space:
mode:
Diffstat (limited to 'bin/db-update')
-rwxr-xr-xbin/db-update18
1 files changed, 9 insertions, 9 deletions
diff --git a/bin/db-update b/bin/db-update
index 91840d6..4808f2b 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -133,7 +133,10 @@ trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT
export TMPDIR="${tmp_dir}"
-for source_stability in 'testing' 'staging'; do
+# shellcheck disable=SC2154
+for source_stability in \
+ "${repository_stability_ids__testing}" \
+ "${repository_stability_ids__staging}"; do
find "${tmp_dir}" -mindepth 1 -delete
# shellcheck disable=SC2016
@@ -153,8 +156,7 @@ for source_stability in 'testing' 'staging'; do
printf ' JOIN `binary_packages_in_repositories` ON `binary_packages_in_repositories`.`id`=`moveable_bpir`.`id`'
mysql_join_binary_packages_in_repositories_binary_packages
mysql_join_binary_packages_in_repositories_repositories
- mysql_join_repositories_repository_stabilities
- printf ' WHERE `repository_stabilities`.`name`!="%s";\n' \
+ printf ' WHERE `repositories`.`stability`!=%s;\n' \
"${source_stability}"
printf 'UPDATE `moveable_bpir`'
printf ' JOIN `binary_packages_in_repositories` ON `binary_packages_in_repositories`.`id`=`moveable_bpir`.`id`'
@@ -197,8 +199,7 @@ for source_stability in 'testing' 'staging'; do
mysql_join_binary_packages_binary_packages_in_repositories 'old_bp' 'old_bpir'
# the old package is currently in the new repository
printf ' AND `repository_moves`.`to_repository`=`old_bpir`.`repository`'
- mysql_join_repositories_repository_stabilities 'old_r' 'old_rs'
- printf ' AND `old_rs`.`name`="%s"' \
+ printf ' AND `old_r`.`stability`=%s' \
"${source_stability}"
mysql_join_binary_packages_dependencies 'new_bp'
mysql_join_dependencies_dependency_types
@@ -223,8 +224,7 @@ for source_stability in 'testing' 'staging'; do
mysql_join_binary_packages_in_repositories_binary_packages
mysql_join_binary_packages_in_repositories_repositories
printf ' AND `repositories`.`is_on_master_mirror`'
- mysql_join_repositories_repository_stabilities
- printf ' AND `repository_stabilities`.`name`="%s"' \
+ printf ' AND `repositories`.`stability`=%s' \
"${source_stability}"
mysql_join_binary_packages_build_assignments
mysql_join_build_assignments_package_sources
@@ -238,7 +238,7 @@ for source_stability in 'testing' 'staging'; do
printf ' AND `repl_bpir`.`repository`=`repository_moves`.`to_repository`'
printf ');\n'
else
- printf 'CALL calculate_maximal_moveable_set("%s");\n' \
+ printf 'CALL calculate_maximal_moveable_set(%s);\n' \
"${source_stability}"
fi
@@ -295,7 +295,7 @@ for source_stability in 'testing' 'staging'; do
done
if [ ! -s "${tmp_dir}/repositories" ]; then
- >&2 printf 'Nothing to move from %s.\n' "${source_stability}"
+ >&2 printf 'Nothing to move here (%s).\n' "${source_stability}"
continue
fi