From: Tarmigan Casebolt <tarmigan+git@gmail.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org, Tarmigan Casebolt <tarmigan+git@gmail.com>,
Jay Soffian <jaysoffian@gmail.com>
Subject: [PATCH v2] t/lib-http.sh: Restructure finding of default httpd location
Date: Sat, 2 Jan 2010 14:04:25 -0800 [thread overview]
Message-ID: <1262469865-9443-1-git-send-email-tarmigan+git@gmail.com> (raw)
In-Reply-To: <905315640911191930rc33cabdr290b534ffbe85690@mail.gmail.com>
On CentOS 5, 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.
cc: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---
Jay was concerned about the final fallthrough cases for testing these
lists. I have added a test for the modules directory and the existing
tests later in the script already test that the apache executable
exists. If either cannot be found, we do test_done.
Would any machines have httpd or the modules/ directory in several of
these locations?
---
t/lib-httpd.sh | 30 ++++++++++++++++++++++++------
1 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index 6765b08..27b466b 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -12,16 +12,29 @@ fi
HTTPD_PARA=""
+for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2'
+do
+ if test -x "$DEFAULT_HTTPD_PATH"
+ then
+ break
+ fi
+done
+
+for DEFAULT_HTTPD_MODULE_PATH in '/usr/libexec/apache2' \
+ '/usr/lib/apache2/modules' \
+ '/usr/lib64/httpd/modules' \
+ '/usr/lib/httpd/modules'
+do
+ if test -d "$DEFAULT_HTTPD_MODULE_PATH"
+ then
+ break
+ fi
+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"}
@@ -49,6 +62,11 @@ then
say "skipping test, at least Apache version 2 is required"
test_done
fi
+ if ! test -d "$DEFAULT_HTTPD_MODULE_PATH"
+ then
+ say "Apache module directory not found. Skipping tests."
+ test_done
+ fi
LIB_HTTPD_MODULE_PATH="$DEFAULT_HTTPD_MODULE_PATH"
fi
--
1.6.6.236.gc56f3
prev parent reply other threads:[~2010-01-02 22:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Tarmigan Casebolt [this message]
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=1262469865-9443-1-git-send-email-tarmigan+git@gmail.com \
--to=tarmigan+git@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jaysoffian@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).