+ cd $git
+ git update-server-info
+ cd - >& /dev/null
+ done
+ echo ""
+}
+
+function check_permissions () {
+ echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx checking permissions "
+ for arg in "$@" ; do
+ # accept args like plcapi or plcapi.git
+ b=$(basename $arg .git)
+ git=${b}.git
+ owner=root:onelab
+ if [ -f $git/owner ] ; then owner=$(cat $git/owner); fi
+ echo -n "$git ($owner) "
+ chown -R $owner $git
+ chmod -R g+w,o-w $git
+ done
+ echo ""
+}
+
+function check_configs () {
+ echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx checking config (upload*, hooks...) "
+ for arg in "$@" ; do
+ # accept args like plcapi or plcapi.git
+ b=$(basename $arg .git)
+ git=${b}.git
+ echo -n "$git "
+ cd $git
+ git config core.bare true; echo -n "bare ";
+ git config core.sharedrepository >& /dev/null || { git config core.sharedrepository true; echo -n "sharedrepository "; }
+ git config daemon.uploadpack >& /dev/null || { git config daemon.uploadpack true; echo -n "uploadpack "; }
+ git config daemon.uploadarch >& /dev/null || { git config daemon.uploadarch true; echo -n "uploadarch "; }
+ (git config hooks.mailinglist|grep $MLIST) >& /dev/null || { git config hooks.mailinglist $MLIST; echo -n "mailinglist "; }
+ (git config hooks.announcelist|grep $MLIST) >& /dev/null || { git config hooks.announcelist $MLIST; echo -n "announcelist "; }
+ (git config hooks.envelopesender|grep $MLIST) >& /dev/null || { git config hooks.envelopesender $MLIST; echo -n "envelopesender "; }
+ git config hooks.emailprefix >& /dev/null || { git config hooks.emailprefix ''; echo -n "emailprefix "; }
+ cd - >& /dev/null
+ done
+ echo ""
+}
+
+function check_hooks () {
+ echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx checking hooks "
+ for arg in "$@" ; do
+ # accept args like plcapi or plcapi.git
+ b=$(basename $arg .git)
+ git=${b}.git
+ echo -n "$git "
+ # standard version is in /usr/share/doc/git-1.5.5.6/hooks/post-receive-email
+ (cd $git/hooks; cp -f /root/bin/post-receive-email-with-diffs post-receive; chmod 755 post-receive )