[Initscripts-ng-commits] r439 - /trunk/src/insserv/debian/run-testsuite

pere at users.alioth.debian.org pere at users.alioth.debian.org
Fri Jan 4 11:01:37 UTC 2008


Author: pere
Date: Fri Jan  4 11:01:37 2008
New Revision: 439

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=439
Log:
Make sure to always clean up the test directory on exit.

Modified:
    trunk/src/insserv/debian/run-testsuite

Modified: trunk/src/insserv/debian/run-testsuite
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/run-testsuite?rev=439&op=diff
==============================================================================
--- trunk/src/insserv/debian/run-testsuite (original)
+++ trunk/src/insserv/debian/run-testsuite Fri Jan  4 11:01:37 2008
@@ -54,6 +54,11 @@
     fi
 }
 
+on_exit() {
+    rm -rf $tmpdir
+}
+trap on_exit EXIT # Enable cleanup handler
+
 cat <<'EOF' > $insconf
 $local_fs       +mountall +umountfs
 $network        +networking +ifupdown
@@ -544,8 +549,6 @@
 test_order S startfirst_stopfirst startsecond_stoplast
 test_order 6 startfirst_stopfirst startsecond_stoplast 
 
-rm -rf $tmpdir
-
 if [ 0 != $retval ] ; then
     echo "error: one or more test failed."
 else




More information about the Initscripts-ng-commits mailing list