diff --git a/system_setup/client/client.py b/system_setup/client/client.py index aeb999f4..a9a8a8bb 100644 --- a/system_setup/client/client.py +++ b/system_setup/client/client.py @@ -61,6 +61,7 @@ class SystemSetupClient(SubiquityClient): controllers = [ "Welcome", + "WSLSetupOptions", "WSLIdentity", "WSLConfigurationBase", "Summary", diff --git a/system_setup/client/controllers/__init__.py b/system_setup/client/controllers/__init__.py index 9720388c..51494af7 100644 --- a/system_setup/client/controllers/__init__.py +++ b/system_setup/client/controllers/__init__.py @@ -18,12 +18,14 @@ from .identity import WSLIdentityController from .wslconfbase import WSLConfigurationBaseController from .summary import SummaryController from .wslconfadvanced import WSLConfigurationAdvancedController +from .wslsetupoptions import WSLSetupOptionsController from subiquity.client.controllers import WelcomeController __all__ = [ 'WelcomeController', + 'WSLSetupOptionsController', 'WSLIdentityController', 'WSLConfigurationBaseController', 'WSLConfigurationAdvancedController', diff --git a/system_setup/models/system_setup.py b/system_setup/models/system_setup.py index 2e348954..2ffcc249 100644 --- a/system_setup/models/system_setup.py +++ b/system_setup/models/system_setup.py @@ -24,6 +24,7 @@ from subiquity.server.types import InstallerChannels from .wslconfbase import WSLConfigurationBaseModel from .wslconfadvanced import WSLConfigurationAdvancedModel +from .wslsetupoptions import WSLSetupOptionsModel log = logging.getLogger('system_setup.models.system_setup') @@ -57,6 +58,7 @@ class SystemSetupModel(SubiquityModel): self.packages = [] self.userdata = {} self.locale = LocaleModel(self.chroot_prefix) + self.wslsetupoptions = WSLSetupOptionsModel() self.identity = IdentityModel() self.network = None self.wslconfbase = WSLConfigurationBaseModel() diff --git a/system_setup/server/controllers/__init__.py b/system_setup/server/controllers/__init__.py index 0a544932..a1c6bb49 100644 --- a/system_setup/server/controllers/__init__.py +++ b/system_setup/server/controllers/__init__.py @@ -26,6 +26,7 @@ from .wslconfbase import WSLConfigurationBaseController from .wslconfadvanced import WSLConfigurationAdvancedController from .configure import ConfigureController from .shutdown import SetupShutdownController +from .wslsetupoptions import WSLSetupOptionsController __all__ = [ 'EarlyController', @@ -39,4 +40,5 @@ __all__ = [ 'WSLConfigurationBaseController', 'WSLConfigurationAdvancedController', 'ConfigureController', + 'WSLSetupOptionsController', ] diff --git a/system_setup/server/controllers/configure.py b/system_setup/server/controllers/configure.py index 2585b76f..4d3936c4 100644 --- a/system_setup/server/controllers/configure.py +++ b/system_setup/server/controllers/configure.py @@ -196,6 +196,8 @@ class ConfigureController(SubiquityController): log.error("Packages list in dry-run should never be empty.") return False + log.debug('%s ignored for testing.', + self.model.wslsetupoptions.wslsetupoptions) packs_dir = os.path.join(self.model.root, "var/cache/apt/archives/") os.makedirs(packs_dir, exist_ok=True) @@ -220,7 +222,15 @@ class ConfigureController(SubiquityController): log.info("No missing recommended packages. Nothing to do.") return True - cmd = [aptCommand, "install", "-y"] + packages + cmd = [] + if self.model.wslsetupoptions.wslsetupoptions.\ + install_language_support_packages is True: + cmd = [aptCommand, "install", "-y"] + + else: + cmd = ["/usr/bin/apt-mark", "install"] + + cmd = cmd + packages acp = await arun_command(cmd, env=env) return acp.returncode == 0 diff --git a/system_setup/server/server.py b/system_setup/server/server.py index 1fd161b3..f5cdcbfa 100644 --- a/system_setup/server/server.py +++ b/system_setup/server/server.py @@ -31,6 +31,7 @@ INSTALL_MODEL_NAMES = ModelNames({ "wslconfbase", }, wsl_setup={ + "wslsetupoptions", "identity", }, wsl_configuration={ @@ -51,6 +52,7 @@ class SystemSetupServer(SubiquityServer): "Reporting", "Error", "WSLLocale", + "WSLSetupOptions", "WSLIdentity", "WSLConfigurationBase", "WSLConfigurationAdvanced", diff --git a/system_setup/ui/views/wslsetupoptions.py b/system_setup/ui/views/wslsetupoptions.py index e7f98b05..d8a256da 100644 --- a/system_setup/ui/views/wslsetupoptions.py +++ b/system_setup/ui/views/wslsetupoptions.py @@ -18,7 +18,6 @@ WSLSetupOptions provides user with options to customize the setup experience. """ -from gettext import install from urwid import ( connect_signal, ) @@ -33,15 +32,6 @@ from subiquity.common.types import WSLSetupOptions class WSLSetupOptionsForm(Form): - def __init__(self, initial): - super().__init__(initial=initial) - connect_signal(self.install_language_support_packages.widget, "change", - self.toggle_help) - - -======= -class WSLSetupOptionsForm(Form): ->>>>>>> 18290ac4 (Fixed help strings) install_language_support_packages = \ BooleanField(_("Install packages for better language support"), help=_("Not recommended for slow internet connections."))