Allow re-using extracted content
Usage: export TMPDIR=/some/dir/$device export SKIP_CLEANUP=true Change-Id: I41b992708ca5fc7bc377b22a418f5fd1395cd08a
This commit is contained in:
committed by
Michael Bestas
parent
58851a06e5
commit
929c9b99ec
@@ -19,7 +19,8 @@ COMMON=-1
|
|||||||
ARCHES=
|
ARCHES=
|
||||||
FULLY_DEODEXED=-1
|
FULLY_DEODEXED=-1
|
||||||
|
|
||||||
TMPDIR=$(mktemp -d)
|
SKIP_CLEANUP=${SKIP_CLEANUP:-0}
|
||||||
|
TMPDIR=${TMPDIR:-$(mktemp -d)}
|
||||||
HOST="$(uname | tr '[:upper:]' '[:lower:]')"
|
HOST="$(uname | tr '[:upper:]' '[:lower:]')"
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -28,7 +29,11 @@ HOST="$(uname | tr '[:upper:]' '[:lower:]')"
|
|||||||
# kill our tmpfiles with fire on exit
|
# kill our tmpfiles with fire on exit
|
||||||
#
|
#
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
if [ "$SKIP_CLEANUP" == "true" ] || [ "$SKIP_CLEANUP" == "1" ]; then
|
||||||
|
echo "Skipping cleanup of $TMPDIR"
|
||||||
|
else
|
||||||
rm -rf "${TMPDIR:?}"
|
rm -rf "${TMPDIR:?}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
trap cleanup 0
|
trap cleanup 0
|
||||||
|
|||||||
Reference in New Issue
Block a user