source: mod_gnutls/test/required-modules.py

asyncio
Last change on this file was c26a163, checked in by Fiona Klute <fiona.klute@…>, 6 months ago

Remove unused imports

  • Property mode set to 100644
File size: 882 bytes
Line 
1#!/usr/bin/python3
2import os
3import re
4import subprocess
5from pathlib import Path
6
7required_modules = {'logio', 'unixd', 'log_config'}
8
9apache2 = os.environ['APACHE2']
10
11result = subprocess.run([apache2, '-l'], check=True,
12                        stdout=subprocess.PIPE, text=True)
13
14built_in_modules = set()
15mod_re = re.compile(r'^\s+mod_(\w+)\.c')
16for line in result.stdout.splitlines():
17    m = mod_re.match(line)
18    if m:
19        built_in_modules.add(m.group(1))
20
21for mod in (required_modules - built_in_modules):
22    print(f'LoadModule\t{mod}_module\t${{AP_LIBEXECDIR}}/mod_{mod}.so')
23
24# select mpm module, list is ordered by preference
25mpm_choices = ['event', 'worker']
26mod_dir = Path(os.environ['AP_LIBEXECDIR'])
27for mpm in mpm_choices:
28    mod = mod_dir.joinpath(f'mod_mpm_{mpm}.so')
29    if mod.exists():
30        print(f'LoadModule\tmpm_{mpm}_module\t{mod!s}')
31        break
Note: See TracBrowser for help on using the repository browser.