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

Re: [PATCH v2] instaweb: make it compatible with Mac OS X 10.5's apache installation.

From
nathan spindel <nathans@gmail.com>
Date
May 11, 2008, 19:41 UTC
Message-ID
<B3990C52-0AF9-490C-86E1-B311144C6661@gmail.com>
In-Reply-To
<1210534569-48466-1-git-send-email-nathans@gmail.com>
On May 11, 2008, at 12:36 PM, nathan spindel wrote:
Show 43 quoted lines
> apache2_conf () {
> -	test -z "$module_path" && module_path=/usr/lib/apache2/modules
> +	# if there isn't an apache2 command on the system but there
> +	# is a httpd command which looks like apache, use that instead
> +	# for Mac OS X compatibility.
> +	httpd_only="`echo $httpd | cut -f1 -d' '`"
> +	if ! type $httpd_only > /dev/null 2>&1
> +	then
> +		found_apache_command=1
> +		httpd_parent_paths="/usr/local/sbin /usr/sbin"
> +		for i in $httpd_parent_paths; do
> +			if test -x "$i/$httpd_only"
> +			then
> +				found_apache_command=0
> +				break
> +			fi
> +		done
> +
> +		if test $found_apache_command != 0
> +		then
> +			alt_apache="httpd"
> +			if type $alt_apache > /dev/null 2>&1
> +			then
> +				$alt_apache -v | grep Apache > /dev/null 2>&1
> +				if test $? == 0
> +				then
> +					httpd=`echo "$httpd" | sed "s/apache2/httpd/"`
> +				else
> +					for i in $httpd_parent_paths; do
> +						if test -x "$i/$alt_apache"
> +						then
> +							$i/$alt_apache -v | grep Apache > /dev/null 2>&1
> +							if test $? == 0
> +							then
> +								httpd=`echo "$httpd" | sed "s/apache2/httpd/"`
> +								break
> +							fi
> +						fi
> +					done
> +				fi
> +			fi
> +		fi
> +	fi

I'd like to see a cleaner implementation of this logic, if anyone has strong shell-fu.

Previous: nathan spindelNext: Christian Couder
Message 2 of 6 in “instaweb: make it compatible with Mac OS X 10.5's apache installation.”
  1. instaweb: make it compatible with Mac OS X 10.5's apache installation.nathan spindel, May 11, 2008
  2. nathan spindelMay 11, 2008
  3. Christian CouderMay 12, 2008
  4. Junio C HamanoMay 12, 2008
  5. nathan spindelMay 13, 2008
  6. Jakub NarebskiMay 13, 2008

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.