diff --git a/local/scripts/rebuild-cascade.sh b/local/scripts/rebuild-cascade.sh index 73f68d4395..dd16f1999b 100755 --- a/local/scripts/rebuild-cascade.sh +++ b/local/scripts/rebuild-cascade.sh @@ -146,6 +146,11 @@ find_reverse_deps() { local target="$1" local result=() + # Empty target would match every empty-deps entry — reject early. + if [ -z "${target}" ]; then + return 0 + fi + local pkg_name entry for pkg_name in "${!recipe_index[@]}"; do if [ "${pkg_name}" = "${target}" ]; then @@ -159,7 +164,9 @@ find_reverse_deps() { fi done - printf '%s\n' "${result[@]}" | sort -u + if [ ${#result[@]} -gt 0 ]; then + printf '%s\n' "${result[@]}" | sort -u + fi } # Validate that the requested package names exist in the index