diff options
author | Tomek Mrugalski <tomek@isc.org> | 2022-08-26 09:48:13 +0200 |
---|---|---|
committer | Tomek Mrugalski <tomek@isc.org> | 2022-08-26 10:11:15 +0200 |
commit | 988fbbe272747ba66a14f30683768ee90d461474 (patch) | |
tree | 46e5ed91d52264622dcb28cf897629a4dee27774 /hammer.py | |
parent | [#2534] FreeBSD 13/sphinx/python version fix (diff) | |
download | kea-988fbbe272747ba66a14f30683768ee90d461474.tar.xz kea-988fbbe272747ba66a14f30683768ee90d461474.zip |
[#2534] Dynamic python ver detection
patch by Andrei Pavel
Diffstat (limited to 'hammer.py')
-rwxr-xr-x | hammer.py | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -1778,16 +1778,11 @@ def prepare_system_local(features, check_times): packages = ['autoconf', 'automake', 'libtool', 'openssl', 'log4cplus', 'boost-libs', 'wget'] if 'docs' in features: - # FreeBSD 11 and earlier should have python 3.7 - # FreeBSD 12 seems to have python 3.8 - # FreeBSD 13 has python 3.9 - if float(revision.split('.')[0]) < 12.0: - packages.extend(['py37-sphinx', 'py37-sphinx_rtd_theme']) - else: - if revision.startswith(('12')): - packages.extend(['py38-sphinx', 'py38-sphinx_rtd_theme']) - else: - packages.extend(['py39-sphinx', 'py39-sphinx_rtd_theme']) + # Get the python version from the remote repositories. + _, output = execute("pkg search python | grep -Eo '^python-[0-9]+\.[0-9]+' | cut -d '-' -f 2 | tr -d '.'", + capture=True) + pyv = output.strip() + packages.extend([f'py{pyv}-sphinx', f'py{pyv}-sphinx_rtd_theme']) if 'mysql' in features: if revision.startswith(('11', '12')): |