From ff3505d935d41b430414ce7d080c23459213b0b5 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 8 Jul 2023 11:46:17 +0200 Subject: schedule-for-rebuild: use correct revisions * use null-revisions, if this part is not needed, otherwise make_source_info et al. will fail --- bin/schedule-for-rebuild | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/schedule-for-rebuild b/bin/schedule-for-rebuild index 1998f40..de2d733 100755 --- a/bin/schedule-for-rebuild +++ b/bin/schedule-for-rebuild @@ -208,7 +208,16 @@ if [ -s "${tmp_dir}/package-regexes" ]; then printf 'SELECT DISTINCT ' printf '"any",' printf '`package_sources`.`pkgbase`,' - printf '`package_sources`.`git_revision`,' + printf 'IF(' + printf '`package_sources`.`uses_upstream`,' + printf '`package_sources`.`git_revision`,' + printf '"0000000000000000000000000000000000000000"' + printf '),' + printf 'IF(' + printf '`package_sources`.`uses_modification`,' + printf '`package_sources`.`mod_git_revision`,' + printf '"0000000000000000000000000000000000000000"' + printf '),' printf '`upstream_repositories`.`name`' printf ' FROM `names`' printf ' JOIN `package_sources`' @@ -219,7 +228,16 @@ if [ -s "${tmp_dir}/package-regexes" ]; then printf 'SELECT DISTINCT ' printf '"any",' printf '`package_sources`.`pkgbase`,' - printf '`package_sources`.`git_revision`,' + printf 'IF(' + printf '`package_sources`.`uses_upstream`,' + printf '`package_sources`.`git_revision`,' + printf '"0000000000000000000000000000000000000000"' + printf '),' + printf 'IF(' + printf '`package_sources`.`uses_modification`,' + printf '`package_sources`.`mod_git_revision`,' + printf '"0000000000000000000000000000000000000000"' + printf '),' printf '`upstream_repositories`.`name`' printf ' FROM `binary_packages`' mysql_join_binary_packages_build_assignments @@ -365,7 +383,16 @@ if ${auto}; then printf 'SELECT DISTINCT ' printf '`ba_a`.`name`,' printf '`package_sources`.`pkgbase`,' - printf '`package_sources`.`git_revision`,' + printf 'IF(' + printf '`package_sources`.`uses_upstream`,' + printf '`package_sources`.`git_revision`,' + printf '"0000000000000000000000000000000000000000"' + printf '),' + printf 'IF(' + printf '`package_sources`.`uses_modification`,' + printf '`package_sources`.`mod_git_revision`,' + printf '"0000000000000000000000000000000000000000"' + printf '),' printf '`upstream_repositories`.`name`' printf ' FROM `least_stable_bp`' printf ' JOIN `binary_packages`' @@ -446,14 +473,14 @@ sort -u "${tmp_dir}/pkgbases" \ # get the current HEADs if ${update}; then - cut -d' ' -f 2,3,4 "${tmp_dir}/pkgbases" \ + cut -d' ' -f 2,3,4,5 "${tmp_dir}/pkgbases" \ | sort -u \ - | while read -r pkgbase git_rev repo; do + | while read -r pkgbase git_rev git_mod_rev repo; do success=false # shellcheck disable=SC2154 - printf '%s ' "${pkgbase}" "${git_rev}" "${repo_heads__archlinux32}" "${repo}" \ + printf '%s ' "${pkgbase}" "${git_rev}" "${git_mod_rev}" "${repo_heads__archlinux32}" "${repo}" \ | sed 's/ $/\n/' - if ! mysql_generate_package_metadata "${repository_ids__any_build_list}" "${pkgbase}" "${git_rev}" "${repo_heads__archlinux32}" "${repo}" && \ + if ! mysql_generate_package_metadata "${repository_ids__any_build_list}" "${pkgbase}" "${git_rev}" "${git_mod_rev}" "${repo}" && \ ! ${ignore_mysql_generate_package_metadata_errors}; then exit 2 fi -- cgit v1.2.3-70-g09d2