Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/get-package-updates
diff options
context:
space:
mode:
authorErich Eckner <erich.eckner.ext@bestsecret.com>2023-05-22 10:57:58 +0200
committerErich Eckner <erich.eckner.ext@bestsecret.com>2023-05-22 10:57:58 +0200
commite72fc0321679bbc40482a5afc04448dd3989ca5e (patch)
tree519bb2b6aaddc2912ffd5bff360c6375e6d5271a /bin/get-package-updates
parent49badd0b69b96c23b307e97f86f2f0ca1e302752 (diff)
bin/get-package-updates: delete packages by repository
* this should fix moving of packages
Diffstat (limited to 'bin/get-package-updates')
-rwxr-xr-xbin/get-package-updates19
1 files changed, 12 insertions, 7 deletions
diff --git a/bin/get-package-updates b/bin/get-package-updates
index f9ef9d6..a00e95c 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -106,16 +106,19 @@ if [ -s "${work_dir}/build-master-sanity" ]; then
fi
fi
-# delete_package arch package
+# delete_package arch package repository
# mark $arch/$package for deletion
delete_package() {
+ local architecture="$1"
+ local pkgbase="$2"
+ local repository="$3"
# shellcheck disable=SC2016
query_delete_packages=$(
printf '`architectures` AS `d_a`'
printf ' JOIN `architecture_compatibilities` AS `a_c`'
printf ' ON `a_c`.`runs_on`=`d_a`.`id`'
printf ' AND `d_a`.`name`=from_base64("%s")' \
- "$(printf '%s' "$1" | base64 -w0)"
+ "$(printf '%s' "${architecture}" | base64 -w0)"
printf ' JOIN `build_assignments`'
printf ' ON (`a_c`.`built_for`=`build_assignments`.`architecture`'
# "any" references all architectures, but this is not represented
@@ -125,9 +128,12 @@ delete_package() {
printf ' OR `d_a`.`name`="any")'
mysql_join_build_assignments_package_sources
printf ' AND `package_sources`.`pkgbase`=from_base64("%s")' \
- "$(printf '%s' "$2" | base64 -w0)"
+ "$(printf '%s' "${pkgbase}" | base64 -w0)"
mysql_join_build_assignments_binary_packages
mysql_join_binary_packages_binary_packages_in_repositories
+ mysql_join_package_sources_upstream_repositories
+ printf ' AND `upstream_repositories`.`name` LIKE from_base64("%s")' \
+ "$(printf '%s' "${repository}" | base64 -w0)"
)
# shellcheck disable=SC2016
{
@@ -334,8 +340,7 @@ echo 'Check modified packages from the last update, and put them to the build li
| while read -r mode git_revision pkgbase repository; do
if [ "${mode}" = '<' ]; then
if check_if_package_should_be_deleted "${pkgbase}" "${repository}"; then
- delete_package 'any' "${pkgbase}"
- # TODO: remove moved packages, too
+ delete_package 'any' "${pkgbase}" "${repository}"
fi
continue
fi
@@ -359,7 +364,7 @@ echo 'Check modified packages from the last update, and put them to the build li
' \
| while read -r mode repository pkgbase; do
if check_if_package_should_be_deleted "${pkgbase}" "${repository}"; then
- delete_package 'any' "${pkgbase}"
+ delete_package 'any' "${pkgbase}" "${repository}"
continue
else
mode='>'
@@ -447,7 +452,7 @@ git -C "${repo_paths__archlinux32}" archive "${new_repo_revisions__archlinux32}"
| join -1 1 -2 2 -o 2.1,2.2 "${tmp_dir}/modified-packages" - \
| sort -u \
| while read -r arch pkgbase; do
- delete_package "${arch}" "${pkgbase}"
+ delete_package "${arch}" "${pkgbase}" '%s'
done
echo 'Done - mark decisions as final.'