X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcron.dinstall;h=28693bcf76a6cdcc8fd61e6c677433769d14d33e;hb=629c016d5b4acb451555548c3c00175b4dd9cd55;hp=1c9fa5afefff3284fd27f860fcb63d40d5aad16d;hpb=05c002afb12f077d753234de45753062fa54ce02;p=dak.git diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall index 1c9fa5af..28693bcf 100755 --- a/config/debian/cron.dinstall +++ b/config/debian/cron.dinstall @@ -74,20 +74,6 @@ function onerror() { # the actual dinstall functions follow # ######################################################################## -# Setup the notice file to tell bad mirrors they used the wrong time -function notice() { - rm -f "$NOTICE" - cat > "$NOTICE" < .${FILENAME}.new + + if [ -r ${FILENAME}.gz ] ; then + mv -f ${FILENAME}.gz ${FILENAME}.old.gz + mv -f .${FILENAME}.new ${FILENAME} + rm -f ${FILENAME}.patch.gz + zcat ${FILENAME}.old.gz | diff -u - ${FILENAME} | gzip --rsyncable -9cfn - >${FILENAME}.patch.gz + rm -f ${FILENAME}.old.gz + else + mv -f .${FILENAME}.new ${FILENAME} + fi + + gzip --rsyncable -9cfN ${FILENAME} >${FILENAME}.gz + rm -f ${FILENAME} +} + +function mkmaintainers() { + log -n 'Creating Maintainers index ... ' + + cd $indices + dak make-maintainers ${scriptdir}/masterfiles/pseudo-packages.maintainers | \ + sed -e "s/~[^ ]*\([ ]\)/\1/" | awk '{printf "%-20s ", $1; for (i=2; i<=NF; i++) printf "%s ", $i; printf "\n";}' > .new-maintainers + + set +e + cmp .new-maintainers Maintainers >/dev/null + rc=$? + set -e + if [ $rc = 1 ] || [ ! -f Maintainers ] ; then + log -n "installing Maintainers ... " + mv -f .new-maintainers Maintainers + gzip --rsyncable -9v .new-maintainers.gz + mv -f .new-maintainers.gz Maintainers.gz + elif [ $rc = 0 ] ; then + log '(same as before)' + rm -f .new-maintainers + else + log cmp returned $rc + false + fi +} + +function copyoverrides() { + log 'Copying override files into public view ...' + + for f in $copyoverrides ; do + cd $overridedir + chmod g+w override.$f + + cd $indices + rm -f .newover-$f.gz + pc="`gzip 2>&1 -9nv <$overridedir/override.$f >.newover-$f.gz`" + set +e + nf=override.$f.gz + cmp -s .newover-$f.gz $nf + rc=$? + set -e + if [ $rc = 0 ]; then + rm -f .newover-$f.gz + elif [ $rc = 1 -o ! -f $nf ]; then + echo " installing new $nf $pc" + mv -f .newover-$f.gz $nf + chmod g+w $nf + else + echo $? $pc + exit 1 + fi + done +} + function scripts() { log "Running various scripts from $scriptsdir" cd $scriptsdir - ./mkmaintainers - ./copyoverrides - ./mklslar + mkmaintainers + copyoverrides + mklslar ./mkfilesindices ./mkchecksums } @@ -300,7 +370,7 @@ function scripts() { function mirror() { echo "Regenerating \"public\" mirror/ hardlink fun" cd ${mirrordir} - rsync -aH --link-dest ${ftpdir} --exclude Archive_Maintenance_In_Progress --delete --delete-after --ignore-errors ${ftpdir}/. . + rsync -aH --link-dest ${ftpdir} --delete --delete-after --ignore-errors ${ftpdir}/. . } function wb() { @@ -576,9 +646,6 @@ DINSTALLEND="${lockdir}/dinstallend" touch "${DINSTALLSTART}" ts "startup" -# Tell everyone we are doing some work -NOTICE="$ftpdir/Archive_Maintenance_In_Progress" - # lock cron.unchecked (it immediately exits when this exists) LOCK_DAILY="$lockdir/daily.lock" @@ -802,7 +869,6 @@ GO=( ) stage $GO & -rm -f "${NOTICE}" rm -f "${LOCK_DAILY}" ts "locked part finished" @@ -905,14 +971,6 @@ GO=( ) stage $GO & -GO=( - FUNC="aptftpcleanup" - TIME="apt-ftparchive cleanup" - ARGS="" - ERR="false" -) -stage $GO & - GO=( FUNC="merkel3" TIME="merkel ddaccessible sync" @@ -927,6 +985,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"