3 export PATH
=/home
/pasky
/bin
:$PATH
10 log
="$(mktemp -t repomgr-XXXXXX)"
15 if ! "$@" >>"$log" 2>&1; then
17 echo "$* failed with error code $?"
20 } |
mail -s "[repo.or.cz] $proj clone failed" "$mail",pasky@ucw.cz
22 # This removes any remnants from /srv/git/$proj.git _and_ gets rid
23 # of the group record.
24 perl
-I/home
/repo
/repomgr
/cgi
-MGit::RepoCGI
-e 'Git::RepoCGI::Project->ghost('"'$proj'"')->delete;'
25 cd "$basedir" && rm -rf "$proj"/* && rmdir -p "$proj"
32 if [ -s objects
/info
/alternates
]; then
33 ref
=(--reference "$(cat objects/info/alternates | sed 's#/objects$##')")
35 bang git clone
"${ref[@]}" --bare "$url" repodir
36 ! [ -d /srv
/git
/"$proj".git
]
37 lproj
="$(echo "$proj" | sed 's/^\(.*\/\)\(.*\)/\1/')"
38 if [ z
"$lproj" != z
"$proj" ]; then
39 bang mkdir
-m 0775 -p /srv
/git
/"$lproj"
41 bang
mv repodir
/srv
/git
/"$proj".git
42 bang
chmod g
+w base_url owner description homepage README.html
43 bang
mv base_url owner description homepage README.html
/srv
/git
/"$proj".git
/
44 #bang mv objects/info/alternates /srv/git/"$proj".git/objects/info/alternates # git clone should've set up that for us
45 GIT_DIR
=/srv
/git
/"$proj".git bang git config
--bool --add mirror.allowed true
46 GIT_DIR
=/srv
/git
/"$proj".git bang git update-server-info
47 cd "$basedir" && rm -rf "$proj"/* && rmdir -p "$proj"
48 # NO bang AT THIS POINT! rm -r depends on cwd.
49 mail -s "[repo.or.cz] $proj clone completed" "$mail",pasky@ucw.cz
<<EOT
50 Congratulations! The clone of project $proj just completed. You can now adjust
51 the project settings at
53 http://repo.or.cz/m/editproj.cgi?name=$proj
55 Then check out the cool stuff at http://repo.or.cz/w/$proj.git !
62 if [ -f "$proj"/base_url
]; then
66 # a collection of subprojects
67 find "$proj" -name base_url |
68 sed -e 's/\/base_url$//' |
70 (cd "$proj" && clone_project
) ||
: