From 39e1b9b1b4d94134097087fe068de4b652895af5 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 2 Jan 2019 15:55:50 +0100 Subject: [PATCH 01/11] remove unused update_wizard_steps helper --- src/clients/update_wizard_steps.rb | 2 - .../clients/update_wizard_steps.rb | 53 ------------------- 2 files changed, 55 deletions(-) delete mode 100644 src/clients/update_wizard_steps.rb delete mode 100644 src/lib/installation/clients/update_wizard_steps.rb diff --git a/src/clients/update_wizard_steps.rb b/src/clients/update_wizard_steps.rb deleted file mode 100644 index e749bd82e..000000000 --- a/src/clients/update_wizard_steps.rb +++ /dev/null @@ -1,2 +0,0 @@ -require "installation/clients/update_wizard_steps" -Yast::UpdateWizardStepsClient.new.main diff --git a/src/lib/installation/clients/update_wizard_steps.rb b/src/lib/installation/clients/update_wizard_steps.rb deleted file mode 100644 index 23c0e92f0..000000000 --- a/src/lib/installation/clients/update_wizard_steps.rb +++ /dev/null @@ -1,53 +0,0 @@ -# encoding: utf-8 - -# ------------------------------------------------------------------------------ -# Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved. -# -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of version 2 of the GNU General Public License as published by the -# Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, contact Novell, Inc. -# -# To contact Novell about this file by physical or electronic mail, you may find -# current contact information at www.novell.com. -# ------------------------------------------------------------------------------ - -# File: -# update_wizard_steps.ycp -# -# Module: -# Installation -# -# Authors: -# Lukas Ocilka -# -# Summary: -# Script can be called from another installation modules. -# It has been designed just to redraw the installation -# steps. Call it only if needed. -# WFM::call ("update_wizard_steps") -# -# $Id$ -# -module Yast - class UpdateWizardStepsClient < Client - def main - Yast.import "UI" - textdomain "installation" - - Yast.include self, "installation/misc.rb" - - Builtins.y2milestone("Updating/redrawing wizard steps...") - UpdateWizardSteps() - - :auto - end - end -end From e2eb87998958d4634159effce0a2b25d4e54f8f4 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 2 Jan 2019 16:34:12 +0100 Subject: [PATCH 02/11] remove deprecated client for checking autoyast on floppy --- src/clients/inst_check_autoinst_mode.rb | 2 - .../clients/inst_check_autoinst_mode.rb | 77 ------------------- .../clients/inst_worker_initial.rb | 5 -- 3 files changed, 84 deletions(-) delete mode 100644 src/clients/inst_check_autoinst_mode.rb delete mode 100644 src/lib/installation/clients/inst_check_autoinst_mode.rb diff --git a/src/clients/inst_check_autoinst_mode.rb b/src/clients/inst_check_autoinst_mode.rb deleted file mode 100644 index 443dff9f4..000000000 --- a/src/clients/inst_check_autoinst_mode.rb +++ /dev/null @@ -1,2 +0,0 @@ -require "installation/clients/inst_check_autoinst_mode" -Yast::InstCheckAutoinstModeClient.new.main diff --git a/src/lib/installation/clients/inst_check_autoinst_mode.rb b/src/lib/installation/clients/inst_check_autoinst_mode.rb deleted file mode 100644 index f5d1e6719..000000000 --- a/src/lib/installation/clients/inst_check_autoinst_mode.rb +++ /dev/null @@ -1,77 +0,0 @@ -# encoding: utf-8 - -# ------------------------------------------------------------------------------ -# Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved. -# -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of version 2 of the GNU General Public License as published by the -# Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, contact Novell, Inc. -# -# To contact Novell about this file by physical or electronic mail, you may find -# current contact information at www.novell.com. -# ------------------------------------------------------------------------------ - -# File: clients/inst_check_autoinst_mode.ycp -# Package: Installation -# Summary: Installation mode selection, checking for autoinst.xml on floppy -# Authors: Lukas Ocilka -# -# $Id$ -# -module Yast - class InstCheckAutoinstModeClient < Client - def main - textdomain "installation" - -# storage-ng -# rubocop:disable Style/BlockComments -=begin - Yast.import "StorageDevices" -=end - Yast.import "Mode" - - Builtins.y2milestone("Checking for autoinst.xml on floppy...") - -# storage-ng -=begin - # do we have a floppy drive attached ? - if StorageDevices.FloppyReady - # Try to load settings from disk, if a floppy is present - SCR.Execute( - path(".target.mount"), - [StorageDevices.FloppyDevice, "/media/floppy"], - "-t auto" - ) - - # Check for autoinst.xml. if available - # set mode to autoinst. Later, the file is parsed and installation - # is performed automatically. - - if Ops.greater_than( - SCR.Read(path(".target.size"), "/media/floppy/autoinst.xml"), - 0 - ) - Builtins.y2milestone("Found control file, switching to autoinst mode") - Mode.SetMode("autoinstallation") - # initialize Report behavior - # Default in autoinst mode is showing messages and warnings with timeout of 10 sec. - # Errors are shown without timeout. - end - SCR.Execute(path(".target.umount"), "/media/floppy") - end -=end - - true - - # EOF - end - end -end diff --git a/src/lib/installation/clients/inst_worker_initial.rb b/src/lib/installation/clients/inst_worker_initial.rb index 3bf52b1d4..d9238173d 100644 --- a/src/lib/installation/clients/inst_worker_initial.rb +++ b/src/lib/installation/clients/inst_worker_initial.rb @@ -94,11 +94,6 @@ def main # Shows fallback message if running in textmode (if used as fallback) ShowTextFallbackMessage() - # First stage - if !Mode.screen_shot && !Stage.firstboot - WFM.CallFunction("inst_check_autoinst_mode", []) - end - @ret = nil # --- Runing the installation workflow --- From a252beef721ed5874de4d92c66f5df43bf6d3dbb Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 2 Jan 2019 16:47:18 +0100 Subject: [PATCH 03/11] remove unused imports --- src/lib/installation/clients/umount_finish.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/lib/installation/clients/umount_finish.rb b/src/lib/installation/clients/umount_finish.rb index 55c5872d3..80b9b5eed 100644 --- a/src/lib/installation/clients/umount_finish.rb +++ b/src/lib/installation/clients/umount_finish.rb @@ -44,11 +44,8 @@ def main Yast.import "Installation" Yast.import "Hotplug" - Yast.import "Vendor" Yast.import "String" - Yast.import "Internet" Yast.import "FileUtils" - Yast.import "ProductFeatures" @ret = nil @func = "" From 133f18e480a2596dc6f0e06fbc02663fee9fe05d Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 2 Jan 2019 16:52:32 +0100 Subject: [PATCH 04/11] remove no longer used inst_ask_online_update --- src/clients/inst_ask_online_update.rb | 2 - .../clients/inst_ask_online_update.rb | 160 ------------------ 2 files changed, 162 deletions(-) delete mode 100644 src/clients/inst_ask_online_update.rb delete mode 100644 src/lib/installation/clients/inst_ask_online_update.rb diff --git a/src/clients/inst_ask_online_update.rb b/src/clients/inst_ask_online_update.rb deleted file mode 100644 index 543657d7e..000000000 --- a/src/clients/inst_ask_online_update.rb +++ /dev/null @@ -1,2 +0,0 @@ -require "installation/clients/inst_ask_online_update" -Yast::InstAskOnlineUpdateClient.new.main diff --git a/src/lib/installation/clients/inst_ask_online_update.rb b/src/lib/installation/clients/inst_ask_online_update.rb deleted file mode 100644 index 082b931a8..000000000 --- a/src/lib/installation/clients/inst_ask_online_update.rb +++ /dev/null @@ -1,160 +0,0 @@ -# encoding: utf-8 - -# ------------------------------------------------------------------------------ -# Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved. -# -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of version 2 of the GNU General Public License as published by the -# Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, contact Novell, Inc. -# -# To contact Novell about this file by physical or electronic mail, you may find -# current contact information at www.novell.com. -# ------------------------------------------------------------------------------ - -# File: clients/inst_ask_online_update.ycp -# Module: Installation -# Summary: Ask if the user wants to run an online update during installation -# Authors: J. Daniel Schmidt -# -# Ask if the user wants to run an online update during installation -# -# $Id: inst_ask_online_update.ycp 1 2006-02-17 13:20:02Z jdsn $ -module Yast - class InstAskOnlineUpdateClient < Client - def main - Yast.import "Pkg" - Yast.import "UI" - textdomain "installation" - - # FIXME: move to yast2-registration later, it doesn't belog here - - Yast.import "Wizard" - Yast.import "Popup" - Yast.import "GetInstArgs" - Yast.import "CustomDialogs" - Yast.import "Directory" - Yast.import "Language" - Yast.import "Mode" - Yast.import "String" - Yast.import "Label" - Yast.import "Internet" - Yast.import "Installation" - Yast.import "NetworkService" - - # BNC #572734 - if GetInstArgs.going_back - Builtins.y2milestone("going_back -> returning `auto") - return :auto - end - - # BNC #450229 - # There used to be >if (!Internet::do_you)< - if NetworkService.isNetworkRunning != true - Builtins.y2milestone("No network running, skipping online update...") - return :auto - end - - @ui = UI.GetDisplayInfo - - @argmap = GetInstArgs.argmap - - # strings for "ask for online update"-popup - @ask_update_run_btn = _("Run Update") - @ask_update_skip_btn = _("Skip Update") - - @online_update = _("Online Update") - @ask_update_main = _("Run Online Update now?") - - @help = _( - "Select whether to run an online update now.\nYou may skip this step and run an online update later.\n" - ) - - # vv MAIN (WIZARD) LAYOUT vv - @sr_layout = nil - @sr_layout = HVSquash( - VBox( - Left(Label(@ask_update_main)), - Left( - RadioButtonGroup( - Id(:run_update), - HBox( - HSpacing(1), - VBox( - Left(RadioButton(Id(:update), @ask_update_run_btn, true)), - Left(RadioButton(Id(:noupdate), @ask_update_skip_btn)) - ), - HSpacing(1) - ) - ) - ) - ) - ) - - @contents = VBox(VSpacing(0.5), @sr_layout, VSpacing(0.5)) - # ^^ END MAIN LAYOUT ^^ - - # check if there are some patches available - - # BNC #447080 - Pkg.TargetInitialize(Installation.destdir) - Pkg.TargetLoad - Pkg.SourceStartManager(true) - - # Patches need solver run to be selected - Pkg.PkgSolve(true) - - @selected = Pkg.ResolvableCountPatches(:affects_pkg_manager) - Builtins.y2milestone( - "Available patches for pkg management: %1", - @selected - ) - if Ops.less_than(@selected, 1) - @selected = Pkg.ResolvableCountPatches(:all) - Builtins.y2milestone("All available patches: %1", @selected) - if Ops.less_than(@selected, 1) - Builtins.y2milestone("No patch available, skiping offer to run YOU") - Internet.do_you = false - return :next - end - end - - # check if we are in installation workflow or running independently (for development) - Wizard.CreateDialog if Mode.normal - - Wizard.SetContents( - @online_update, - @contents, - @help, - GetInstArgs.enable_back, - GetInstArgs.enable_next - ) - - @ret = nil - loop do - @ret = Wizard.UserInput - - if @ret == :abort - break if Mode.normal - break if Popup.ConfirmAbort(:incomplete) - elsif @ret == :help - Wizard.ShowHelp(@help) - elsif @ret == :next - # Skipping online update - # needed later BNC #450229 - Internet.do_you = !UI.QueryWidget(Id(:noupdate), :Value) - end - break if [:next, :back].include?(@ret) - end - - Convert.to_symbol(@ret) - end - end -end From 410e060e134821f0d9c4beacf7cfe540faa7503f Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 2 Jan 2019 16:58:03 +0100 Subject: [PATCH 05/11] remove unused sysconfig boot agent. File no longer exist --- src/scrconf/cfg_boot.scr | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 src/scrconf/cfg_boot.scr diff --git a/src/scrconf/cfg_boot.scr b/src/scrconf/cfg_boot.scr deleted file mode 100644 index 36bb50a26..000000000 --- a/src/scrconf/cfg_boot.scr +++ /dev/null @@ -1,15 +0,0 @@ -/** - * File: - * cfg_boot.scr - * Summary: - * SCR Agent for reading/writing /etc/sysconfig/boot - * using the sysconfig-agent - * - * Read/Sets the values defined in /etc/sysconfig/boot - * in an easy manner. - */ -.sysconfig.boot - -`ag_ini( - `SysConfigFile("/etc/sysconfig/boot") -) From 21f6bcaf33103dde999147ea8f056e58d16bb2c4 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 2 Jan 2019 16:58:52 +0100 Subject: [PATCH 06/11] remove unused sysconfig fam agent. No longer used --- src/scrconf/cfg_fam.scr | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 src/scrconf/cfg_fam.scr diff --git a/src/scrconf/cfg_fam.scr b/src/scrconf/cfg_fam.scr deleted file mode 100644 index b1c2a14e8..000000000 --- a/src/scrconf/cfg_fam.scr +++ /dev/null @@ -1,16 +0,0 @@ -/** - * File: - * cfg_windowmanager.scr - * Summary: - * SCR Agent for reading/writing /etc/sysconfig/windowmanager - * using the sysconfig-agent - * $Id$ - * - * Read/Sets the values defined in /etc/sysconfig/windowmanager - * in an easy manner. - */ -.sysconfig.fam - -`ag_ini( - `SysConfigFile("/etc/sysconfig/fam") -) From e5e3a4c0f0035055397b645fe44e0eb670688f9f Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 2 Jan 2019 17:13:05 +0100 Subject: [PATCH 07/11] remove no longer used install inf aliases workaround --- src/scrconf/etc_install_inf.scr | 2 +- src/scrconf/etc_install_inf_alias.scr | 39 --------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 src/scrconf/etc_install_inf_alias.scr diff --git a/src/scrconf/etc_install_inf.scr b/src/scrconf/etc_install_inf.scr index 1cded6a26..e251c03dd 100644 --- a/src/scrconf/etc_install_inf.scr +++ b/src/scrconf/etc_install_inf.scr @@ -15,7 +15,7 @@ * (true) * * WARNING! Ini agent cannot handle multiple entries with the same name, - * such as Alias in install.inf. Use .etc.install_inf_alias instead. + * such as Alias in install.inf. * * $Id$ */ diff --git a/src/scrconf/etc_install_inf_alias.scr b/src/scrconf/etc_install_inf_alias.scr deleted file mode 100644 index 8501c48ef..000000000 --- a/src/scrconf/etc_install_inf_alias.scr +++ /dev/null @@ -1,39 +0,0 @@ -/** - * File: etc_install_inf_alias.scr - * Summary: Agent for reading/writing module aliases in /etc/install.inf - * Access: read only - * Author: Martin Vidner - * - * Bug #24836: ini agent cannot handle multiple Alias entries. - * - * Example: - * Dir(.etc.install_inf_alias) - * (["eth0", "eth1"]) - ** - * Read(.etc.install_inf_alias.eth0) - * ("pcnet32") - * - * $Id$ - */ -.etc.install_inf_alias - -`ag_ini( - `IniAgent( "/etc/install.inf", - $[ - "options" : [ "read_only", "global_values", "flat" ], - // Everything except the pattern in "params" is a comment. - // I love negated regexps. - "comments" : [ - "^[ \t]*[^A].*", - "^[ \t]*A[^l].*", - "^[ \t]*Al[^i].*", - "^[ \t]*Ali[^a].*", - "^[ \t]*Alia[^s].*", - "^[ \t]*Alias[^ \t:].*", - ], - "params" : [ - $[ "match" : [ "^[ \t]*Alias[ \t]*:[ \t]*(.*)[ \t]+(.*)[ \t]*$", "Alias: %s %s" ] ] - ] - ] - ) -) From ec7f2a951efb8e054961d7408a37024618b8b226 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 2 Jan 2019 17:13:53 +0100 Subject: [PATCH 08/11] remove no longer used install inf options workaround --- src/scrconf/etc_install_inf_options.scr | 39 ------------------------- 1 file changed, 39 deletions(-) delete mode 100644 src/scrconf/etc_install_inf_options.scr diff --git a/src/scrconf/etc_install_inf_options.scr b/src/scrconf/etc_install_inf_options.scr deleted file mode 100644 index 28d301905..000000000 --- a/src/scrconf/etc_install_inf_options.scr +++ /dev/null @@ -1,39 +0,0 @@ -/** - * File: etc_install_inf_options.scr - * Summary: Agent for reading/writing module options in /etc/install.inf - * Access: read only - * Author: Martin Vidner - * - * Example: - * Dir(.etc.install_inf_options) - * (["3c59x"]) - ** - * Read(.etc.install_inf_options.eth0) - * ("debug=6") - * - * $Id$ - */ -.etc.install_inf_options - -`ag_ini( - `IniAgent( "/etc/install.inf", - $[ - "options" : [ "read_only", "global_values", "flat" ], - // Everything except the pattern in "params" is a comment. - // I love negated regexps. - "comments" : [ - "^[ \t]*[^O].*", - "^[ \t]*O[^p].*", - "^[ \t]*Op[^t].*", - "^[ \t]*Opt[^i].*", - "^[ \t]*Opti[^o].*", - "^[ \t]*Optio[^n].*", - "^[ \t]*Option[^s].*", - "^[ \t]*Options[^ \t:].*", - ], - "params" : [ - $[ "match" : [ "^[ \t]*Options[ \t]*:[ \t]*([^ \t]*)[ \t]+(.*)$", "Options: %s %s" ] ] - ] - ] - ) -) From 04c4734214caa391712a5286f15446e62b39ce17 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 2 Jan 2019 17:15:38 +0100 Subject: [PATCH 09/11] remove unused agent for installation passwd --- src/scrconf/etc_passwd.scr | 73 -------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 src/scrconf/etc_passwd.scr diff --git a/src/scrconf/etc_passwd.scr b/src/scrconf/etc_passwd.scr deleted file mode 100644 index 9d9fc2787..000000000 --- a/src/scrconf/etc_passwd.scr +++ /dev/null @@ -1,73 +0,0 @@ -/** - * File: - * etc_passwd.scr - * Summary: - * SCR Agent for reading /etc/passwd - * Access: - * read-only - * Authors: - * Unknown - * See: - * anyagent - * libscr - * man passwd(5) - * Example: - * Read(.etc.passwd) - * ([$["fullname":"root", "gid":0, "home":"/root", "password":"x", - * "shell":"/bin/bash", "uid":0, "username":"root"], - * $["fullname":"bin", "gid":1, "home":"/bin", "password":"x", - * "shell":"/bin/bash", "uid":1, "username":"bin"], - * $["fullname":"daemon", "gid":2,"home":"/sbin", "password":"x", - * ... - * ]) - * - * $Id$ - * - * Returns a list of maps. Each map (list-entry) corresponds - * with one user. - * Keys for the maps are: "username", "password", "uid", "gid", "fullname", "home" and "shell". - */ -.etc.passwd - -`ag_anyagent( - `Description ( - (`File("/etc/passwd")), // real filename - "#", // Comment - true, - (`List ( - `Or ( - `Tuple ( - `username (`String("+")), - ":", - `password (`String ("")), - ":", - `uid (`String ("")), - ":", - `gid (`String ("")), - ":", - `fullname (`String ("")), - ":", - `home (`String ("")), - ":", - `shell (`String ("")) - ), - - `Tuple ( - `username (`String ("^:")), - ":", - `password (`Or (`String ("^:"), "")), - ":", - `uid (`Number ()), - ":", - `gid (`Number ()), - ":", - `fullname (`Or (`String ("^:"), "")), - ":", - `home (`String ("^:")), - ":", - `shell (`String ("^\n")) - )), - "\n" - )) - ) -) From 34a8669804e28934d91c83f861840938905f3802 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 2 Jan 2019 17:30:29 +0100 Subject: [PATCH 10/11] remove deprecated system scenarious. Replaced by system roles. --- src/clients/inst_scenarios.rb | 2 - .../installation/clients/inst_scenarios.rb | 308 ------------------ 2 files changed, 310 deletions(-) delete mode 100644 src/clients/inst_scenarios.rb delete mode 100644 src/lib/installation/clients/inst_scenarios.rb diff --git a/src/clients/inst_scenarios.rb b/src/clients/inst_scenarios.rb deleted file mode 100644 index f62156def..000000000 --- a/src/clients/inst_scenarios.rb +++ /dev/null @@ -1,2 +0,0 @@ -require "installation/clients/inst_scenarios" -Yast::InstScenariosClient.new.main diff --git a/src/lib/installation/clients/inst_scenarios.rb b/src/lib/installation/clients/inst_scenarios.rb deleted file mode 100644 index 371a434b2..000000000 --- a/src/lib/installation/clients/inst_scenarios.rb +++ /dev/null @@ -1,308 +0,0 @@ -# encoding: utf-8 - -# ------------------------------------------------------------------------------ -# Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved. -# -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of version 2 of the GNU General Public License as published by the -# Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, contact Novell, Inc. -# -# To contact Novell about this file by physical or electronic mail, you may find -# current contact information at www.novell.com. -# ------------------------------------------------------------------------------ - -# File: clients/inst_scenarios.ycp -# Package: Installation (First Stage) -# Summary: Server/Desktop Scenarios -# Authors: Lukas Ocilka -# -# $Id$ -module Yast - class InstScenariosClient < Client - def main - Yast.import "UI" - Yast.import "Pkg" - # See FATE: #304373: Align installation process to use scenarios for Server in early stage - - textdomain "installation" - - Yast.import "Arch" - Yast.import "ProductControl" - Yast.import "ProductFeatures" - Yast.import "Wizard" - Yast.import "Icon" - Yast.import "Installation" - Yast.import "Popup" - Yast.import "PackageCallbacks" - Yast.import "Report" - Yast.import "Packages" - Yast.import "DefaultDesktop" - Yast.import "PackagesProposal" - - @test_mode = false - - if Ops.greater_than(Builtins.size(WFM.Args), 0) && - Ops.is_string?(WFM.Args(0)) - Builtins.y2milestone("Args: %1", WFM.Args) - @test_mode = true if WFM.Args(0) == "test" - end - - # load supported scenarios from control file - @any_scenarios = ProductFeatures.GetFeature( - "software", - "system_scenarios" - ) - - if @any_scenarios.nil? || @any_scenarios == "" || @any_scenarios == [] - Builtins.y2error("Undefined software->system_scenarios") - return :auto - end - - @system_scenarios = Convert.convert( - @any_scenarios, - from: "any", - to: "list >" - ) - - # Remove Xen/KVM Virtualization Host Server Installation for non-x86_64 (bnc#702103, bnc#795067) - @system_scenarios = Builtins.filter(@system_scenarios) do |one_scenario| - if Builtins.issubstring( - Ops.get(one_scenario, "id", "---"), - "virtualization_host" - ) && - !Arch.x86_64 - Builtins.y2milestone("removing Xen Virtualization Host Server option") - next false - end - true - end - - @packages_proposal_ID = "inst_scenarios" - - # adjusting test mode - not used in installation - if @test_mode - Wizard.CreateDialog - Pkg.TargetInit(Installation.destdir, true) - Pkg.SourceStartManager(true) - # pre-select - Builtins.foreach( - Builtins.splitstring( - Ops.get(@system_scenarios, [0, "patterns"], ""), - " \t" - ) - ) { |one_pattern| Pkg.ResolvableInstall(one_pattern, :pattern) } - Pkg.PkgSolve(true) - end - - Builtins.y2milestone("Supported scenarios: %1", @system_scenarios) - - # TRANSLATORS: help text - @dialog_help = _( - "

Select the scenario that meets your needs best.\nAdditional software can be selected later in software proposal.

\n" - ) - - # Adjust dialog - Wizard.SetContents( - ProductControl.GetTranslatedText("scenarios_caption"), - GetDialogContents(), - @dialog_help, - true, - true - ) - - SelectAppropriateRadioButton() - - @user_input = nil - @ret = :auto - - # Handle user input - loop do - @user_input = UI.UserInput - - if @user_input == :next - @chosen_selection = Convert.to_string( - UI.QueryWidget(Id(:scenarios), :CurrentButton) - ) - - if @chosen_selection.nil? || @chosen_selection == "" - # TRANSLATORS: pop-up message - Report.Message(_("Choose one scenario, please.")) - else - SelectPatterns(@chosen_selection) - @ret = :next - break - end - elsif @user_input == :back - @ret = :back - break - elsif @user_input == :abort || @user_input == :cancel - if Popup.ConfirmAbort(:painless) - @ret = :abort - break - end - else - Builtins.y2error("Unexpected ret: %1", @user_input) - end - end - - # test mode - not used in installation - Wizard.CloseDialog if @test_mode - - Builtins.y2milestone("Returning: %1", @ret) - @ret - # EOF - end - - # Adjusts UI - selected radio button - def SelectAppropriateRadioButton - patterns = Pkg.ResolvableProperties("", :pattern, "") - - selected_id = nil - - # check all scenarios - Builtins.foreach(@system_scenarios) do |one_scenario| - patterns_required = Builtins.splitstring( - Ops.get(one_scenario, "patterns", ""), - " \t" - ) - matching_patterns = 0 - Builtins.foreach(patterns) do |one_pattern| - if Builtins.contains( - patterns_required, - Ops.get_string(one_pattern, "name", "") - ) && - (Ops.get_symbol(one_pattern, "status", :a) == :installed || - Ops.get_symbol(one_pattern, "status", :a) == :selected) - matching_patterns = Ops.add(matching_patterns, 1) - end - end - # there are some matching patterns - # they match required patterns - if Ops.greater_than(matching_patterns, 0) && - Ops.greater_or_equal( - matching_patterns, - Builtins.size(patterns_required) - ) - Builtins.y2milestone( - "Matching: %1 (%2)", - Ops.get(one_scenario, "id", ""), - Ops.get(one_scenario, "patterns", "") - ) - if selected_id.nil? - selected_id = Ops.get(one_scenario, "id", "") - else - Builtins.y2warning("Scenario %1 already selected", selected_id) - end - end - end - - # matching patterns found - if !selected_id.nil? - UI.ChangeWidget(Id(:scenarios), :CurrentButton, selected_id) - - # using fallback from control file - else - default_selection = ProductFeatures.GetStringFeature( - "software", - "default_system_scenario" - ) - - if default_selection.nil? || default_selection == "" - Builtins.y2warning("No default selection defined") - else - Builtins.y2milestone("Pre-selecting default selection") - if UI.WidgetExists(Id(default_selection)) - UI.ChangeWidget(Id(:scenarios), :CurrentButton, default_selection) - else - Builtins.y2error("No such selection: %1", default_selection) - end - end - end - - nil - end - - def SelectPatterns(chosen_selection) - Builtins.y2milestone("User selected: %1", chosen_selection) - - # select newly selected patterns for installation - Builtins.foreach(@system_scenarios) do |one_scenario| - if Ops.get(one_scenario, "id", "---") == chosen_selection - patterns_to_install = Builtins.splitstring( - Ops.get(one_scenario, "patterns", ""), - " \t" - ) - # Select new list of patterns - PackagesProposal.SetResolvables( - @packages_proposal_ID, - :pattern, - patterns_to_install - ) - raise Break - end - end - - # conflicts with the default desktop feature, thus it removes - # the resolvables that the DefaultDesktop could require - Builtins.y2warning("Removing all default_desktop related resolvables...") - DefaultDesktop.SetDesktop(nil) - - nil - end - - def GetDialogContents - dialog_content = VBox() - - Builtins.foreach(@system_scenarios) do |one_scenario| - dialog_content = Builtins.add( - dialog_content, - HBox( - HWeight( - 1, - if Ops.get(one_scenario, "icon", "") == "" - Empty() - else - HBox( - Image(Icon.IconPath(Ops.get(one_scenario, "icon", "")), ""), - HSpacing(2) - ) - end - ), - Left( - RadioButton( - Id(Ops.get(one_scenario, "id", "")), - ProductControl.GetTranslatedText( - Ops.get(one_scenario, "id", "") - ) - ) - ), - HStretch() - ) - ) - dialog_content = Builtins.add(dialog_content, VSpacing(0.8)) - end - - dialog_content = VBox( - Label(ProductControl.GetTranslatedText("scenarios_text")), - VSpacing(2), - HSquash( - Frame( - # TRANSLATORS: frame label - _("Choose Scenario"), - RadioButtonGroup(Id(:scenarios), MarginBox(2, 1.3, dialog_content)) - ) - ) - ) - - deep_copy(dialog_content) - end - end -end From cb026d16beef8b5f0c91c685e6328f6f1170c3a2 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 2 Jan 2019 17:36:22 +0100 Subject: [PATCH 11/11] remove from spec removed scr agents --- package/yast2-installation.spec | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package/yast2-installation.spec b/package/yast2-installation.spec index d2f59c2dc..14205ba2d 100644 --- a/package/yast2-installation.spec +++ b/package/yast2-installation.spec @@ -232,13 +232,8 @@ systemctl enable YaST2-Firstboot.service %{yast_libdir}/transfer # agents -%{yast_scrconfdir}/etc_passwd.scr -%{yast_scrconfdir}/cfg_boot.scr %{yast_scrconfdir}/cfg_windowmanager.scr -%{yast_scrconfdir}/cfg_fam.scr %{yast_scrconfdir}/etc_install_inf.scr -%{yast_scrconfdir}/etc_install_inf_alias.scr -%{yast_scrconfdir}/etc_install_inf_options.scr %{yast_scrconfdir}/run_df.scr # fillup %{_fillupdir}/sysconfig.security-checksig