diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2015-10-22 14:38:38 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2015-10-22 14:38:38 +0000 |
commit | 0782cd7f14a02e7b76a64dba0befc3c5f9bb9ab3 (patch) | |
tree | ef25615216e82006b79dfc8212df8d008d908300 | |
parent | 7f097cec90c786328be9990a296e5ff856a4fe2d (diff) | |
download | mpfr-0782cd7f14a02e7b76a64dba0befc3c5f9bb9ab3.tar.gz |
[autogen.sh] Restore the INSTALL file also if the process receives
a usual signal (SIGHUP, SIGINT, SIGQUIT or SIGTERM).
(merged changeset r9697 from the trunk)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@9698 280ebfd0-de03-0410-8827-d642c229c3f4
-rwxr-xr-x | autogen.sh | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/autogen.sh b/autogen.sh index 5d2a116aa..413083b48 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,16 +1,27 @@ #!/bin/sh # "autoreconf -f" will clobber our INSTALL file with a generic one if we -# don't move it out of the way +# don't move it out of the way. +# EXIT and signals that correspond to SIGHUP, SIGINT, SIGQUIT and SIGTERM. +signals="0 1 2 3 15" + +cleanup() +{ + trap '' $signals + if [ -f INSTALL.$$.tmp ]; then + echo "$0: restoring the INSTALL file" >&2 + mv -f INSTALL.$$.tmp INSTALL + fi +} + +rm -f INSTALL.$$.tmp +trap cleanup $signals mv -f INSTALL INSTALL.$$.tmp autoreconf -v -f -i -W all status=$? -rm -f INSTALL -mv -f INSTALL.$$.tmp INSTALL - rm -rf autom4te.cache exit $status |