All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] t/lib-http.sh: Restructure finding of default httpd location
@ 2009-11-20  1:22 Tarmigan Casebolt
  2009-11-20  1:22 ` [PATCH 2/2] t/lib-http.sh: Enable httpd tests by default Tarmigan Casebolt
  2009-11-20  3:14 ` [PATCH 1/2] t/lib-http.sh: Restructure finding of default httpd location Jay Soffian
  0 siblings, 2 replies; 10+ messages in thread
From: Tarmigan Casebolt @ 2009-11-20  1:22 UTC (permalink / raw)
  To: git; +Cc: peff, jaysoffian, drizzd, gitster, spearce, Tarmigan Casebolt

On my machine with CentOS, httpd is located at /usr/sbin/httpd, and
the modules are located at /usr/lib64/httpd/modules.  To enable easy
testing of httpd, we would like those locations to be detected
automatically.

uname might not be the best way to determine the default location for
httpd since different Linux distributions apparently put httpd in
different places, so we test a couple different locations for httpd,
and use the first one that we come across.  We do the same for the
modules directory.

Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---

Would any machines have httpd or the modules/ directory in several of
these locations?

Also I don't really know shell scripting, so while this Works For Me,
it may be completely wrong.

 t/lib-httpd.sh |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index 6765b08..6b86353 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -12,16 +12,23 @@ fi
 
 HTTPD_PARA=""
 
+for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2'
+do
+	test -x "$DEFAULT_HTTPD_PATH" && break
+done
+
+for DEFAULT_HTTPD_MODULE_PATH in '/usr/libexec/apache2' \
+                                 '/usr/lib/apache2/modules' \
+                                 '/usr/lib64/httpd/modules' \
+                                 '/usr/lib/httpd/modules'
+do
+	test -d "$DEFAULT_HTTPD_MODULE_PATH" && break
+done
+
 case $(uname) in
 	Darwin)
-		DEFAULT_HTTPD_PATH='/usr/sbin/httpd'
-		DEFAULT_HTTPD_MODULE_PATH='/usr/libexec/apache2'
 		HTTPD_PARA="$HTTPD_PARA -DDarwin"
 	;;
-	*)
-		DEFAULT_HTTPD_PATH='/usr/sbin/apache2'
-		DEFAULT_HTTPD_MODULE_PATH='/usr/lib/apache2/modules'
-	;;
 esac
 
 LIB_HTTPD_PATH=${LIB_HTTPD_PATH-"$DEFAULT_HTTPD_PATH"}
-- 
1.6.5.52.g35487

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-01-02 22:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-20  1:22 [PATCH 1/2] t/lib-http.sh: Restructure finding of default httpd location Tarmigan Casebolt
2009-11-20  1:22 ` [PATCH 2/2] t/lib-http.sh: Enable httpd tests by default Tarmigan Casebolt
2009-11-20  8:03   ` Junio C Hamano
2009-11-20 19:03     ` Tarmigan
2009-11-20 20:11       ` Clemens Buchacher
2009-11-20 20:56         ` Junio C Hamano
2009-11-20 20:54       ` Junio C Hamano
2009-11-20  3:14 ` [PATCH 1/2] t/lib-http.sh: Restructure finding of default httpd location Jay Soffian
2009-11-20  3:30   ` Tarmigan
2010-01-02 22:04     ` [PATCH v2] " Tarmigan Casebolt

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.