From: Joerg Jaspert Date: Sat, 19 Dec 2009 21:06:09 +0000 (+0100) Subject: add a statefile. this closes #560277 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=e6c5d6798be7831cc5e8f294328b9ffe4aa510d2;p=dak.git 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 --- diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall index 747db2f1..49b5a23d 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 26c1c8b8..19d62ed0 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}" <