X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcommon;fp=config%2Fdebian%2Fcommon;h=a568d82657b0e559c55b838f708054473f0cdc75;hb=5428cbbe30b7e2b77305024f45ef2fa2ffa68490;hp=0177f1f6fcfd8e1a14b94f32d69a5975607946e1;hpb=773f4286615587294d6e6acfb850df53a661bbc5;p=dak.git diff --git a/config/debian/common b/config/debian/common index 0177f1f6..a568d826 100644 --- a/config/debian/common +++ b/config/debian/common @@ -23,6 +23,19 @@ function debug () { fi } +# Get a tempfile, add it to the right variable to get rid of it, +# and return it +function gettempfile() { + local MAKEDIR=${1:-false} + local TMPARGS="" + if [[ ${MAKEDIR} == true ]]; then + TMPARGS="--directory" + fi + local TMPFILE=$( mktemp -p ${TMPDIR} ${TMPARGS} ) + TMPFILES="${TEMPFILES} ${TMPFILE}" + echo "${TMPFILE}" +} + # Function that only cleans tempfiles, but does not exit or otherwise # care about any exit status function cleantempfiles() {