summaryrefslogtreecommitdiff
path: root/bin/build-master-status-from-mysql
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-13 20:55:57 +0100
committerErich Eckner <git@eckner.net>2018-02-13 20:55:57 +0100
commit846f000605d39adb4bc4e72e4ebb92760c46be2a (patch)
tree42884a3c7b007b0e9a02c16f5a7f75c6b4d1e04d /bin/build-master-status-from-mysql
parent98e596252854ad77272b264e8124259bb141c5fb (diff)
downloadbuilder-846f000605d39adb4bc4e72e4ebb92760c46be2a.tar.xz
bin/build-master-status-from-mysql: only check dependencies of package sources which have binary packages currently (real or virtual)
Diffstat (limited to 'bin/build-master-status-from-mysql')
-rwxr-xr-xbin/build-master-status-from-mysql31
1 files changed, 25 insertions, 6 deletions
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"