summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-14 15:00:15 +0200
committerErich Eckner <git@eckner.net>2017-06-14 15:00:15 +0200
commit0895111b46d714365d5189b2652ffc246e43ba9d (patch)
treeba8cce9da382bcf60e35031a3ef7f66cf945c1c6
parenta728101d7d037f3b875c616f772160dae9d3fbce (diff)
downloadbuilder-0895111b46d714365d5189b2652ffc246e43ba9d.tar.xz
bin/why_dont_you_build new - a script to diagnose the reason for not handing out a specific build assignment
-rwxr-xr-xbin/why_dont_you_build63
1 files changed, 63 insertions, 0 deletions
diff --git a/bin/why_dont_you_build b/bin/why_dont_you_build
new file mode 100755
index 0000000..714816a
--- /dev/null
+++ b/bin/why_dont_you_build
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+# investigate, why a certain package is not being built
+
+. "${0%/*}/../conf/default.conf"
+
+for pkg in "$@"; do
+ grep "^${pkg//./\\.} " "${work_dir}/build-list" | \
+ while read -r package git_revision mod_git_revision repository; do
+
+ if [ -f "${work_dir}/${package}.${git_revision}.${mod_git_revision}.${repository}.done" ] ||
+ [ -f "${work_dir}/${package}.${git_revision}.${mod_git_revision}.${repository}.testing" ]; then
+ echo 'has been built'
+ continue
+ fi
+
+ if package_locked_broken_or_blocked "${package}" "${git_revision}" "${mod_git_revision}" "${repository}"; then
+ echo 'is locked, broken or blocked'
+ continue
+ fi
+
+ if [ -n "$(
+ (
+ cat "${work_dir}/package-infos/${package}.${git_revision}.${mod_git_revision}.needs"
+ awk '{print $1 "." $2 "." $3}' "${work_dir}/build-list" | \
+ sed "
+ s|^|${work_dir}/package-infos/|
+ s|\$|\.builds|
+ " | \
+ xargs -r cat | \
+ sort -u
+ ) | \
+ sort | \
+ uniq -d
+ )" ]; then
+ echo 'has unmet dependencies:'
+ (
+ cat "${work_dir}/package-infos/${package}.${git_revision}.${mod_git_revision}.needs"
+ awk '{print $1 "." $2 "." $3}' "${work_dir}/build-list" | \
+ sed "
+ s|^|${work_dir}/package-infos/|
+ s|\$|\.builds|
+ " | \
+ xargs -r cat | \
+ sort -u
+ ) | \
+ sort | \
+ uniq -d | \
+ while read -r dep; do
+ grep -Fx "${dep}" "${work_dir}/package-infos/"*".builds" | \
+ cut -d: -f1 | \
+ xargs -rn1 basename | \
+ cut -d. -f1
+ done | \
+ sort -u
+
+ continue
+ fi
+
+ echo 'would be built'
+ done
+
+done