mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-22 05:00:08 +02:00
gitclone: always clean up /tmp
in certain conditions, the tmpdir was not being deleted Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -26,7 +26,7 @@ main()
|
|||||||
clone_project
|
clone_project
|
||||||
|
|
||||||
# clean in case of failure
|
# clean in case of failure
|
||||||
rm -rf ${tmp_dir} >/dev/null 2>&1 || exit 1
|
rm -Rf ${tmp_dir} >/dev/null 2>&1 || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
read_config()
|
read_config()
|
||||||
@@ -72,14 +72,14 @@ clone_project()
|
|||||||
|| err "ERROR: could not download ${name}"
|
|| err "ERROR: could not download ${name}"
|
||||||
|
|
||||||
(
|
(
|
||||||
cd ${tmp_dir} || exit 1
|
cd ${tmp_dir} || err "tmpdir not created"
|
||||||
git reset --hard ${revision} || err "Cannot reset revision"
|
git reset --hard ${revision} || err "Cannot reset revision"
|
||||||
)
|
)
|
||||||
|
|
||||||
patch_project
|
patch_project
|
||||||
|
|
||||||
if [ -d "${location}" ]; then
|
if [ -d "${location}" ]; then
|
||||||
rm -Rf ${location} || exit 1
|
rm -Rf ${location} || err "Cannot remove directory '${location}'"
|
||||||
fi
|
fi
|
||||||
mv ${tmp_dir} ${location} && return 0
|
mv ${tmp_dir} ${location} && return 0
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ patch_project()
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
(
|
(
|
||||||
cd ${tmp_dir} || exit 1
|
cd ${tmp_dir} || err "tmpdir not created"
|
||||||
git am ${patchfile} || err "Cannot patch project: $name"
|
git am ${patchfile} || err "Cannot patch project: $name"
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
@@ -116,6 +116,7 @@ err()
|
|||||||
{
|
{
|
||||||
printf "${@}\n"
|
printf "${@}\n"
|
||||||
usage
|
usage
|
||||||
|
rm -Rf ${tmp_dir} >/dev/null 2>&1
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user