rpm-build/scripts/tmpdir.sh
2011-09-22 02:58:59 +04:00

12 lines
183 B
Bash

#!/bin/sh
remove_tmpdir()
{
rm -rf -- "$tmpdir"
exit $1
}
trap 'exit 143' HUP INT QUIT PIPE TERM
tmpdir=$(mktemp -dt "${0##*/}.XXXXXXXX")
trap 'remove_tmpdir $?' EXIT