From 9a35ac9d475fd152bddec93ced225cd80da48330 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 16 Sep 2017 18:20:02 +0200 Subject: bin/why-dont-you: bugfix: consider dependencies (more) correctly --- bin/why-dont-you | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'bin/why-dont-you') diff --git a/bin/why-dont-you b/bin/why-dont-you index 5dcf243..1fc1382 100755 --- a/bin/why-dont-you +++ b/bin/why-dont-you @@ -60,16 +60,24 @@ case "${action}" in for pkg in "$@"; do - if ! find "${work_dir}/package-states" -maxdepth 1 | \ - grep -q "/$(str_to_regex "${pkg}")\(\.[^.]\+\)\{3\}\.done\$"; then + state_file=$( + find "${work_dir}/package-states" -maxdepth 1 -regextype grep \ + -regex ".*/$(str_to_regex "${pkg}")\(\.[^.]\+\)\{3\}\.done" \ + -printf '%f\n' | \ + sed 's|\.[^.]\+$||' + ) + if [ -z "${state_file}" ]; then printf '"%s" is not in staging!\n' "${pkg}" continue fi + generate_package_metadata "${state_file}" + dependent_packages=$( - grep -lxF "${pkg}" "${work_dir}/package-infos/"*".run-depends" | \ + find "${work_dir}/package-infos/" -maxdepth 1 -name '*.run-depends' \ + -exec grep -qxF "$(cat "${work_dir}/package-infos/${state_file}.builds")" '{}' \; \ + -printf '%f\n' | \ sed ' - s|^.*/|| s|\.run-depends$|| ' ) -- cgit v1.2.3-54-g00ecf