summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-05-28 18:43:44 +0100
committerLeah Rowe <leah@libreboot.org>2025-05-28 18:43:44 +0100
commit56225e7508fceab1bf1c03b614f85ae60b05229d (patch)
tree8c412a989026a2a1fa3f0e4e2db413d8739d6257
parentdb65a5d9278775992954bf765bd23bcaa5bd4e4b (diff)
tree.sh: add sha512 error for check_project_hashesHEADmaster
handle errors on sha512sum - also handle awk errors inside the mini subshell, and provide overall error handling. we know that the project.hash file should always exist, and always be read no matter what; technically, the find command that proceeds it might not yield any results, but an empty file would then be produced. the edge case of an empty file would have lead to an error beforehand, when configuring the project in function, configure_project(), so we've already got that covered. Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/tree.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/tree.sh b/include/tree.sh
index 3e80c333..f945cc7c 100644
--- a/include/tree.sh
+++ b/include/tree.sh
@@ -174,7 +174,8 @@ check_project_hashes()
-type f -not -path "*/.git*/*" | awk '{print $1}' > \
"$xbtmp/project.hash" || err "!h $project $tree"
- pjhash="$(sha512sum "$xbtmp/project.hash" | awk '{print $1}')" || :
+ pjhash="$(x_ sha512sum "$xbtmp/project.hash" | awk '{print $1}' || \
+ err)" || err "pjhash: Can't read sha512 of '$xbtmp/project.hash'"
[ "$pjhash" != "$old_pjhash" ] && badhash="y"
[ -f "$XBMK_CACHE/hash/$project$tree" ] || badhash="y"