summaryrefslogtreecommitdiff
path: root/get_apache_modules_dirs.py
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2018-08-31 10:31:44 +0200
committerTomas Popela <tpopela@redhat.com>2018-08-31 10:44:22 +0200
commitc6476049e279a6a5c09ea16bbe9bd7c4b17ef7b3 (patch)
treea884943767f3429f615dd0a8e2ea15747e58d7b8 /get_apache_modules_dirs.py
parent0d86b87b4cca4e222bf65dea5397330a40f442d3 (diff)
downloadlibsoup-c6476049e279a6a5c09ea16bbe9bd7c4b17ef7b3.tar.gz
meson: Use apachectl for obtaining the Apache configuration
For running some of the tests we need the Apache's httpd binary. As we want to know more about its configuration we have to run it and parse the output. But here is the first problem, because on Debian we can't run the binary unless the /etc/apache2/envvars file is sourced, otherwise it ends with failure. The recommended way to communicate with the Apache is the apachectl that passes the arguments to httpd and also sources the envvars file. In the ideal world we could use the apachectl to run the tests as well, but on Fedora any non trivial call to it ends with the following error: Passing arguments to httpd using apachectl is no longer supported. The summary is that for the configuration parsing we will use the apachectl, but for running the tests we will use the httpd binary. Closes: #7
Diffstat (limited to 'get_apache_modules_dirs.py')
-rwxr-xr-xget_apache_modules_dirs.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/get_apache_modules_dirs.py b/get_apache_modules_dirs.py
index d1a44ac8..c2428a9c 100755
--- a/get_apache_modules_dirs.py
+++ b/get_apache_modules_dirs.py
@@ -43,27 +43,27 @@ def main():
"""Checks whether the required Apache modules are available and prints their
paths to stdout (values are separated by colons).
- Only one argument is required - path to the Apache httpd2 executable"""
+ Only one argument is required - path to the Apache's apachectl executable"""
if len(sys.argv) != 2:
- print('Only argument with path to the Apache httpd executable expected!', file=sys.stderr)
+ print('Only one argument with path to the Apache apachectl executable expected!', file=sys.stderr)
sys.exit(1)
- httpd_executable = sys.argv[1]
+ apachectl_executable = sys.argv[1]
- if not os.path.isfile(httpd_executable):
- print('The passed Apache httpd executable does not exist!', file=sys.stderr)
+ if not os.path.isfile(apachectl_executable):
+ print('The passed Apache apachectl executable does not exist!', file=sys.stderr)
sys.exit(1)
- apache_prefix = os.path.dirname(os.path.dirname(httpd_executable))
- apache_httpd_output = subprocess.run(
- [httpd_executable, '-V', '-C', 'ServerName localhost'], stdout=subprocess.PIPE)
- if apache_httpd_output.returncode != 0:
- print('Something went wrong when calling Apache httpd executable!', file=sys.stderr)
+ apache_prefix = os.path.dirname(os.path.dirname(apachectl_executable))
+ apachectl_output = subprocess.run(
+ [apachectl_executable, '-V', '-C', 'ServerName localhost'], stdout=subprocess.PIPE)
+ if apachectl_output.returncode != 0:
+ print('Something went wrong when calling ' + apachectl_executable + '!', file=sys.stderr)
sys.exit(1)
mpm_regex = re.compile(r'\nServer MPM:[\s]+([\w]+)\n')
- mpm = mpm_regex.search(apache_httpd_output.stdout.decode('utf-8')).group(1).lower()
+ mpm = mpm_regex.search(apachectl_output.stdout.decode('utf-8')).group(1).lower()
apache_modules_dir = ''
apache_ssl_module_dir = ''