summaryrefslogtreecommitdiff
path: root/bin/return-assignment
diff options
context:
space:
mode:
Diffstat (limited to 'bin/return-assignment')
-rwxr-xr-xbin/return-assignment23
1 files changed, 14 insertions, 9 deletions
diff --git a/bin/return-assignment b/bin/return-assignment
index ec9ec56..96cec90 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -719,15 +719,20 @@ trigger_mirror_refreshs
printf ' ON `early`.`pkgbase`=`early_ps`.`pkgbase`'
mysql_join_package_sources_build_assignments 'early_ps' 'early_ba'
mysql_join_build_assignments_binary_packages 'early_ba' 'early_bp'
- mysql_join_binary_packages_binary_packages_in_repositories 'early_bp' 'early_bpir'
- printf ' AND `early_bpir`.`repository`=%s' \
- "${repository_ids__any_build_list}"
- printf ' WHERE `early_bp`.`architecture`=`binary_packages`.`architecture`'
- # shellcheck disable=SC2154
- printf ' OR `%s`.`architecture`=%s' \
- 'early_bp' "${architecture_ids__any}" \
- 'binary_packages' "${architecture_ids__any}"
- printf ';\n'
+ printf ' WHERE ('
+ printf '`early_bp`.`architecture`=`binary_packages`.`architecture`'
+ # shellcheck disable=SC2154
+ printf ' OR `%s`.`architecture`=%s' \
+ 'early_bp' "${architecture_ids__any}" \
+ 'binary_packages' "${architecture_ids__any}"
+ printf ') AND NOT EXISTS ('
+ printf 'SELECT 1'
+ printf ' FROM `binary_packages` AS `early_bp`'
+ mysql_join_binary_packages_binary_packages_in_repositories 'early_bp' 'early_bpir'
+ mysql_join_binary_packages_in_repositories_repositories 'early_bpir' 'early_r'
+ printf ' WHERE `early_r`.`is_on_master_mirror`'
+ printf ' AND `early_bp`.`build_assignment`=`early_ba`.`id`'
+ printf ');\n'
join_part=$(
printf ' JOIN `pkg_hashes`'