From 40ff3da46482c7a3992096a193bd4f704a65a120 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 29 Jul 2017 20:35:37 +0200 Subject: new routine to find dependencies on the build list: "find_dependencies_on_build_list" --- bin/common-functions | 28 ++++++++++++++++++++++++++++ bin/get-assignment | 18 +++--------------- bin/why_dont_you | 16 +--------------- 3 files changed, 32 insertions(+), 30 deletions(-) (limited to 'bin') diff --git a/bin/common-functions b/bin/common-functions index d251741..923fbb0 100755 --- a/bin/common-functions +++ b/bin/common-functions @@ -642,3 +642,31 @@ extract_source_directory() { sed -i '/^\$Id\$$/d' "${output}/PKGBUILD" } + +# find_dependencies_on_build_list $package $git_revision $mod_git_revision $repository +# return a list of packages on the build list which are dependencies of the given package + +find_dependencies_on_build_list() { + + local package="$1" + local git_revision="$2" + local mod_git_revision="$3" + local repository="$4" + + generate_package_metadata "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" + + ( + cat "${work_dir}/package-infos/${package}.${git_revision}.${mod_git_revision}.${repository}.needs" + grep -vxF 'break_loops' "${work_dir}/build-list" | \ + awk '{print $1 "." $2 "." $3 "." $4}' | \ + sed " + s|^|${work_dir}/package-infos/| + s|\$|\.builds| + " | \ + xargs -r cat | \ + sort -u + ) | \ + sort | \ + uniq -d + +} diff --git a/bin/get-assignment b/bin/get-assignment index d426988..1b2a00d 100755 --- a/bin/get-assignment +++ b/bin/get-assignment @@ -144,21 +144,9 @@ for hand_out_broken in false true; do continue fi - [ -z "$( - ( - cat "${work_dir}/package-infos/${package}.${git_revision}.${mod_git_revision}.${repository}.needs" - grep -vxF 'break_loops' "${work_dir}/build-list" | \ - awk '{print $1 "." $2 "." $3 "." $4}' | \ - sed " - s|^|${work_dir}/package-infos/| - s|\$|\.builds| - " | \ - xargs -r cat | \ - sort -u - ) | \ - sort | \ - uniq -d - )" ] || continue + if [ -n "$(find_dependencies_on_build_list "${package}" "${git_revision}" "${mod_git_revision}" "${repository}")" ]; then + continue + fi hand_out_assignment "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" diff --git a/bin/why_dont_you b/bin/why_dont_you index 401d1ed..51f2e4a 100755 --- a/bin/why_dont_you +++ b/bin/why_dont_you @@ -26,21 +26,7 @@ case "${action}" in continue fi - unmet_dependencies="$( - ( - cat "${work_dir}/package-infos/${package}.${git_revision}.${mod_git_revision}.${repository}.needs" - grep -vxF 'break_loops' "${work_dir}/build-list" | \ - awk '{print $1 "." $2 "." $3 "." $4}' | \ - sed " - s|^|${work_dir}/package-infos/| - s|\$|\.builds| - " | \ - xargs -r cat | \ - sort -u - ) | \ - sort | \ - uniq -d - )" + unmet_dependencies="$(find_dependencies_on_build_list "${package}" "${git_revision}" "${mod_git_revision}" "${repository}")" if [ -n "${unmet_dependencies}" ]; then printf '"%s" has unmet dependencies:\n' "${package}" echo "${unmet_dependencies}" | \ -- cgit v1.2.3-70-g09d2