All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: nathan spindel <nathans@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] instaweb: if no httpd is specified and lighttpd doesn't exist, fall back on apache2.
Date: Sun, 11 May 2008 10:00:11 -0700	[thread overview]
Message-ID: <0EB126FA-6752-4C66-B93D-48694159E3B6@gmail.com> (raw)
In-Reply-To: <7vlk2h7318.fsf@gitster.siamese.dyndns.org>

On May 10, 2008, at 11:44 PM, Junio C Hamano wrote:

> nathan spindel <nathans@gmail.com> writes:
>
>> Signed-off-by: nathan spindel <nathans@gmail.com>
>> ---
>> git-instaweb.sh |   12 ++++++++++--
>> 1 files changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/git-instaweb.sh b/git-instaweb.sh
>> index 6f91c8f..b744133 100755
>> --- a/git-instaweb.sh
>> +++ b/git-instaweb.sh
>> @@ -31,8 +31,16 @@ conf="$GIT_DIR/gitweb/httpd.conf"
>>
>> # Defaults:
>>
>> -# if installed, it doesn't need further configuration (module_path)
>> -test -z "$httpd" && httpd='lighttpd -f'
>> +# use lighttpd if it exists, otherwise use apache2
>> +if test -z "$httpd"
>> +then
>> +	if type "lighttpd" > /dev/null 2>&1;
>
> The exit code from "type" is very loosely defined by POSIX which  
> just says
> it exits >0 to signal that "an error occured".  Presumably it means  
> there
> is no such command that is executable on the $PATH, and it may be more
> portable and reliable than using "which", but this still worries me.
>
> Doesn't "lighttpd" have an option that reports "I am here" and exit 0,
> e.g. "--version"?  Then we could instead say:
>
> 	if lighttpd --version >/dev/null
>        then
>        	... use it ...
>
> and that would be much nicer...

I didn't know that the portability of "type" was questionable.  That's  
a good idea.  Thanks!

  reply	other threads:[~2008-05-11 17:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-11  5:26 [PATCH] instaweb: if no httpd is specified and lighttpd doesn't exist, fall back on apache2 nathan spindel
2008-05-11  5:26 ` [PATCH] instaweb: make it compatible with Mac OS X 10.5's apache installation nathan spindel
2008-05-11  5:26   ` [PATCH] Documentation/git-instaweb.txt: Updated defaults to match my last two git-instaweb.sh changes nathan spindel
2008-05-11  6:58   ` [PATCH] instaweb: make it compatible with Mac OS X 10.5's apache installation Junio C Hamano
2008-05-11 17:11     ` nathan spindel
2008-05-11  6:44 ` [PATCH] instaweb: if no httpd is specified and lighttpd doesn't exist, fall back on apache2 Junio C Hamano
2008-05-11 17:00   ` nathan spindel [this message]
2008-05-11 18:26   ` nathan spindel
2008-05-11 11:58 ` David Symonds
2008-05-11 17:03   ` nathan spindel
2008-05-11 17:46     ` Junio C Hamano

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=0EB126FA-6752-4C66-B93D-48694159E3B6@gmail.com \
    --to=nathans@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.