From 765f9b249eed27f2b441107de8e2ebcbcbf874b4 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 8 Feb 2018 16:36:00 +0100 Subject: bin/get-package-updates: create metadata for _new_ build list packages --- bin/get-package-updates | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/bin/get-package-updates b/bin/get-package-updates index 4fcefd9..a98c9ee 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -355,11 +355,48 @@ echo 'Extract dependencies of packages.' mkdir -p "${work_dir}/package-infos" while read -r package git_revision mod_git_revision repository; do - generate_package_metadata "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" - done < "${work_dir}/build-list.new" +{ + # shellcheck disable=SC2016 + { + printf 'SELECT DISTINCT ' + printf 'replace(to_base64(`package_sources`.`%s`),"\\n",""),' \ + 'pkgbase' 'git_revision' 'mod_git_revision' + printf 'replace(to_base64(`upstream_repositories`.`name`),"\\n","")' + printf ' FROM `binary_packages`' + printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \ + 'repositories' 'repositories' 'binary_packages' 'repository' \ + 'build_assignments' 'build_assignments' 'binary_packages' 'build_assignment' \ + 'package_sources' 'package_sources' 'build_assignments' 'package_source' \ + 'upstream_repositories' 'upstream_repositories' 'package_sources' 'upstream_package_repository' + printf ' WHERE `repositories`.`name` in ("build-list","deletion-list")' + } | \ + ${mysql_command} --raw --batch | \ + sed ' + 1d + ' | \ + while read -r a b c d; do + printf '%s ' \ + "$(printf '%s' "${a}" | base64 -d)" \ + "$(printf '%s' "${b}" | base64 -d)" \ + "$(printf '%s' "${c}" | base64 -d)" \ + "$(printf '%s' "${d}" | base64 -d)" | \ + sed 's/ /\n/' + done | \ + sed ' + y/\t/ / + p + ' + cat "${work_dir}/build-list.new" +} | \ + sort | \ + uniq -u | \ + while read -r package git_revision mod_git_revision repository; do + mysql_generate_package_metadata "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" + done + echo 'apply blacklisting' # ignore blacklisted packages and dependent packages # this is the first time when all the information is available and up to date -- cgit v1.2.3-70-g09d2