@@ -1467,7 +1467,7 @@ def _change_postgresql_auth_method(connection_type, auth_method, hba_file):
1467
1467
connection_type , connection_type , auth_method , hba_file ), cwd = '/tmp' )
1468
1468
1469
1469
1470
- def _configure_pgsql (system , features , revision ):
1470
+ def _configure_pgsql (system , revision , features ):
1471
1471
""" Configure PostgreSQL DB """
1472
1472
1473
1473
if system == 'freebsd' :
@@ -1618,17 +1618,31 @@ def require_minimum_package_version(package: str, minimum: str):
1618
1618
raise Exception (message )
1619
1619
1620
1620
1621
- def prepare_system_local (features , check_times , ignore_errors_for ):
1621
+ def prepare_system_local (features , check_times , ignore_errors_for , just_configure ):
1622
1622
"""Prepare local system for Kea development based on requested features."""
1623
+ system , revision = get_system_revision ()
1624
+ log .info (f'Preparing deps for { system } { revision } ...' )
1625
+
1626
+ if not just_configure :
1627
+ install_packages_local (system , revision , features , check_times , ignore_errors_for )
1628
+
1629
+ if 'mysql' in features :
1630
+ _configure_mysql (system , revision , features )
1631
+
1632
+ if 'pgsql' in features :
1633
+ _configure_pgsql (system , revision , features )
1634
+
1635
+ log .info ('Preparing deps completed successfully.' )
1636
+
1637
+
1638
+ def install_packages_local (system , revision , features , check_times , ignore_errors_for ):
1639
+ """Install packages for Kea development based on requested features."""
1623
1640
env = os .environ .copy ()
1624
1641
env ['LANGUAGE' ] = env ['LANG' ] = env ['LC_ALL' ] = 'C'
1625
1642
1626
1643
# Actions decided before installing packages, but run afterwards
1627
1644
deferred_functions = []
1628
1645
1629
- system , revision = get_system_revision ()
1630
- log .info ('Preparing deps for %s %s' , system , revision )
1631
-
1632
1646
# Check if package versions cannot be met.
1633
1647
if 'netconf' in features and 'netconf' not in ignore_errors_for :
1634
1648
require_minimum_package_version ('cmake' , '3.19' )
@@ -1998,16 +2012,6 @@ def link_pg_config():
1998
2012
for f in deferred_functions :
1999
2013
f ()
2000
2014
2001
- if 'mysql' in features :
2002
- _configure_mysql (system , revision , features )
2003
-
2004
- if 'pgsql' in features :
2005
- _configure_pgsql (system , features , revision )
2006
-
2007
- #execute('sudo rm -rf /usr/share/doc')
2008
-
2009
- log .info ('Preparing deps completed successfully.' )
2010
-
2011
2015
2012
2016
def prepare_system_in_vagrant (provider , system , revision , features , dry_run , check_times ,
2013
2017
clean_start , ccache_dir = None ):
@@ -2718,6 +2722,9 @@ def parse_args():
2718
2722
"dependencies and pre-configure the system. build command always first calls "
2719
2723
"prepare-system internally." ,
2720
2724
parents = [parent_parser1 , parent_parser2 ])
2725
+ parser .add_argument ('--just-configure' , action = 'store_true' ,
2726
+ help = 'Whether to prevent installation of packages and only proceed to set them up. '
2727
+ 'Only has an effect when preparing system locally, as opposed to inside vagrant.' )
2721
2728
parser .add_argument ('--ccache-dir' , default = None ,
2722
2729
help = 'Path to CCache directory on host system.' )
2723
2730
parser .add_argument ('--repository-url' , default = None ,
@@ -2931,7 +2938,7 @@ def prepare_system_cmd(args):
2931
2938
log .info ('Enabled features: %s' , ' ' .join (features ))
2932
2939
2933
2940
if args .provider == 'local' :
2934
- prepare_system_local (features , args .check_times , args .ignore_errors_for )
2941
+ prepare_system_local (features , args .check_times , args .ignore_errors_for , args . just_configure )
2935
2942
return
2936
2943
2937
2944
ccache_dir = _prepare_ccache_dir (args .ccache_dir , args .system , args .revision )
0 commit comments