bin/ftpsync: New version from upstream.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 16 Mar 2012 11:08:59 +0000 (11:08 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 16 Mar 2012 11:21:45 +0000 (11:21 +0000)
bin/ftpsync

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}"