X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fbackports%2Fcron.dinstall;h=4d3bef8fbb6553e72a1229b36c1f61985b8f66a0;hb=84665aa9fd206376672a4c1590abb5b39e67bab4;hp=b26626af482683570f0de9ce5f20157f46044eed;hpb=fe0a173ec903c28ee3ebbd7ae1c07412ea341459;p=dak.git diff --git a/config/backports/cron.dinstall b/config/backports/cron.dinstall index b26626af..4d3bef8f 100755 --- a/config/backports/cron.dinstall +++ b/config/backports/cron.dinstall @@ -27,6 +27,7 @@ # exit on errors set -e +set -o pipefail # make sure to only use defined variables set -u # ERR traps should be inherited from functions too. (And command @@ -152,6 +153,13 @@ umask 022 export LANG=C export LC_ALL=C +# If we did not install new packages, we dont want to run. +if ! [ -f "${DINSTALLPACKAGES}" ]; then + log "nothing to do" + exit 0 +fi +rm -f "${DINSTALLPACKAGES}" + touch "${DINSTALLSTART}" ts "startup" DINSTALLBEGIN="$(date -u +"%a %b %d %T %Z %Y (%s)")" @@ -172,9 +180,9 @@ GO=( stage $GO GO=( - FUNC="pgdump_pre" + FUNC="pg_timestamp" TIME="pg_dump1" - ARGS="" + ARGS="predinstall" ERR="" ) stage $GO @@ -182,6 +190,14 @@ stage $GO lockfile "$LOCK_ACCEPTED" lockfile "$LOCK_NEW" +GO=( + FUNC="punew" + TIME="p-u-new" + ARGS="proposedupdates" + ERR="false" +) +stage $GO + GO=( FUNC="newstage" TIME="newstage" @@ -216,13 +232,13 @@ GO=( ) stage $GO -# GO=( -# FUNC="fingerprints" -# TIME="import-keyring" -# ARGS="" -# ERR="false" -# ) -# stage $GO +GO=( + FUNC="fingerprints" + TIME="import-keyring" + ARGS="" + ERR="false" +) +stage $GO GO=( FUNC="overrides" @@ -293,14 +309,6 @@ GO=( ) stage $GO -GO=( - FUNC="mkuploaders" - TIME="mkuploaders" - ARGS="" - ERR="" -) -stage $GO - GO=( FUNC="copyoverrides" TIME="copyoverrides" @@ -341,28 +349,28 @@ ts "locked part finished" state "postlock" GO=( - FUNC="pgdump_post" - TIME="pg_dump2" + FUNC="changelogs" + TIME="changelogs" ARGS="" - ERR="" + ERR="false" ) stage $GO & GO=( - FUNC="expire" - TIME="expire_dumps" - ARGS="" + FUNC="pg_timestamp" + TIME="pg_dump2" + ARGS="postdinstall" ERR="" ) stage $GO & GO=( - FUNC="reports" - TIME="reports" + FUNC="expire" + TIME="expire_dumps" ARGS="" ERR="" ) -stage $GO & +#stage $GO & # GO=( # FUNC="dm" @@ -391,8 +399,8 @@ stage $GO & rm -f "${LOCK_BRITNEY}" GO=( - FUNC="compress" - TIME="compress" + FUNC="cleantransactions" + TIME="" ARGS="" ERR="" ) @@ -406,6 +414,9 @@ stage $GO & # ) # stage $GO +# we need to wait for the background processes before the end of dinstall +wait + log "Daily cron scripts successful, all done" exec > "$logdir/afterdinstall.log" 2>&1