3 export PATH
=/home
/pasky
/bin
:$PATH
7 log
="$(mktemp -t repomgr-XXXXXX)"
14 if ! "$@" >>"$log" 2>&1; then
16 echo "$* failed with error code $?"
19 } |
mail -s "[repo.or.cz] $proj clone failed" "$mail",pasky@ucw.cz
21 # This removes any remnants from /srv/git/$proj.git _and_ gets rid
22 # of the group record.
23 perl
-I/home
/repo
/repomgr
/cgi
-MGit::RepoCGI
-e 'Git::RepoCGI::Project->ghost('"$proj"')->delete;'
24 cd ..
&& rm -r "$proj"
30 bang git clone
--bare "$url" repodir
31 GIT_DIR
=repodir bang git repack
-a -d
32 ! [ -d /srv
/git
/"$proj".git
]
33 bang
mv repodir
/srv
/git
/"$proj".git
34 bang
chmod g
+w base_url owner description homepage README
35 bang
mv base_url owner description homepage README
/srv
/git
/"$proj".git
/
36 cd ..
&& rm -r "$proj"
37 # NO bang AT THIS POINT! rm -r depends on cwd.
38 echo "Congratulations! You can adjust the project settings in the future at http://repo.or.cz/m/p/editproj.cgi." |
mail -s "[repo.or.cz] $proj clone completed" "$mail",pasky@ucw.cz