From 04c979942280146ae838af156e2e048ef40c35c3 Mon Sep 17 00:00:00 2001 From: Admin Pupkin Date: Thu, 11 Jun 2026 20:13:23 +0300 Subject: [PATCH] rebuild-cascade: walk [build].dependencies and [build].dev_dependencies Previously the script only parsed [package].dependencies, missing the build-time-only consumers that the cookbook's get_build_deps_recursive() picks up via [build].{dependencies, dev_dependencies}. This caused 'rebuild-cascade.sh relibc' to report 'nothing to do' even though the cookbook correctly identifies uutils, libpciaccess, relibc-tests, and other packages as relibc build-dep consumers and rebuilds them under 'make live'. The fix is to also walk the [build] section. The cookbook's own parser uses the same convention. --- local/scripts/rebuild-cascade.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) 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#[}"