add a statefile to dinstall, roughly telling where we are.
sets a start timestamp and one of the time the statefile is updated.
Signed-off-by: Joerg Jaspert <joerg@debian.org>
touch "${DINSTALLSTART}"
ts "startup"
+DINSTALLBEGIN="$(date -u +"%a %b %d %T %Z %Y (%s)")"
+state "Startup"
lockfile -l 3600 "${LOCK_DAILY}"
trap onerror ERR
rm -f "$LOCK_ACCEPTED"
rm -f "$LOCK_NEW"
+state "indices"
+
GO=(
FUNC="dominate"
TIME="dominate"
)
stage $GO &
+state "packages/contents"
GO=(
FUNC="packages"
TIME="apt-ftparchive"
# functions before it. We no longer have a 1.5hour sync point then.
stage $GO
+state "dists/"
GO=(
FUNC="pdiff"
TIME="pdiff"
)
stage $GO
+state "scripts"
GO=(
FUNC="mkmaintainers"
TIME="mkmaintainers"
rm -f "${LOCK_DAILY}"
ts "locked part finished"
+state "postlock"
GO=(
FUNC="pgdump_post"
ERR="false"
)
stage $GO
+state "all done"
# Now, at the very (successful) end of dinstall, make sure we remove
do_unchecked
sync_debbugs
}
+
+# Function to update a "statefile" telling people what we are doing
+# (more or less).
+#
+# This should be called with the argument(s)
+# - Status name we want to show.
+#
+function state() {
+ RIGHTNOW="$(date -u +"%a %b %d %T %Z %Y (%s)")"
+ cat >"${DINSTALLSTATE}" <<EOF
+Dinstall start: ${DINSTALLBEGIN}
+Current action: ${1}
+Action start: ${RIGHTNOW}
+EOF
+}
# Lock buildd updates
LOCK_BUILDD="$lockdir/buildd.lock"
+
+# Statefile for the users
+DINSTALLSTATE="${webdir}/dinstall.status"