#!/bin/bash set -ex d=/srv/dgit.debian.org ssh iwj@gideon.debian.org " set -ex d=$d"' cd $d mkdir -p transfer.tmp cd transfer.tmp rsync -rltHxp --delete iwj@git.debian.org:/git/dgit-repos/repos.now-on-gideon/. . find \( \( ! -type f ! -type d \) \ -o -perm +5002 -o \! -perm +2555 \ -o -type d \! -perm +2775 \ -o -path \*/hooks/\* ! -name \*.sample \ \) -ls \ >$d/transfer.bad if [ -s $d/transfer.bad ]; then head $d/transfer.bad echo >&2 " BAD" exit 1 fi ( cd $d/transfer.tmp mv irker.git irker.arrgh cp -a _template irker.git cd irker.git git fetch -p ../irker.arrgh "+refs/heads/dgit/*:refs/dgit/*" ) set +x for f in $d/transfer.tmp/*.git; do cp $d/repos/_template/description $f/description touch $f/git-daemon-export-ok (export GIT_DIR=$f master=`git for-each-ref "[r]efs/heads/master"` sid=`git for-each-ref "[r]efs/dgit/sid"` if [ "x$master" = x ] && [ "x$sid" != x ]; then git update-ref refs/heads/master refs/dgit/sid fi) (export GIT_DIR=$f git for-each-ref --format="%(refname)" | while read r; do case "$r" in refs/heads/master) ;; refs/tags/debian/*) ;; refs/dgit/*) ;; *) git update-ref -d "$r" ;; esac done) done cat <$d/transfer.run #!/bin/sh -ex cd $d/transfer.tmp rsync -rltHxp --delete *.git $d/repos/ # _template echo done locally, copying... distrodir=$d/dispatch-dir/distro\=debian \$distrodir/mirror-hook \$distrodir all echo done all. END chmod +x $d/transfer.run ' : "on gideon sudo -u dgit bash $d/transfer.run "