]> git.decadent.org.uk Git - dak.git/commitdiff
fix lock removal in dinstall
authorTorsten Werner <twerner@debian.org>
Tue, 4 Jan 2011 10:34:52 +0000 (11:34 +0100)
committerTorsten Werner <twerner@debian.org>
Tue, 4 Jan 2011 10:39:13 +0000 (11:39 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
config/debian/cron.dinstall
config/debian/dinstall.functions

index e2dfe7c805e01af3a6ca3573b9996298ddf90464..d275354cc2daf6f7505906a9d628bb2a1b5c8140 100755 (executable)
@@ -381,9 +381,7 @@ GO=(
 )
 stage $GO
 
-rm -f "$LOCK_ACCEPTED"
-rm -f "$LOCK_NEW"
-rm -f "${LOCK_DAILY}"
+remove_locks
 
 ts "locked part finished"
 state "postlock"
index 98972e6df0559f845dd4d1d5ffb211040b44965f..605dd2b907cd6b8376d58fd2effea2ddf36b1b00 100644 (file)
@@ -4,10 +4,14 @@ function ts() {
         echo "Archive maintenance timestamp ($1): $(date +%H:%M:%S)"
 }
 
-# Cleanup actions
+# Remove all locks
+function remove_locks() {
+    rm -f $LOCK_DAILY $LOCK_ACCEPTED $LOCK_NEW
+}
+
+# trap handler for cleaning up on signal / error
 function cleanup() {
-       rm -f ${LOCK_DAILY}
-       rm -f ${LOCK_ACCEPTED}
+    remove_locks
 }
 
 # If we error out this one is called, *FOLLOWED* by cleanup above