Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, junkio@cox.net, Eric Wong <normalperson@yhbt.net>
Subject: Re: [PATCH 4/5] git-instaweb: Fall back to Apache when LigHTTP was not found
Date: Wed, 26 Jul 2006 12:22:31 -0700	[thread overview]
Message-ID: <7vr708qih4.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.63.0607261633560.29667@wbgn013.biozentrum.uni-wuerzburg.de> (Johannes Schindelin's message of "Wed, 26 Jul 2006 16:34:10 +0200 (CEST)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> 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

  reply	other threads:[~2006-07-26 19:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-26 14:34 [PATCH 4/5] git-instaweb: Fall back to Apache when LigHTTP was not found Johannes Schindelin
2006-07-26 19:22 ` Junio C Hamano [this message]
2006-07-26 19:57   ` Johannes Schindelin
2006-07-26 21:11     ` [PATCH] instaweb: Be more clear if httpd or the browser fail Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vr708qih4.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox