index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | bin/get-package-updates | 30 |
diff --git a/bin/get-package-updates b/bin/get-package-updates index fe1bd81..6599d7d 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -544,27 +544,43 @@ echo 'Done - mark decisions as final.' # shellcheck disable=SC2016 { # save blacklist into database - printf 'CREATE TEMPORARY TABLE `bl` (`pkgbase` VARCHAR(64), `reason` TEXT);\n' + printf 'CREATE TEMPORARY TABLE `blacklist` (`arch` VARCHAR(16), `pkgbase` VARCHAR(64), `reason` TEXT);\n' git -C "${repo_paths__archlinux32}" archive "${new_repo_revisions__archlinux32}" -- 'blacklist' | \ tar -Ox 'blacklist' | \ sed -n ' - s/^\(\S\+\)\s*#\s*/\1 / + s/^\(\S\+\)\s\+\(\S\+\)\s*#\s*/\1 \2 / T p ' | \ - while read -r pkgbase reason; do - printf '(from_base64("%s"),from_base64("%s")),\n' \ + while read -r arch pkgbase reason; do + printf '(from_base64("%s"),from_base64("%s"),from_base64("%s")),\n' \ + "$(printf '%s' "${arch}" | base64 -w0)" \ "$(printf '%s' "${pkgbase}" | base64 -w0)" \ "$(printf '%s' "${reason}" | base64 -w0)" done | \ sed ' - 1 i INSERT INTO `bl` (`pkgbase`,`reason`) VALUES + 1 i INSERT INTO `blacklist` (`arch`,`pkgbase`,`reason`) VALUES $ s/,$/;/ ' printf 'UPDATE `build_assignments`' mysql_join_build_assignments_package_sources - printf ' LEFT JOIN `bl` ON `package_sources`.`pkgbase`=`bl`.`pkgbase`' - printf ' SET `build_assignments`.`is_black_listed`=`bl`.`reason`;\n' + printf ' JOIN `architecture_compatibilities`' + printf ' ON `build_assignments`.`architecture`=`architecture_compatibilities`.`built_for`' + printf ' LEFT JOIN (' + printf 'SELECT ' + printf '`blacklist`.`pkgbase`,' + printf '`blacklist`.`reason`,' + printf '`architectures`.`id` AS `arch`' + printf ' FROM `blacklist`' + printf ' JOIN `architectures`' + printf ' ON `architectures`.`name`=`blacklist`.`arch`' + printf ') AS `bl` ON `package_sources`.`pkgbase`=`bl`.`pkgbase`' + printf ' AND (' + printf '`architecture_compatibilities`.`runs_on`=`bl`.`arch`' + # shellcheck disable=SC2154 + printf ' OR `bl`.`arch`=%s' \ + "${architecture_ids__any}" + printf ') SET `build_assignments`.`is_black_listed`=`bl`.`reason`;\n' printf 'DROP TEMPORARY TABLE `bl`;\n' printf 'COMMIT;\n' |