X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcron.dinstall;h=1c9fa5afefff3284fd27f860fcb63d40d5aad16d;hb=1fa1f22b70c6ee46aea78ee40b9797a574d7c583;hp=82f7cbeb5510f3e6fc25fe9da9350d01e091d209;hpb=dc9b6860ddf2dc2b48d59ca6133cf9814884acd6;p=dak.git diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall index 82f7cbeb..1c9fa5af 100755 --- a/config/debian/cron.dinstall +++ b/config/debian/cron.dinstall @@ -58,7 +58,16 @@ function cleanup() { # If we error out this one is called, *FOLLOWED* by cleanup above function onerror() { ERRDATE=$(date "+%Y.%m.%d-%H:%M:%S") - cat "${STAGEFILE}.log" | mail -s "ATTENTION ATTENTION! dinstall error at ${ERRDATE} in ${STAGEFILE} - (Be quiet, Brain, or I'll stab you with a Q-tip)" cron@ftp-master.debian.org + + subject="ATTENTION ATTENTION!" + if [ "${error}" = "false" ]; then + subject="${subject} (continued)" + else + subject="${subject} (interrupted)" + fi + subject="${subject} dinstall error at ${ERRDATE} in ${STAGEFILE} - (Be quiet, Brain, or I'll stab you with a Q-tip)" + + cat "${STAGEFILE}.log" | mail -s "${subject}" -a "X-Debian: DAK" cron@ftp-master.debian.org } ######################################################################## @@ -201,6 +210,28 @@ function msfl() { function fingerprints() { log "Updating fingerprints" dak import-keyring -L /srv/keyring.debian.org/keyrings/debian-keyring.gpg + + OUTFILE=$(mktemp) + dak import-keyring --generate-users "%s" /srv/keyring.debian.org/keyrings/debian-maintainers.gpg >"${OUTFILE}" + + if [ -s "${OUTFILE}" ]; then + /usr/sbin/sendmail -odq -oi -t -f envelope@ftp-master.debian.org < +To: +Subject: Debian Maintainers Keyring changes +Content-Type: text/plain; charset=utf-8 +MIME-Version: 1.0 + +The following changes to the debian-maintainers keyring have just been activated: + +$(cat $OUTFILE) + +Debian distribution maintenance software, +on behalf of the Keyring maintainers + +EOF + fi + rm -f "$OUTFILE" } function overrides() { @@ -324,9 +355,12 @@ function merkel3() { ssh -2 -o BatchMode=yes -o SetupTimeOut=30 -o ConnectTimeout=30 -i ~/.ssh/push_merkel_ddaccess dak@merkel.debian.org sleep 1 } -function runparts() { - log "Using run-parts to run scripts in $base/scripts/distmnt" - run-parts --report $base/scripts/distmnt +function mirrorpush() { + log "Starting the mirrorpush" + date -u > /srv/ftp.debian.org/web/mirrorstart + echo "Using dak v1" >> /srv/ftp.debian.org/web/mirrorstart + echo "Running on host $(hostname -f)" >> /srv/ftp.debian.org/web/mirrorstart + sudo -H -u archvsync /home/archvsync/runmirrors > ~dak/runmirrors.log 2>&1 & } function i18n2() { @@ -398,14 +432,14 @@ function maillogfile() { function renamelogfile() { if [ -f "${dbdir}/dinstallstart" ]; then NOW=$(cat "${dbdir}/dinstallstart") - maillogfile +# maillogfile mv "$LOGFILE" "$logdir/dinstall_${NOW}.log" logstats "$logdir/dinstall_${NOW}.log" bzip2 -9 "$logdir/dinstall_${NOW}.log" else error "Problem, I don't know when dinstall started, unable to do log statistics." NOW=`date "+%Y.%m.%d-%H:%M:%S"` - maillogfile +# maillogfile mv "$LOGFILE" "$logdir/dinstall_${NOW}.log" bzip2 -9 "$logdir/dinstall_${NOW}.log" fi @@ -447,6 +481,8 @@ function stage() { ARGS='GO[@]' local "${!ARGS}" + error=${ERR:-"true"} + STAGEFILE="${stagedir}/${FUNC}" if [ -f "${STAGEFILE}" ]; then stamptime=$(/usr/bin/stat -c %Z "${STAGEFILE}") @@ -476,7 +512,7 @@ function stage() { exit 42 fi - if [ "${ERR}" = "false" ]; then + if [ "${error}" = "false" ]; then set +e fi ${FUNC} ${ARGS} @@ -605,7 +641,7 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & GO=( FUNC="punew" @@ -629,7 +665,7 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & lockfile "$LOCK_ACCEPTED" lockfile "$LOCK_NEW" @@ -684,7 +720,7 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & GO=( FUNC="overrides" @@ -764,7 +800,7 @@ GO=( ARGS="" ERR="" ) -stage $GO +stage $GO & rm -f "${NOTICE}" rm -f "${LOCK_DAILY}" @@ -777,7 +813,7 @@ GO=( ARGS="" ERR="" ) -stage $GO +stage $GO & GO=( FUNC="expire" @@ -785,7 +821,7 @@ GO=( ARGS="" ERR="" ) -stage $GO +stage $GO & GO=( FUNC="transitionsclean" @@ -793,7 +829,7 @@ GO=( ARGS="" ERR="" ) -stage $GO +stage $GO & GO=( FUNC="reports" @@ -801,7 +837,7 @@ GO=( ARGS="" ERR="" ) -stage $GO +stage $GO & GO=( FUNC="dm" @@ -809,7 +845,7 @@ GO=( ARGS="" ERR="" ) -stage $GO +stage $GO & GO=( FUNC="bts" @@ -817,7 +853,7 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & GO=( FUNC="merkel2" @@ -825,11 +861,11 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & GO=( - FUNC="runparts" - TIME="run-parts" + FUNC="mirrorpush" + TIME="mirrorpush" ARGS="" ERR="false" ) @@ -849,7 +885,7 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & GO=( FUNC="testingsourcelist" @@ -875,7 +911,7 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & GO=( FUNC="merkel3" @@ -883,7 +919,7 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & GO=( FUNC="compress"