tree.sh: add error check in check_project_hashes()

when reading old_pjhash, we need to error out where a read
error occurs. such an error is unlikely, but could occur under
certain edge cases.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-28 18:38:23 +01:00
parent 677dfc4d10
commit 04bee3834d
+2 -1
View File
@@ -177,7 +177,8 @@ check_project_hashes()
{
old_pjhash="" && x_ mkdir -p "$XBMK_CACHE/hash"
[ ! -f "$XBMK_CACHE/hash/$project$tree" ] || \
read -r old_pjhash < "$XBMK_CACHE/hash/$project$tree"
read -r old_pjhash < "$XBMK_CACHE/hash/$project$tree" || \
err "old_pjhash: Can't read '$XBMK_CACHE/hash/$project$tree'"
fx_ "x_ sha512sum" find "$datadir" "$configdir/$tree" "$mdir" \
-type f -not -path "*/.git*/*" | awk '{print $1}' > \