summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-06 11:44:27 +0100
committerErich Eckner <git@eckner.net>2018-02-06 11:44:27 +0100
commitaa1158a7f261100312057c94bfb40553c52296a6 (patch)
treeb6b048876484cbbd99fc5b3f6c64154cda142e4a
parente2ca9121e30856651afef3c6396175dca1f6bd91 (diff)
downloadbuilder-aa1158a7f261100312057c94bfb40553c52296a6.tar.xz
bin/show-dependencies: read some information from db
-rwxr-xr-xbin/show-dependencies30
1 files changed, 22 insertions, 8 deletions
diff --git a/bin/show-dependencies b/bin/show-dependencies
index ee7db19..450120f 100755
--- a/bin/show-dependencies
+++ b/bin/show-dependencies
@@ -9,21 +9,35 @@
if [ $# -eq 0 ]; then
broken=$(
- find "${work_dir}/package-states" -maxdepth 1 -name '*.broken' -printf '%f\n' | \
- sed 's|\(\.[^.]\+\)\{4\}$||' | \
+ # shellcheck disable=SC2016
+ {
+ printf 'SELECT `package_sources`.`pkgbase`'
+ printf ' FROM `package_sources`'
+ printf ' JOIN `build_assignments` ON `build_assignments`.`package_source`=`package_sources`.`id`'
+ printf ' WHERE `build_assignments`.`is_broken`'
+ } | \
+ ${mysql_command} --raw --batch | \
+ sed '1d' | \
sort -u
)
new_sum='x'
sum=''
tmp_dir=$(mktemp -d 'tmp.show-dependencies.0.XXXXXXXXXX' --tmpdir)
trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT
- find "${work_dir}/package-infos" -maxdepth 1 -name '*.builds' -exec \
- grep -HF '' {} \; | \
+ # shellcheck disable=SC2016
+ {
+ printf 'SELECT DISTINCT `package_sources`.`pkgbase`,`binary_packages`.`pkgname`'
+ printf ' FROM `binary_packages`'
+ printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \
+ 'build_assignments' 'build_assignments' 'binary_packages' 'build_assignment' \
+ 'package_sources' 'package_sources' 'build_assignments' 'package_source'
+ printf ' ORDER BY `binary_packages`.`pkgname`'
+ } | \
+ ${mysql_command} --raw --batch | \
sed '
- s|^.*/||
- s|\(\.[^.]\+\)\{4\}:| |
- ' | \
- sort -k2,2 > \
+ 1d
+ y/\t/ /
+ ' > \
"${tmp_dir}/builds"
while ! [ "${new_sum}" = "${sum}" ]; do
sum="${new_sum}"