diff options
author | Juergen Daubert <jue@jue.li> | 2013-01-21 18:23:10 +0100 |
---|---|---|
committer | Juergen Daubert <jue@jue.li> | 2013-01-21 18:23:10 +0100 |
commit | 695999d5197b50ef3172125b496cb7f903f0f4a5 (patch) | |
tree | 471069f59d361b7e2ffa93b36fa9a40202da12e4 | |
parent | 220a918b5ed31463a1ba02019f2a1f03c87e1661 (diff) | |
download | prt-utils-695999d5197b50ef3172125b496cb7f903f0f4a5.tar.gz prt-utils-695999d5197b50ef3172125b496cb7f903f0f4a5.tar.xz |
pkgexport: remove temporary file more reliable
-rwxr-xr-x | pkgexport | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -48,6 +48,13 @@ exit 1 } ########## +# clean_on_exit removes temporary files etc. +########## +clean_on_exit() { + [ -f $FILES ] && rm $FILES +} + +########## # pkginfo_l lists files inside a package (pkginfo -l $file) ########## pkginfo_l() { @@ -134,9 +141,6 @@ then exit 1 fi -# Get rid of our sucky temp-file. -rm -f $FILES - if [ $VERBOSE = 1 ]; then echo =============================================== echo @@ -191,4 +195,7 @@ exportpkg } + +trap "clean_on_exit" EXIT main $* + |