X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Ffiles%2Fstatic-mirroring%2Fstaticsync-ssh-wrap;h=2858f4d13527c9dc9b6967c46e53699c522283cf;hb=161663512511e5505641707a91456f474d6863ed;hp=2cb8c317928a0089c1e0e7fdb513118bf8417915;hpb=99bad8b10f0c2053d5fbdafc9c1a92a8d5de7339;p=mirror%2Fdsa-puppet.git diff --git a/modules/roles/files/static-mirroring/staticsync-ssh-wrap b/modules/roles/files/static-mirroring/staticsync-ssh-wrap index 2cb8c3179..2858f4d13 100755 --- a/modules/roles/files/static-mirroring/staticsync-ssh-wrap +++ b/modules/roles/files/static-mirroring/staticsync-ssh-wrap @@ -25,7 +25,7 @@ set -e set -u MYLOGNAME="`basename "$0"`[$$]" -BASEDIR="/home/staticsync/static-master" +BASEDIR="/srv/static.debian.org" COMPONENTLIST=/etc/static-components.conf usage() { @@ -59,7 +59,7 @@ do_mirror() { one_more_arg "$@" local serial="$1"; shift - masterhost="$(awk -v component="$component" '$2 == component {print $1; exit}' "$COMPONENTLIST")" + masterhost="$(awk -v component="$component" '!/^ *(#|$)/ && $2 == component {print $1; exit}' "$COMPONENTLIST")" if [ -z "$masterhost" ]; then croak "Did not find master for component $component." elif [ "$masterhost" != "$remote_host" ]; then @@ -76,7 +76,7 @@ do_rsync_on_master() { local remote_host="$1"; shift local args="--server --sender -vlHtrze.iLsf --safe-links ." - for component in $(awk -v this_host="$(hostname -f)" '$1 == this_host {print $2}' $COMPONENTLIST); do + for component in $(awk -v this_host="$(hostname -f)" '!/^ *(#|$)/ && $1 == this_host {print $2}' $COMPONENTLIST); do if [ "$*" = "$args $component/-new-/" ] || [ "$*" = "$args ./$component/-new-/" ] ; then local path="$BASEDIR/master/$component-current-push" info "serving $remote_host with $path" @@ -104,7 +104,7 @@ do_rsync_on_source() { allowed_rsyncs=() if [ -e "$COMPONENTLIST" ]; then - for path in $(awk -v host="$(hostname -f)" '$3 == host {print $4}' $COMPONENTLIST); do + for path in $(awk -v host="$(hostname -f)" '!/^ *(#|$)/ && $3 == host {print $4}' $COMPONENTLIST); do allowed_rsyncs+=("--server --sender -lHtrze.iLsf --safe-links . $path/.") done fi @@ -136,7 +136,7 @@ do_update_component() { hit="$( awk -v this_host="$(hostname -f)" -v component="$component" -v host="$remote_host" ' - $1 == this_host && $2 == component { + !/^ *(#|$)/ && $1 == this_host && $2 == component { if ($3 == host) { print $4 exit