rpm-build/scripts/tmpdir.sh

12 lines
183 B
Bash
Raw Normal View History

2011-09-22 00:43:46 +04:00
#!/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