[dak/master] fix lock removal in dinstall
Signed-off-by: Torsten Werner <twerner@debian.org>
---
config/debian/cron.dinstall | 4 +---
config/debian/dinstall.functions | 10 +++++++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall
index e2dfe7c..d275354 100755
--- a/config/debian/cron.dinstall
+++ b/config/debian/cron.dinstall
@@ -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"
diff --git a/config/debian/dinstall.functions b/config/debian/dinstall.functions
index 98972e6..605dd2b 100644
--- a/config/debian/dinstall.functions
+++ b/config/debian/dinstall.functions
@@ -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
--
1.5.6.5
Reply to: