diff --git a/local/scripts/rebuild-cascade.sh b/local/scripts/rebuild-cascade.sh index dd16f1999b..858b2e22c5 100755 --- a/local/scripts/rebuild-cascade.sh +++ b/local/scripts/rebuild-cascade.sh @@ -79,24 +79,35 @@ extract_recipe_deps() { return fi - # Multi-line dependencies = [ ... ] extraction. Handles `]` on its own line. + # Both [package] and [build] sections contribute deps. The cookbook's + # get_build_deps_recursive() walks both; this script must match. + local in_section="" local in_deps=0 while IFS= read -r line; do + if [[ "${line}" =~ ^[[:space:]]*\[([^]]+)\][[:space:]]*$ ]]; then + local sect="${BASH_REMATCH[1]// /}" + if [ "${sect}" = "package" ] || [ "${sect}" = "build" ]; then + in_section="${sect}" + else + in_section="" + fi + in_deps=0 + continue + fi + [ -z "${in_section}" ] && continue + if [ "${in_deps}" = 1 ]; then - # Strip whitespace, quotes, trailing commas local item="${line}" item="${item## }"; item="${item%% }" item="${item#\"}"; item="${item%\"}" item="${item%,}" [ -n "${item}" ] && deps+="${item}," - # Section closes on a line that is just `]` or contains `]` if [[ "${line}" =~ ^[[:space:]]*\] ]]; then in_deps=0 fi continue fi - # Check if this line starts `dependencies = [` - if [[ "${line}" =~ ^[[:space:]]*dependencies[[:space:]]*=[[:space:]]*\[ ]]; then + if [[ "${line}" =~ ^[[:space:]]*(dependencies|dev_dependencies)[[:space:]]*=[[:space:]]*\[ ]]; then in_deps=1 local inline="${line#*=}" inline="${inline#[}"