don't use /tmp/ for git clones. use tmp/ instead.

the /tmp/ file system may be a tmpfs, with conservative
memory limits, depending on host system.

it's more likely that the user will have enough disk space
under tmp/ within lbmk (if they don't, they can't use
lbmk anyway). that is to say: more likely that they would
have the disk space, but not the memory.

Signed-off-by: Leah Rowe <leah@libreboot.org>
btrfsvols
Leah Rowe 2023-09-04 21:43:03 +01:00
parent 196f293a27
commit bdf171e3ec
1 changed files with 3 additions and 2 deletions

View File

@ -12,7 +12,7 @@ revision=""
location="" location=""
url="" url=""
bkup_url="" bkup_url=""
tmp_dir="" tmp_dir="tmp/gitclone"
depend="" depend=""
main() main()
@ -70,7 +70,8 @@ verify_config()
clone_project() clone_project()
{ {
tmp_dir=$(mktemp -dt "${name}_XXXXX") rm -Rf "${tmp_dir}" || fail "clone_project: cannot remove old tmpdir"
mkdir -p "${tmp_dir%/*}" || fail "clone_project: can't mkdir"
git clone ${url} "${tmp_dir}" || git clone ${bkup_url} "${tmp_dir}" || \ git clone ${url} "${tmp_dir}" || git clone ${bkup_url} "${tmp_dir}" || \
fail "clone_project: could not download ${name}" fail "clone_project: could not download ${name}"