chiark / gitweb /
as found, moving from ..
[dgit-junk.git] / copy-alioth-to-gideon
1 #!/bin/bash
2 set -ex
3
4 d=/srv/dgit.debian.org
5
6 ssh iwj@gideon.debian.org "
7         set -ex
8
9         d=$d"'
10
11         cd $d
12         mkdir -p transfer.tmp
13         cd transfer.tmp
14
15         rsync -rltHxp --delete iwj@git.debian.org:/git/dgit-repos/repos/. .
16
17         find \(         \( ! -type f ! -type d \) \
18                 -o      -perm +5002 -o \! -perm +2555 \
19                 -o      -type d \! -perm +2775 \
20                 -o      -path \*/hooks/\* ! -name \*.sample \
21                 \) -ls \
22                 >$d/transfer.bad
23         if [ -s $d/transfer.bad ]; then
24                 head $d/transfer.bad
25                 echo >&2 " BAD"
26                 exit 1
27         fi
28
29         set +x
30         for f in $d/transfer.tmp/*.git; do
31                 cp $d/repos/_template/description $f/description
32         done
33
34         cat <<END >$d/transfer.run
35                 #!/bin/sh -ex
36                 cd $d/transfer.tmp
37                 rsync -rltHxp --delete *.git $d/repos/
38                 # _template
39                 echo done.
40 END
41         chmod +x $d/transfer.run
42 '
43
44 : "on gideon
45         sudo -u dgit bash
46         $d/transfer.run
47 "