Merge branch 'jk/rev-list-stdin-noop-is-ok'
[gitweb.git] / git-instaweb.sh
index 513efa662e86cb157b8690bfb025556fa0c836f0..eec264e6303684c5886804361c630e1572c1fe09 100755 (executable)
@@ -20,6 +20,7 @@ start          start the web server
 restart        restart the web server
 "
 
+SUBDIRECTORY_OK=Yes
 . git-sh-setup
 
 fqgitdir="$GIT_DIR"
@@ -204,7 +205,7 @@ webrick_conf () {
        # actual gitweb.cgi using a shell script to force it
   wrapper="$fqgitdir/gitweb/$httpd/wrapper.sh"
        cat > "$wrapper" <<EOF
-#!/bin/sh
+#!@SHELL_PATH@
 # we use this shell script wrapper around the real gitweb.cgi since
 # there appears to be no other way to pass arbitrary environment variables
 # into the CGI process
@@ -325,13 +326,17 @@ EOF
 }
 
 apache2_conf () {
-       if test -z "$module_path"
-       then
-               test -d "/usr/lib/httpd/modules" &&
-                       module_path="/usr/lib/httpd/modules"
-               test -d "/usr/lib/apache2/modules" &&
-                       module_path="/usr/lib/apache2/modules"
-       fi
+       for candidate in \
+               /etc/httpd \
+               /usr/lib/apache2 \
+               /usr/lib/httpd ;
+       do
+               if test -d "$candidate/modules"
+               then
+                       module_path="$candidate/modules"
+                       break
+               fi
+       done
        bind=
        test x"$local" = xtrue && bind='127.0.0.1:'
        echo 'text/css css' > "$fqgitdir/mime.types"
@@ -355,7 +360,7 @@ EOF
                        break
                fi
        done
-       for mod in mime dir env log_config authz_core
+       for mod in mime dir env log_config authz_core unixd
        do
                if test -e $module_path/mod_${mod}.so
                then