From 846f000605d39adb4bc4e72e4ebb92760c46be2a Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 13 Feb 2018 20:55:57 +0100 Subject: bin/build-master-status-from-mysql: only check dependencies of package sources which have binary packages currently (real or virtual) --- bin/build-master-status-from-mysql | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'bin/build-master-status-from-mysql') diff --git a/bin/build-master-status-from-mysql b/bin/build-master-status-from-mysql index 6f5dea1..cd85156 100755 --- a/bin/build-master-status-from-mysql +++ b/bin/build-master-status-from-mysql @@ -207,13 +207,32 @@ find "${work_dir}/package-states" -mindepth 1 -maxdepth 1 \ "${tmp_dir}/build-dependencies.mysql" { cat "${tmp_dir}/build-dependencies.mysql" - # TODO: consider versions dependencies, too - find "${work_dir}/package-infos" -name '*.build-depends' \ - -exec grep -Hv '[<=>]' {} \; | \ + # shellcheck disable=SC2016 + { + printf 'SELECT DISTINCT ' + printf '`package_sources`.`%s`,' \ + 'pkgbase' 'git_revision' 'mod_git_revision' + printf '`upstream_repositories`.`name`' + printf ' FROM `upstream_repositories`' + printf ' JOIN `%s` ON `%s`.`%s`=`%s`.`id`' \ + 'package_sources' 'package_sources' 'upstream_package_repository' 'upstream_repositories' \ + 'build_assignments' 'build_assignments' 'package_source' 'package_sources' \ + 'binary_packages' 'binary_packages' 'build_assignment' 'build_assignments' + } | \ + ${mysql_command} --raw --batch | \ sed ' - s,^.*/,, - s/\.\([^.]\+\)\.\([^.]\+\)\.\([^.:]\+\)\.build-depends:\([^:]\+\)$/ \1 \2 \3 \4/ - ' + 1d + y/\t/ / + ' | \ + while read -r pkgbase git_revision mod_git_revision repository; do + if [ -f "${work_dir}/package-infos/${pkgbase}.${git_revision}.${mod_git_revision}.${repository}.build-depends" ]; then + # TODO: consider versions dependencies, too + grep -v '[<=>]' "${work_dir}/package-infos/${pkgbase}.${git_revision}.${mod_git_revision}.${repository}.build-depends" | \ + sed ' + s/^/'"${pkgbase} ${git_revision} ${mod_git_revision} ${repository}"' / + ' + fi + done } | \ sort -u > \ "${tmp_dir}/build-dependencies.file" -- cgit v1.2.3-70-g09d2