summaryrefslogtreecommitdiff
path: root/include/tree.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-05-28 18:38:23 +0100
committerLeah Rowe <leah@libreboot.org>2025-06-05 23:41:03 +0100
commit04bee3834d031b1b9209f53112367a46d0c7606f (patch)
tree0724d08f4381e526b2602532aef86dac8ebfaa17 /include/tree.sh
parent677dfc4d103f01b2d6c3b9d9b92011523e248308 (diff)
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>
Diffstat (limited to 'include/tree.sh')
-rw-r--r--include/tree.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/tree.sh b/include/tree.sh
index df03333f..6afba6f4 100644
--- a/include/tree.sh
+++ b/include/tree.sh
@@ -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}' > \