summaryrefslogtreecommitdiffstats
path: root/hammer.py
diff options
context:
space:
mode:
authorAndrei Pavel <andrei@isc.org>2024-01-23 13:57:08 +0100
committerAndrei Pavel <andrei@isc.org>2024-01-26 10:02:14 +0100
commit223dc3aad300cef8a59d478ef749ae1a885d37e3 (patch)
tree9fc26b74356ad6ac6a78b1fe2399472e4b782402 /hammer.py
parent[#3123] add documentation for the peer-updates flag in radius (diff)
downloadkea-223dc3aad300cef8a59d478ef749ae1a885d37e3.tar.xz
kea-223dc3aad300cef8a59d478ef749ae1a885d37e3.zip
[#3229] hammer.py prepare-system --just-configure
Diffstat (limited to 'hammer.py')
-rwxr-xr-xhammer.py39
1 files changed, 23 insertions, 16 deletions
diff --git a/hammer.py b/hammer.py
index 66a05a02bf..caf52ca1e9 100755
--- a/hammer.py
+++ b/hammer.py
@@ -1467,7 +1467,7 @@ def _change_postgresql_auth_method(connection_type, auth_method, hba_file):
connection_type, connection_type, auth_method, hba_file), cwd='/tmp')
-def _configure_pgsql(system, features, revision):
+def _configure_pgsql(system, revision, features):
""" Configure PostgreSQL DB """
if system == 'freebsd':
@@ -1618,17 +1618,31 @@ def require_minimum_package_version(package: str, minimum: str):
raise Exception(message)
-def prepare_system_local(features, check_times, ignore_errors_for):
+def prepare_system_local(features, check_times, ignore_errors_for, just_configure):
"""Prepare local system for Kea development based on requested features."""
+ system, revision = get_system_revision()
+ log.info(f'Preparing deps for {system} {revision}...')
+
+ if not just_configure:
+ install_packages_local(system, revision, features, check_times, ignore_errors_for)
+
+ if 'mysql' in features:
+ _configure_mysql(system, revision, features)
+
+ if 'pgsql' in features:
+ _configure_pgsql(system, revision, features)
+
+ log.info('Preparing deps completed successfully.')
+
+
+def install_packages_local(system, revision, features, check_times, ignore_errors_for):
+ """Install packages for Kea development based on requested features."""
env = os.environ.copy()
env['LANGUAGE'] = env['LANG'] = env['LC_ALL'] = 'C'
# Actions decided before installing packages, but run afterwards
deferred_functions = []
- system, revision = get_system_revision()
- log.info('Preparing deps for %s %s', system, revision)
-
# Check if package versions cannot be met.
if 'netconf' in features and 'netconf' not in ignore_errors_for:
require_minimum_package_version('cmake', '3.19')
@@ -1998,16 +2012,6 @@ def prepare_system_local(features, check_times, ignore_errors_for):
for f in deferred_functions:
f()
- if 'mysql' in features:
- _configure_mysql(system, revision, features)
-
- if 'pgsql' in features:
- _configure_pgsql(system, features, revision)
-
- #execute('sudo rm -rf /usr/share/doc')
-
- log.info('Preparing deps completed successfully.')
-
def prepare_system_in_vagrant(provider, system, revision, features, dry_run, check_times,
clean_start, ccache_dir=None):
@@ -2718,6 +2722,9 @@ def parse_args():
"dependencies and pre-configure the system. build command always first calls "
"prepare-system internally.",
parents=[parent_parser1, parent_parser2])
+ parser.add_argument('--just-configure', action='store_true',
+ help='Whether to prevent installation of packages and only proceed to set them up. '
+ 'Only has an effect when preparing system locally, as opposed to inside vagrant.')
parser.add_argument('--ccache-dir', default=None,
help='Path to CCache directory on host system.')
parser.add_argument('--repository-url', default=None,
@@ -2931,7 +2938,7 @@ def prepare_system_cmd(args):
log.info('Enabled features: %s', ' '.join(features))
if args.provider == 'local':
- prepare_system_local(features, args.check_times, args.ignore_errors_for)
+ prepare_system_local(features, args.check_times, args.ignore_errors_for, args.just_configure)
return
ccache_dir = _prepare_ccache_dir(args.ccache_dir, args.system, args.revision)