comparison make-dist @ 110949:aa38b4aad856

* make-dist: Simplify trap handling.
author Glenn Morris <rgm@gnu.org>
date Tue, 12 Oct 2010 00:44:12 -0700
parents a2f817d28d08
children 77c12a233de2
comparison
equal deleted inserted replaced
110948:a2f817d28d08 110949:aa38b4aad856
297 tempdir="${tempparent}/${emacsname}" 297 tempdir="${tempparent}/${emacsname}"
298 298
299 ### This trap ensures that the staging directory will be cleaned up even 299 ### This trap ensures that the staging directory will be cleaned up even
300 ### when the script is interrupted in mid-career. 300 ### when the script is interrupted in mid-career.
301 if [ "${clean_up}" = yes ]; then 301 if [ "${clean_up}" = yes ]; then
302 trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; exit 1" 1 2 15 302 trap "echo 'Cleaning up the staging directory'; rm -rf ${tempparent}" EXIT
303 fi 303 fi
304 304
305 echo "Creating top directory: \`${tempdir}'" 305 echo "Creating top directory: \`${tempdir}'"
306 mkdir ${tempdir} 306 mkdir ${tempdir}
307 307
569 (cd ${tempparent} ; tar cvf - ${emacsname} ) \ 569 (cd ${tempparent} ; tar cvf - ${emacsname} ) \
570 | ${default_gzip} \ 570 | ${default_gzip} \
571 > ${emacsname}.tar${gzip_extension} 571 > ${emacsname}.tar${gzip_extension}
572 fi 572 fi
573 573
574 if [ "${clean_up}" = yes ]; then 574 if [ "${clean_up}" != yes ]; then
575 echo "Cleaning up the staging directory"
576 rm -rf ${tempparent}
577 else
578 (cd ${tempparent}; mv ${emacsname} ..) 575 (cd ${tempparent}; mv ${emacsname} ..)
579 rm -rf ${tempparent} 576 rm -rf ${tempparent}
580 fi 577 fi
581 578
582 ### make-dist ends here 579 ### make-dist ends here