X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=git-instaweb.sh;h=6a65f255cc63cc7a6d0ae0fc0ce4b65298a40e82;hb=db3df36a3d2e222fa8469c16724a74192c5529a0;hp=80a7f74feabf7e8c7a72e1e2e6c2f233e7ba5d7c;hpb=d718c19bc686a15ed69cd7631e50613dd4901e03;p=git.git diff --git a/git-instaweb.sh b/git-instaweb.sh index 80a7f74fe..6a65f255c 100755 --- a/git-instaweb.sh +++ b/git-instaweb.sh @@ -41,7 +41,7 @@ resolve_full_httpd () { case "$httpd" in *apache2*|*lighttpd*) # ensure that the apache2/lighttpd command ends with "-f" - if ! echo "$httpd" | grep -- '-f *$' >/dev/null 2>&1 + if ! echo "$httpd" | sane_grep -- '-f *$' >/dev/null 2>&1 then httpd="$httpd -f" fi @@ -302,8 +302,8 @@ EOF # check to see if Dennis Stosberg's mod_perl compatibility patch # (<20060621130708.Gcbc6e5c@leonov.stosberg.net>) has been applied - if test -f "$module_path/mod_perl.so" && grep 'MOD_PERL' \ - "$GIT_DIR/gitweb/gitweb.cgi" >/dev/null + if test -f "$module_path/mod_perl.so" && + sane_grep 'MOD_PERL' "$GIT_DIR/gitweb/gitweb.cgi" >/dev/null then # favor mod_perl if available cat >> "$conf" </dev/null 2>&1 || \ - echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf" + list_mods=$(echo "$full_httpd" | sed 's/-f$/-l/') + $list_mods | sane_grep 'mod_cgi\.c' >/dev/null 2>&1 || \ + if test -f "$module_path/mod_cgi.so" + then + echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf" + else + $list_mods | grep 'mod_cgid\.c' >/dev/null 2>&1 || \ + if test -f "$module_path/mod_cgid.so" + then + echo "LoadModule cgid_module $module_path/mod_cgid.so" \ + >> "$conf" + else + echo "You have no CGI support!" + exit 2 + fi + echo "ScriptSock logs/gitweb.sock" >> "$conf" + fi cat >> "$conf" < @@ -380,8 +394,15 @@ gitweb_css () { EOFGITWEB } +gitweb_js () { + cat > "$1" <<\EOFGITWEB +@@GITWEB_JS@@ +EOFGITWEB +} + gitweb_cgi "$GIT_DIR/gitweb/gitweb.cgi" gitweb_css "$GIT_DIR/gitweb/gitweb.css" +gitweb_js "$GIT_DIR/gitweb/gitweb.js" case "$httpd" in *lighttpd*)