From 2c24b94d80350b11ab34ef783c3822af6b24e1c8 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 10 Aug 2025 14:12:48 +0100 Subject: tree.sh: rename function and remove comments the new function names make the comments redundant. the code is now self-explanatory. Signed-off-by: Leah Rowe --- include/tree.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/tree.sh b/include/tree.sh index ed361623..68cf0c61 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -153,7 +153,7 @@ configure_project() mdir="$xbmkpwd/config/submodule/$project" [ -n "$tree" ] && mdir="$mdir/$tree" - [ -f "CHANGELOG" ] || check_project_hashes + [ -f "CHANGELOG" ] || delete_old_project_files if [ "$do_make" = "n" ]; then [ -f "CHANGELOG" ] || fetch_${cmd#build_} @@ -173,23 +173,17 @@ build_dependencies() done; : } -# get sha512sums of project-related files, concatenate and then -# get a sha512sum of *that*; cache and re-check to detect changes -check_project_hashes() +delete_old_project_files() { - # delete project source tree, if it changes; works for both - # single and multi-tree, since "tree" will be blank on single-tree - check_hashes hash "$tree" badhash "$datadir" "$configdir/$tree" \ + project_up_to_date hash "$tree" badhash "$datadir" "$configdir/$tree" \ "$mdir" || x_ rm -Rf "src/$project/$tree" "elf/$project/$tree"; : - # check only the given target; delete only the target build - # if that's all that changed (not applicable to single-tree) singletree "$project" || [ -z "$target" ] || [ "$target" = "$tree" ] \ - || check_hashes tghash "$target" badtghash "$configdir/$target" \ - || x_ rm -Rf "elf/$project/$tree/$target"; : + || project_up_to_date tghash "$target" badtghash \ + "$configdir/$target" || x_ rm -Rf "elf/$project/$tree/$target"; : } -check_hashes() +project_up_to_date() { eval "`setvars "" old_hash hash`" hashname="$1" -- cgit v1.2.1