X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcron.dinstall;h=200c7a646986cbf7b189a1d28a7c2dee3be5773a;hb=885fa6acaf90a83f8d531c9a43b2e0d4f0b1ca8d;hp=0060d5fd6a8afee6828d01003a547e4148f7505a;hpb=e675910657234a246e9cb53e6f989d829afdc5f8;p=dak.git diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall index 0060d5fd..200c7a64 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 } ######################################################################## @@ -188,9 +197,6 @@ function accepted() { function cruft() { log "Checking for cruft in overrides" dak check-overrides - - log "Fixing symlinks in $ftpdir" - symlinks -d -r $ftpdir } function msfl() { @@ -201,6 +207,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() { @@ -221,6 +249,7 @@ function mpfm() { function packages() { log "Generating Packages and Sources files" cd $configdir + GZIP='--rsyncable' ; export GZIP apt-ftparchive generate apt.conf } @@ -324,9 +353,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() { @@ -338,7 +370,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}/ @@ -398,14 +430,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 +479,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 +510,7 @@ function stage() { exit 42 fi - if [ "${ERR}" = "false" ]; then + if [ "${error}" = "false" ]; then set +e fi ${FUNC} ${ARGS} @@ -605,7 +639,7 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & GO=( FUNC="punew" @@ -629,7 +663,7 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & lockfile "$LOCK_ACCEPTED" lockfile "$LOCK_NEW" @@ -684,7 +718,7 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & GO=( FUNC="overrides" @@ -764,7 +798,7 @@ GO=( ARGS="" ERR="" ) -stage $GO +stage $GO & rm -f "${NOTICE}" rm -f "${LOCK_DAILY}" @@ -777,7 +811,7 @@ GO=( ARGS="" ERR="" ) -stage $GO +stage $GO & GO=( FUNC="expire" @@ -785,7 +819,7 @@ GO=( ARGS="" ERR="" ) -stage $GO +stage $GO & GO=( FUNC="transitionsclean" @@ -793,7 +827,7 @@ GO=( ARGS="" ERR="" ) -stage $GO +stage $GO & GO=( FUNC="reports" @@ -801,7 +835,7 @@ GO=( ARGS="" ERR="" ) -stage $GO +stage $GO & GO=( FUNC="dm" @@ -809,7 +843,7 @@ GO=( ARGS="" ERR="" ) -stage $GO +stage $GO & GO=( FUNC="bts" @@ -817,7 +851,7 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & GO=( FUNC="merkel2" @@ -825,11 +859,11 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & GO=( - FUNC="runparts" - TIME="run-parts" + FUNC="mirrorpush" + TIME="mirrorpush" ARGS="" ERR="false" ) @@ -849,7 +883,7 @@ GO=( ARGS="" ERR="false" ) -stage $GO +stage $GO & GO=( FUNC="testingsourcelist" @@ -869,21 +903,13 @@ GO=( ) stage $GO & -GO=( - FUNC="aptftpcleanup" - TIME="apt-ftparchive cleanup" - ARGS="" - ERR="false" -) -stage $GO - GO=( FUNC="merkel3" TIME="merkel ddaccessible sync" ARGS="" ERR="false" ) -stage $GO +stage $GO & GO=( FUNC="compress" @@ -891,6 +917,14 @@ GO=( ARGS="" ERR="" ) +stage $GO & + +GO=( + FUNC="aptftpcleanup" + TIME="apt-ftparchive cleanup" + ARGS="" + ERR="false" +) stage $GO log "Daily cron scripts successful, all done"