[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] add a statefile. this closes #560277



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>
---
 config/debian/cron.dinstall      |    9 +++++++++
 config/debian/dinstall.functions |   15 +++++++++++++++
 config/debian/dinstall.variables |    3 +++
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall
index 747db2f..49b5a23 100755
--- a/config/debian/cron.dinstall
+++ b/config/debian/cron.dinstall
@@ -154,6 +154,8 @@ export LC_ALL=C
 
 touch "${DINSTALLSTART}"
 ts "startup"
+DINSTALLBEGIN="$(date -u +"%a %b %d %T %Z %Y (%s)")"
+state "Startup"
 
 lockfile -l 3600 "${LOCK_DAILY}"
 trap onerror ERR
@@ -243,6 +245,8 @@ stage $GO
 rm -f "$LOCK_ACCEPTED"
 rm -f "$LOCK_NEW"
 
+state "indices"
+
 GO=(
     FUNC="dominate"
     TIME="dominate"
@@ -283,6 +287,7 @@ GO=(
 )
 stage $GO &
 
+state "packages/contents"
 GO=(
     FUNC="packages"
     TIME="apt-ftparchive"
@@ -293,6 +298,7 @@ GO=(
 # functions before it. We no longer have a 1.5hour sync point then.
 stage $GO
 
+state "dists/"
 GO=(
     FUNC="pdiff"
     TIME="pdiff"
@@ -325,6 +331,7 @@ GO=(
 )
 stage $GO
 
+state "scripts"
 GO=(
     FUNC="mkmaintainers"
     TIME="mkmaintainers"
@@ -384,6 +391,7 @@ stage $GO &
 rm -f "${LOCK_DAILY}"
 
 ts "locked part finished"
+state "postlock"
 
 GO=(
     FUNC="pgdump_post"
@@ -518,6 +526,7 @@ GO=(
     ERR="false"
 )
 stage $GO
+state "all done"
 
 
 # Now, at the very (successful) end of dinstall, make sure we remove
diff --git a/config/debian/dinstall.functions b/config/debian/dinstall.functions
index 26c1c8b..19d62ed 100644
--- a/config/debian/dinstall.functions
+++ b/config/debian/dinstall.functions
@@ -545,3 +545,18 @@ function process_unchecked() {
     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
+}
diff --git a/config/debian/dinstall.variables b/config/debian/dinstall.variables
index 353a3ae..cd0fb20 100644
--- a/config/debian/dinstall.variables
+++ b/config/debian/dinstall.variables
@@ -41,3 +41,6 @@ LOCK_STOP="$lockdir/archive.stop"
 
 # Lock buildd updates
 LOCK_BUILDD="$lockdir/buildd.lock"
+
+# Statefile for the users
+DINSTALLSTATE="${webdir}/dinstall.status"
-- 
1.6.3.3


Reply to: