]> git.decadent.org.uk Git - dak.git/blobdiff - config/debian/cron.dinstall
Merge branch 'merge'
[dak.git] / config / debian / cron.dinstall
index 200c7a646986cbf7b189a1d28a7c2dee3be5773a..0fe0b1cf6528e1a71799d0c512943bb0507ba05c 100755 (executable)
@@ -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" <<EOF
-Packages are currently being installed and indices rebuilt.
-Maintenance is automatic, starting at 01|07|13|19:52 UTC,
-and ending about an hour later.  This file is then removed.
-
-You should not mirror the archive during this period. If you find this
-file on a Debian mirror please have a nice talk with the admin. They
-are doing something wrong.
-EOF
-}
-
 # pushing merkels QA user, part one
 function merkel1() {
     log "Telling merkels QA user that we start dinstall"
@@ -285,12 +271,70 @@ function buildd_dir() {
     make_buildd_dir
 }
 
+function mklslar() {
+    cd $ftpdir
+
+    FILENAME=ls-lR
+
+    log "Removing any core files ..."
+    find -type f -name core -print0 | xargs -0r rm -v
+
+    log "Checking permissions on files in the FTP tree ..."
+    find -type f \( \! -perm -444 -o -perm +002 \) -ls
+    find -type d \( \! -perm -555 -o -perm +002 \) -ls
+
+    log "Checking symlinks ..."
+    symlinks -rd .
+
+    log "Creating recursive directory listing ... "
+    rm -f .${FILENAME}.new
+    TZ=UTC ls -lR > .${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 <Maintainers >.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 scripts() {
     log "Running various scripts from $scriptsdir"
     cd $scriptsdir
-    ./mkmaintainers
+    mkmaintainers
     ./copyoverrides
-    ./mklslar
+    mklslar
     ./mkfilesindices
     ./mkchecksums
 }
@@ -298,7 +342,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() {
@@ -574,9 +618,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"
 
@@ -800,7 +841,6 @@ GO=(
 )
 stage $GO &
 
-rm -f "${NOTICE}"
 rm -f "${LOCK_DAILY}"
 
 ts "locked part finished"