From 12063e276f9d19e52a0f9fa5f7bafbd74a1b9ada Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 26 Feb 2020 14:31:00 +0100 Subject: bin/why-dont-you: add responses in case of no other responses --- bin/why-dont-you | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/why-dont-you b/bin/why-dont-you index 61eae34..e6a0deb 100755 --- a/bin/why-dont-you +++ b/bin/why-dont-you @@ -212,6 +212,8 @@ case "${action}" in fi for pkgname in "$@"; do + printf 'Cannot find package "%s"\n' "${pkgname}" \ + > "${tmp_dir}/error" # shellcheck disable=SC2016 { printf 'SELECT' @@ -242,6 +244,7 @@ case "${action}" in } \ | mysql_run_query 'unimportant' \ | while read -r bpir tested issues; do + rm -f "${tmp_dir}/error" if [ "${tested}" = '0' ]; then printf '"%s" is not tested.\n' \ "${pkgname}" @@ -255,6 +258,9 @@ case "${action}" in printf '%s\n' "${bpir}" \ >> "${tmp_dir}/packages" done + if [ -s "${tmp_dir}/error" ]; then + cat "${tmp_dir}/error" + fi done if [ ! -s "${tmp_dir}/packages" ]; then @@ -358,7 +364,9 @@ case "${action}" in printf ') AS `sub_q`' printf ' GROUP BY `sub_q`.`id`;\n' } \ - | mysql_run_query 'unimportant' + | mysql_run_query 'unimportant' \ + | grep -F '' \ + || echo 'This should be a no-brainer.' ;; -- cgit v1.2.3-70-g09d2