summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-07-19 00:31:57 +0100
committerLeah Rowe <leah@libreboot.org>2024-07-19 00:37:11 +0100
commit2b50b3ea9a11b6ba2751ebb4237f0ea7288e5c81 (patch)
tree78272735f8a19e23c84ab720980d54d16f6244b0 /script
parent0e0b12a630d2f4846488233cf33fe4abaa185112 (diff)
put cachedir in environmental variable
XBMK_CACHE is now used, instead of hardcoding cache/ this is exported initialised to cache/, if unset. this means you can set your own directory, and it means ./update release will use the same directory. this means bandwidth wastage is further avoided. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script')
-rwxr-xr-xscript/trees12
1 files changed, 6 insertions, 6 deletions
diff --git a/script/trees b/script/trees
index 2cee435d..ce6da422 100755
--- a/script/trees
+++ b/script/trees
@@ -165,11 +165,11 @@ build_dependencies()
check_project_hashes()
{
- x_ mkdir -p cache/hash
+ mkdir -p "$XBMK_CACHE/hash" || $err "!mkdir '$XBMK_CACHE/hash'"
old_pjhash=""
- [ ! -f "cache/hash/$project$tree" ] || \
- read -r old_pjhash < "cache/hash/$project$tree"
+ [ ! -f "$XBMK_CACHE/hash/$project$tree" ] || \
+ read -r old_pjhash < "$XBMK_CACHE/hash/$project$tree"
x_ rm -f "$TMPDIR/project.list" "$TMPDIR/project.hash" \
"$TMPDIR/project.tmp"; x_ touch "$TMPDIR/project.tmp"
@@ -192,10 +192,10 @@ check_project_hashes()
pjhash="$(sha512sum "$TMPDIR/project.hash" | awk '{print $1}')" || :
badhash="y" && [ "$pjhash" = "$old_pjhash" ] && badhash="n"
- [ -f "cache/hash/$project$tree" ] || badhash="y"
+ [ -f "$XBMK_CACHE/hash/$project$tree" ] || badhash="y"
- printf "%s\n" "$pjhash" > "cache/hash/$project$tree" || \
- $err "!mk cache/hash/$project$tree"
+ printf "%s\n" "$pjhash" > "$XBMK_CACHE/hash/$project$tree" || \
+ $err "!mk $XBMK_CACHE/hash/$project$tree"
[ "$badhash" = "n" ] || rm -Rf "src/$project/$tree" \
"elf/$project/$tree" "elf/$project/$target" || \