From a3888e3b4c363d7159e0274e75ecc7c7a9f3be1b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 23 Mar 2018 10:37:08 +0100 Subject: bin/get-package-updates: save black-list(-reason) in database --- bin/get-package-updates | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/bin/get-package-updates b/bin/get-package-updates index f4c53b4..1b01087 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -454,6 +454,30 @@ echo 'Done - mark decisions as final.' # shellcheck disable=SC2016 { + # save blacklist into database + printf 'CREATE TEMPORARY TABLE `bl` (`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 / + T + p + ' | \ + while read -r pkgbase reason; do + printf '(from_base64("%s"),from_base64("%s")),\n' \ + "$(printf '%s' "${pkgbase}" | base64 -w0)" \ + "$(printf '%s' "${reason}" | base64 -w0)" + done | \ + sed ' + 1 i INSERT INTO `bl` (`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 'DROP TEMPORARY TABLE `bl`;\n' + # update hashes of repositories in mysql database for repo in ${repo_names}; do printf 'UPDATE `git_repositories`' -- cgit v1.2.3-70-g09d2