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.
This commit is contained in:
@@ -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#[}"
|
||||
|
||||
Reference in New Issue
Block a user