set uploadpack to true as well
[infrastructure.git] / scripts / git-check.sh
index e98ec6a..5b30f8f 100755 (executable)
@@ -43,11 +43,11 @@ function upload_archives () {
        b=$(basename $arg .git)
        git=${b}.git
        echo -n "$git "
-       if ! grep uploadarch $git/config ; then
+       if ! grep -q uploadarch $git/config ; then
            echo -n $i "Setting.. "; 
            cat >> $git/config <<EOF
 [daemon]
-       uploadpack = false
+       uploadpack = true
        uploadarch = true
 EOF
        fi
@@ -55,6 +55,22 @@ EOF
     echo ""
 }
 
-missing_gitweb
-fill_descriptions $(ls -d *.git)
-upload_archives $(ls -d *.git)
+function check_permissions () {
+    echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx checking descriptions "
+    for arg in "$@" ; do
+       # accept args like plcapi or plcapi.git
+       b=$(basename $arg .git)
+       git=${b}.git
+       echo -n "$git "
+       chown -R root:onelab $git
+       chmod -R g+w,o-w $git
+    done
+    echo ""
+}
+
+# missing_gitweb
+args="$@"
+[[ -z "$args" ]] && args=$(ls -d *.git)
+fill_descriptions $args
+upload_archives $args
+check_permissions $args