summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-03-23 10:37:08 +0100
committerErich Eckner <git@eckner.net>2018-03-23 10:37:08 +0100
commita3888e3b4c363d7159e0274e75ecc7c7a9f3be1b (patch)
treed579d8cdbb18591cd27af6cad5d42ad836a7d446 /bin
parent3682408492801e1325f742267394db7cca7f2339 (diff)
downloadbuilder-a3888e3b4c363d7159e0274e75ecc7c7a9f3be1b.tar.xz
bin/get-package-updates: save black-list(-reason) in database
Diffstat (limited to 'bin')
-rwxr-xr-xbin/get-package-updates24
1 files changed, 24 insertions, 0 deletions
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`'