git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/5] git-instaweb: Fall back to Apache when LigHTTP was not found

From
Junio C Hamano <junkio@cox.net>
Date
Jul 26, 2006, 19:22 UTC
Message-ID
<7vr708qih4.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0607261633560.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 34 quoted lines
> Apache is more likely to be installed...
>
> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> ---
>  git-instaweb.sh |   12 +++++++++---
>  1 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/git-instaweb.sh b/git-instaweb.sh
> index 1d3ea73..242b55e 100755
> --- a/git-instaweb.sh
> +++ b/git-instaweb.sh
> @@ -25,9 +25,6 @@ conf=$GIT_DIR/gitweb/httpd.conf
>  
>  # Defaults:
>  
> -# if installed, it doesn't need further configuration (module_path)
> -test -z "$httpd" && httpd='lighttpd -f'
> -
>  # probably the most popular browser among gitweb users
>  test -z "$browser" && browser='firefox'
>  
> @@ -135,6 +132,15 @@ do
>  	shift
>  done
>  
> +# if installed, it doesn't need further configuration (module_path)
> +if [ -z "$httpd" ]; then
> +	httpd='lighttpd -f'
> +	which "$httpd" >/dev/null 2>&1 || httpd='apache2 -f'
> +	which "$httpd" >/dev/null 2>&1 || httpd='apache -f'
> +	which "$httpd" >/dev/null 2>&1 || httpd='httpd -f'
> +	which "$httpd" >/dev/null || exit 1
> +fi
> +
Please don't use "which" in scripts.  Consult this thread:
http://thread.gmane.org/gmane.comp.version-control.git/23382/focus=23394
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 2 of 4 in “git-instaweb: Fall back to Apache when LigHTTP was not found”
  1. 4/5 git-instaweb: Fall back to Apache when LigHTTP was not foundJohannes Schindelin, Jul 26, 2006
  2. Junio C HamanoJul 26, 2006
  3. Johannes SchindelinJul 26, 2006
  4. instaweb: Be more clear if httpd or the browser failJohannes Schindelin, Jul 26, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.