summaryrefslogtreecommitdiff
path: root/include/tree.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-08-10 14:12:48 +0100
committerLeah Rowe <leah@libreboot.org>2025-08-10 14:12:48 +0100
commit2c24b94d80350b11ab34ef783c3822af6b24e1c8 (patch)
treee06db775dd21851385ef101ddd0fd98c2ad5162c /include/tree.sh
parentef79b1108294cad62d90d02a598c18b64f1632db (diff)
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 <leah@libreboot.org>
Diffstat (limited to 'include/tree.sh')
-rw-r--r--include/tree.sh18
1 files changed, 6 insertions, 12 deletions
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"