]> git.decadent.org.uk Git - dak.git/blobdiff - config/debian/cron.dinstall
Merge branch 'merge'
[dak.git] / config / debian / cron.dinstall
index 7acc244b299362ae1a0b8a14b6f4b9df737f496d..1c9fa5afefff3284fd27f860fcb63d40d5aad16d 100755 (executable)
@@ -46,8 +46,7 @@ export SCRIPTVARS=/srv/ftp.debian.org/dak/config/debian/vars
 
 # Timestamp. Used for dinstall stat graphs
 function ts() {
-        TS=$(($TS+1));
-        echo "Archive maintenance timestamp $TS ($1): $(date +%H:%M:%S)"
+        echo "Archive maintenance timestamp ($1): $(date +%H:%M:%S)"
 }
 
 # Cleanup actions
@@ -59,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
 }
 
 ########################################################################
@@ -202,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 <<EOF
+From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>
+To: <debian-project@lists.debian.org>
+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() {
@@ -325,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() {
@@ -339,7 +372,7 @@ function i18n2() {
     dak control-suite -l testing > squeeze
     dak control-suite -l unstable > sid
     echo "${STAMP}" > timestamp
-    gpg --secret-keyring /srv/ftp.debian.org/s3kr1t/dot-gnupg/secring.gpg --keyring /srv/ftp.debian.org/s3kr1t/dot-gnupg/pubring.gpg --no-options --batch --no-tty --armour --default-key 6070D3A1 --detach-sign -o timestamp.gpg timestamp
+    gpg --secret-keyring /srv/ftp.debian.org/s3kr1t/dot-gnupg/secring.gpg --keyring /srv/ftp.debian.org/s3kr1t/dot-gnupg/pubring.gpg --no-options --batch --no-tty --armour --default-key 55BE302B --detach-sign -o timestamp.gpg timestamp
     rm -f md5sum
     md5sum * > md5sum
     cd ${webdir}/
@@ -399,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
@@ -437,7 +470,7 @@ function process_unchecked() {
 # members
 #  - FUNC - the function name to call
 #  - ARGS - Possible arguments to hand to the function. Can be the empty string
-#  - TS   - The timestamp name. Can be the empty string
+#  - TIME - The timestamp name. Can be the empty string
 #  - ERR  - if this is the string false, then the call will be surrounded by
 #           set +e ... set -e calls, so errors in the function do not exit
 #           dinstall. Can be the empty string, meaning true.
@@ -448,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}")
@@ -461,7 +496,7 @@ function stage() {
         return
     fi
 
-    debug "Now calling function ${FUNC}. Arguments: ${ARGS}. Timestamp: ${TS}"
+    debug "Now calling function ${FUNC}. Arguments: ${ARGS}. Timestamp: ${TIME}"
 
     # Make sure we are always at the same place. If a function wants to be elsewhere,
     # it has to cd first!
@@ -477,7 +512,7 @@ function stage() {
         exit 42
     fi
 
-    if [ "${ERR}" = "false" ]; then
+    if [ "${error}" = "false" ]; then
         set +e
     fi
     ${FUNC} ${ARGS}
@@ -538,8 +573,6 @@ DINSTALLSTART="${lockdir}/dinstallstart"
 # Marker for dinstall end
 DINSTALLEND="${lockdir}/dinstallend"
 
-# Timestamps start at -1. so first gets 0
-TS=-1
 touch "${DINSTALLSTART}"
 ts "startup"
 
@@ -592,7 +625,7 @@ GO=(
     ARGS=""
     ERR="false"
 )
-stage $GO
+stage $GO &
 
 GO=(
     FUNC="pgdump_pre"
@@ -608,7 +641,7 @@ GO=(
     ARGS=""
     ERR="false"
 )
-stage $GO
+stage $GO &
 
 GO=(
     FUNC="punew"
@@ -632,7 +665,7 @@ GO=(
     ARGS=""
     ERR="false"
 )
-stage $GO
+stage $GO &
 
 lockfile "$LOCK_ACCEPTED"
 lockfile "$LOCK_NEW"
@@ -687,7 +720,7 @@ GO=(
     ARGS=""
     ERR="false"
 )
-stage $GO
+stage $GO &
 
 GO=(
     FUNC="overrides"
@@ -767,7 +800,7 @@ GO=(
     ARGS=""
     ERR=""
 )
-stage $GO
+stage $GO &
 
 rm -f "${NOTICE}"
 rm -f "${LOCK_DAILY}"
@@ -780,7 +813,7 @@ GO=(
     ARGS=""
     ERR=""
 )
-stage $GO
+stage $GO &
 
 GO=(
     FUNC="expire"
@@ -788,7 +821,7 @@ GO=(
     ARGS=""
     ERR=""
 )
-stage $GO
+stage $GO &
 
 GO=(
     FUNC="transitionsclean"
@@ -796,7 +829,7 @@ GO=(
     ARGS=""
     ERR=""
 )
-stage $GO
+stage $GO &
 
 GO=(
     FUNC="reports"
@@ -804,7 +837,7 @@ GO=(
     ARGS=""
     ERR=""
 )
-stage $GO
+stage $GO &
 
 GO=(
     FUNC="dm"
@@ -812,7 +845,7 @@ GO=(
     ARGS=""
     ERR=""
 )
-stage $GO
+stage $GO &
 
 GO=(
     FUNC="bts"
@@ -820,7 +853,7 @@ GO=(
     ARGS=""
     ERR="false"
 )
-stage $GO
+stage $GO &
 
 GO=(
     FUNC="merkel2"
@@ -828,11 +861,11 @@ GO=(
     ARGS=""
     ERR="false"
 )
-stage $GO
+stage $GO &
 
 GO=(
-    FUNC="runparts"
-    TIME="run-parts"
+    FUNC="mirrorpush"
+    TIME="mirrorpush"
     ARGS=""
     ERR="false"
 )
@@ -852,7 +885,7 @@ GO=(
     ARGS=""
     ERR="false"
 )
-stage $GO
+stage $GO &
 
 GO=(
     FUNC="testingsourcelist"
@@ -870,7 +903,7 @@ GO=(
     ARGS=""
     ERR="false"
 )
-stage $GO
+stage $GO &
 
 GO=(
     FUNC="aptftpcleanup"
@@ -878,7 +911,7 @@ GO=(
     ARGS=""
     ERR="false"
 )
-stage $GO
+stage $GO &
 
 GO=(
     FUNC="merkel3"
@@ -886,7 +919,7 @@ GO=(
     ARGS=""
     ERR="false"
 )
-stage $GO
+stage $GO &
 
 GO=(
     FUNC="compress"