Merge branch 'distorted' into vampire
authorMark Wooding <mdw@distorted.org.uk>
Fri, 16 Mar 2012 11:44:14 +0000 (11:44 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 16 Mar 2012 11:44:14 +0000 (11:44 +0000)
* distorted:
  etc/mirrors.d/50-rfc: Fetch RFCs from IETF; fetch IDs separately.
  etc/mirrors.d/50-debian: Actually mirror security updates.
  etc/ftpsync-common.conf: Adjust the mirror root directory.
  Move the mirror home directory to /var/lib/mirror-admin.
  Move the mirror home directory to /var/lib/mirror-admin.
  bin/run-mirrors: If we have a keytab file, log in with it.
  bin/ftpsync: New version from upstream.

Conflicts:
etc/mirrors.d/50-rfc

.gitignore
bin/ftpsync
bin/run-mirrors
etc/mirrors.d/50-rfc

index 0e932c7..69e47ea 100644 (file)
@@ -1,2 +1,3 @@
 log
 var
+etc/krb4.keytab
index 484789d..1ae7b81 100755 (executable)
@@ -113,7 +113,7 @@ cleanup() {
         SPEED=$(
             SPEEDLINE=$(egrep '[0-9.]+ bytes/sec' "${LOGDIR}/rsync-${NAME}.log")
             set "nothing" ${SPEEDLINE}
-            echo $8
+            echo ${8:-""}
         )
         if [ -n "${SPEED}" ]; then
             SPEED=${SPEED%%.*}
@@ -225,10 +225,10 @@ fi
 #  can be used to exclude a complete architecture from                 #
 # mirrorring. Use as space seperated list.                             #
 # Possible values are:                                                 #
-# alpha, amd64, arm, armel, hppa, hurd-i386, i386, ia64,               #
-# mipsel, mips, powerpc, s390, sparc, kfreebsd-i386, kfreebsd-amd64    #
+# alpha, amd64, arm, armel, armhf, hppa, hurd-i386, i386, ia64, mips   #
+# mipsel, powerpc, s390, s390x, sparc, kfreebsd-i386, kfreebsd-amd64   #
 # and source.                                                          #
-# eg. ARCH_EXCLUDE="alpha arm armel mipsel mips s390 sparc"            #
+# eg. ARCH_EXCLUDE="alpha arm armel mipsel mips s390 s390x sparc"      #
 #                                                                      #
 # An unset value will mirror all architectures                         #
 ########################################################################
@@ -243,7 +243,7 @@ LOGDIR=${LOGDIR:-"${BASEDIR}/log"}
 LOG=${LOG:-"${LOGDIR}/${NAME}.log"}
 
 # Where should we put all the mirrored files?
-TO=${TO:-"/org/ftp.debian.org/ftp/"}
+TO=${TO:-"/srv/mirrors/debian/"}
 
 # used by log() and error()
 PROGRAM=${PROGRAM:-"${NAME}-$(hostname -s)"}
@@ -287,7 +287,7 @@ RSYNC_OPTIONS1=${RSYNC_OPTIONS1:-"--exclude Packages* --exclude Sources* --exclu
 # Options for the second pass, where we do want everything, including deletion of old and now unused files
 RSYNC_OPTIONS2=${RSYNC_OPTIONS2:-"--max-delete=40000 --delay-updates --delete --delete-after --delete-excluded"}
 # Which rsync share to use on our upstream mirror?
-RSYNC_PATH=${RSYNC_PATH:-"ftp"}
+RSYNC_PATH=${RSYNC_PATH:-"debian"}
 
 # Now add the bwlimit option. As default is 0 we always add it, rsync interprets
 # 0 as unlimited, so this is safe.
@@ -337,7 +337,7 @@ for ARCH in ${ARCH_EXCLUDE}; do
     EXCLUDE="${EXCLUDE} --exclude binary-${ARCH}/ --exclude installer-${ARCH}/ --exclude Contents-${ARCH}.gz --exclude Contents-${ARCH}.bz2 --exclude Contents-${ARCH}.diff/ --exclude arch-${ARCH}.files --exclude arch-${ARCH}.list.gz --exclude *_${ARCH}.deb --exclude *_${ARCH}.udeb --exclude *_${ARCH}.changes"
     if [ "${ARCH}" = "source" ]; then
         if [ -z ${SOURCE_EXCLUDE} ]; then
-            SOURCE_EXCLUDE=" --exclude source/ --exclude *.tar.gz --exclude *.diff.gz --exclude *.tar.bz2 --exclude *.diff.bz2 --exclude *.dsc "
+            SOURCE_EXCLUDE=" --exclude source/ --exclude *.tar.gz --exclude *.diff.gz --exclude *.tar.bz2 --exclude *.tar.xz -exclude *.diff.bz2 --exclude *.dsc "
         fi
     fi
 done
@@ -414,6 +414,7 @@ exec >"$LOG" 2>&1 <&-
 log "Mirrorsync start"
 
 # Look who pushed us and note that in the log.
+SSH_CONNECTION=${SSH_CONNECTION:-""}
 PUSHFROM="${SSH_CONNECTION%%\ *}"
 if [ -n "${PUSHFROM}" ]; then
     log "We got pushed from ${PUSHFROM}"
index 1dffeec..fcc345b 100755 (executable)
@@ -19,6 +19,11 @@ case "${MIRROR_LOCKED-nil}" in
   nil) exec env MIRROR_LOCKED=t locking -f var/mirror.lock "$0" "$@" ;;
 esac
 
+## Hack for mad Kerberized NFS.
+if [ -r etc/krb5.keytab ]; then
+  kinit -k -t etc/krb5.keytab mirror
+fi
+
 ## Before we start, rotate the logs.  (Doing things this way means that we
 ## can be sure we don't lose new logs, even if the log rotation goes
 ## completely mental.
index 7cab6b8..0c7200c 100755 (executable)
@@ -6,5 +6,9 @@
 standard_rsync "$@" \
   --exclude /ien/scanned/ \
   --exclude /tar/ \
-  rsync.mirrorservice.org::ftp.isi.edu/in-notes/ \
+  --exclude /internet-drafts/ \
+  www.ietf.org::everything-ftp/rfc/ \
   /mnt/ftp/pub/mirrors/rfc/
+standard_rsync "$@" \
+  rsync.mirrorservice.org::ftp.isi.edu/internet-drafts/ \
+  /mnt/ftp/pub/mirrors/internet-drafts/