asyncioproxy-ticket
Last change
on this file since c4ba2b60 was
c4ba2b60,
checked in by Fiona Klute <fiona.klute@…>, 13 months ago
|
Test suite: Automatically detect required modules
Which modules are compiled into the Apache binary varies between
distributions. required-modules.py creates additional LoadModule?
directives if needed.
|
-
Property mode set to
100644
|
File size:
688 bytes
|
Line | |
---|
1 | #!/usr/bin/python3 |
---|
2 | import os |
---|
3 | import re |
---|
4 | import shutil |
---|
5 | import subprocess |
---|
6 | |
---|
7 | required_modules = {'logio', 'unixd', 'log_config'} |
---|
8 | |
---|
9 | apache2 = os.environ.get('APACHE2') |
---|
10 | if not apache2: |
---|
11 | apache2 = shutil.which('apache2') |
---|
12 | if not apache2: |
---|
13 | apache2 = shutil.which('httpd') |
---|
14 | |
---|
15 | result = subprocess.run([apache2, '-l'], check=True, |
---|
16 | stdout=subprocess.PIPE, text=True) |
---|
17 | |
---|
18 | built_in_modules = set() |
---|
19 | mod_re = re.compile(r'^\s+mod_(\w+)\.c') |
---|
20 | for line in result.stdout.splitlines(): |
---|
21 | m = mod_re.match(line) |
---|
22 | if m: |
---|
23 | built_in_modules.add(m.group(1)) |
---|
24 | |
---|
25 | for mod in (required_modules - built_in_modules): |
---|
26 | print(f'LoadModule\t{mod}_module\t${{AP_LIBEXECDIR}}/mod_{mod}.so') |
---|
Note: See
TracBrowser
for help on using the repository browser.