From 6deb417940ace4f9661030b05135df68545106f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 25 May 2016 14:57:52 +0200 Subject: [PATCH 01/10] Ruby debugger integration (FATE#318421) (#379) * "byebug" debugger integration (FATE#318421) * move to a seprate method --- package/yast2-installation.spec | 3 ++- src/lib/installation/clients/installation.rb | 24 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/package/yast2-installation.spec b/package/yast2-installation.spec index 8fac2d6f7..0bbedb650 100644 --- a/package/yast2-installation.spec +++ b/package/yast2-installation.spec @@ -26,7 +26,8 @@ Source0: %{name}-%{version}.tar.bz2 Group: System/YaST License: GPL-2.0 Url: http://github.com/yast/yast-installation -Requires: yast2-ruby-bindings >= 3.1.8 +# yast/debugger +Requires: yast2-ruby-bindings >= 3.1.47 Summary: YaST2 - Installation Parts diff --git a/src/lib/installation/clients/installation.rb b/src/lib/installation/clients/installation.rb index c2646cbcc..706d0fc7e 100644 --- a/src/lib/installation/clients/installation.rb +++ b/src/lib/installation/clients/installation.rb @@ -30,6 +30,8 @@ # $Id$ module Yast class InstallationClient < Client + include Yast::Logger + def main textdomain "installation" @@ -37,12 +39,17 @@ def main Yast.import "Stage" Yast.import "Report" Yast.import "Hooks" + Yast.import "Linuxrc" Hooks.search_path.join!("installation") # Initialize the UI UI.SetProductLogo(true) Wizard.OpenLeftTitleNextBackDialog + + # start the debugger if requested (FATE#318421) + start_debugger + Wizard.SetContents( # title "", @@ -97,5 +104,22 @@ def main deep_copy(@ret) end + + private + + # start the Ruby debugger if booted with the Y2DEBUGGER option + def start_debugger + return unless (Linuxrc.InstallInf("Cmdline") || "").match(/\bY2DEBUGGER=(.*)\b/i) + + option = Regexp.last_match[1] + log.info "Y2DEBUGGER option: #{option}" + + if option == "1" || option == "remote" || option == "manual" + require "yast/debugger" + Debugger.start(remote: option == "remote", start_client: option != "manual") + else + log.warn "Unknown Y2DEBUGGER value: #{option}" + end + end end end From 162de1163f881accf29ea222fc3d55ac36e75d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 25 May 2016 15:14:30 +0200 Subject: [PATCH 02/10] version update (#381) --- package/yast2-installation.changes | 7 +++++++ package/yast2-installation.spec | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package/yast2-installation.changes b/package/yast2-installation.changes index 5d868be47..85c84c557 100644 --- a/package/yast2-installation.changes +++ b/package/yast2-installation.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed May 25 13:07:59 UTC 2016 - lslezak@suse.cz + +- Start the Ruby debugger at the beginning of installation + when Y2DEBUGGER is set (FATE#318421) +- 3.1.188 + ------------------------------------------------------------------- Tue May 17 08:17:51 UTC 2016 - ancor@suse.com diff --git a/package/yast2-installation.spec b/package/yast2-installation.spec index 0bbedb650..e2f2d5107 100644 --- a/package/yast2-installation.spec +++ b/package/yast2-installation.spec @@ -17,7 +17,7 @@ Name: yast2-installation -Version: 3.1.187 +Version: 3.1.188 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build From 1b768cac8dad5f30c931c459b08512607d49c5cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Wed, 25 May 2016 16:55:22 +0100 Subject: [PATCH 03/10] SSH import proposal summary: * improved ssh import dialog interface * disable link if not previous installation --- .../clients/ssh_import_proposal.rb | 4 ++- src/lib/installation/dialogs/ssh_import.rb | 33 +++++++++++++------ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/lib/installation/clients/ssh_import_proposal.rb b/src/lib/installation/clients/ssh_import_proposal.rb index b216bef1f..73dc1f7d4 100644 --- a/src/lib/installation/clients/ssh_import_proposal.rb +++ b/src/lib/installation/clients/ssh_import_proposal.rb @@ -20,7 +20,9 @@ def description "rich_text_title" => _("Import SSH Host Keys and Configuration"), # menubutton entry "menu_title" => _("&Import SSH Host Keys and Configuration"), - "id" => "ssh_import" + # empty string is returned in case of not previous installation to + # avoid text link. + "id" => importer.configurations.empty? ? "" : "ssh_import" } end diff --git a/src/lib/installation/dialogs/ssh_import.rb b/src/lib/installation/dialogs/ssh_import.rb index f39671eeb..00210240f 100644 --- a/src/lib/installation/dialogs/ssh_import.rb +++ b/src/lib/installation/dialogs/ssh_import.rb @@ -34,7 +34,7 @@ def initialize # Event callback for the 'ok' button def next_handler partition = UI.QueryWidget(Id(:device), :Value) - partition = nil if partition == :none + partition = nil unless UI.QueryWidget(Id(:import_ssh_key), :Value) copy_config = UI.QueryWidget(Id(:copy_config), :Value) log.info "SshImportDialog partition => #{partition} copy_config => #{copy_config}" importer.device = partition @@ -61,12 +61,27 @@ def copy_config end def dialog_content - HSquash( + HBox( + HStretch(), VBox( - Left(Label(_("System to Import SSH Host Keys from"))), - partitions_list_widget, - VSpacing(1), - Left(copy_config_widget) + Left(CheckBoxFrame( + Id(:import_ssh_key), + _("I would like to import SSH keys from a previous installation"), + true, + VBox( + HStretch(), + VSpacing(1), + HBox( + HSpacing(2), + partitions_list_widget + ), + VSpacing(1), + HBox( + HSpacing(2), + Left(copy_config_widget) + ) + ) + )), ) ) end @@ -82,7 +97,7 @@ def help_text "thus the identity- of its SSH server. The key files found in /etc/ssh " \ "(one pair of files per host key) will be copied to the new system " \ "being installed.

" \ - "

Check Copy Whole SSH Configuration to also copy other files " \ + "

Check Insert SSH Configuration to also copy other files " \ "found in /etc/ssh, in addition to the keys.

" ) end @@ -96,8 +111,6 @@ def partitions_list_widget RadioButtonGroup( Id(:device), VBox( - # TRANSLATORS: option to select no partition for SSH keys import - Left(RadioButton(Id(:none), _("None"), device.nil?)), *part_widgets ) ) @@ -112,7 +125,7 @@ def partition_widget(dev, partition) end def copy_config_widget - CheckBox(Id(:copy_config), _("Copy Whole SSH Configuration"), copy_config) + CheckBox(Id(:copy_config), _("Insert SSH Configuration"), copy_config) end end end From 69314114a4ce604217de570aceb88144a1defdbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Wed, 25 May 2016 16:59:31 +0100 Subject: [PATCH 04/10] Update changes. --- package/yast2-installation.changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/yast2-installation.changes b/package/yast2-installation.changes index 85c84c557..ffacdb8c3 100644 --- a/package/yast2-installation.changes +++ b/package/yast2-installation.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 25 15:49:41 UTC 2016 - kanderssen@suse.com + +- More visual improvements in the SSH keys importing proposal + summary based on blog entry feedback. + ------------------------------------------------------------------- Wed May 25 13:07:59 UTC 2016 - lslezak@suse.cz From 142a50044b19b5b961dd68980d8ec6420ef2b8fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Thu, 26 May 2016 11:29:33 +0100 Subject: [PATCH 05/10] Some changes based on code review. --- package/yast2-installation.changes | 2 +- .../clients/ssh_import_proposal.rb | 23 ++++++++++--------- src/lib/installation/dialogs/ssh_import.rb | 10 ++++---- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/package/yast2-installation.changes b/package/yast2-installation.changes index ffacdb8c3..5be2614f7 100644 --- a/package/yast2-installation.changes +++ b/package/yast2-installation.changes @@ -2,7 +2,7 @@ Wed May 25 15:49:41 UTC 2016 - kanderssen@suse.com - More visual improvements in the SSH keys importing proposal - summary based on blog entry feedback. + summary based on blog entry feedback. (Fate#319624) ------------------------------------------------------------------- Wed May 25 13:07:59 UTC 2016 - lslezak@suse.cz diff --git a/src/lib/installation/clients/ssh_import_proposal.rb b/src/lib/installation/clients/ssh_import_proposal.rb index 73dc1f7d4..763dff054 100644 --- a/src/lib/installation/clients/ssh_import_proposal.rb +++ b/src/lib/installation/clients/ssh_import_proposal.rb @@ -40,7 +40,7 @@ def importer def preformatted_proposal if importer.configurations.empty? - return _("No previous Linux installation found - not importing any SSH Key") + return Yast::HTML.List([_("No previous Linux installation found")]) end if importer.device.nil? res = _("No existing SSH host keys will be copied") @@ -57,8 +57,6 @@ def preformatted_proposal res = _("SSH host keys will be copied from %s") % partition end end - # TRANSLATORS: link to change the proposal - res += " " + _("(change)") % '"ssh_import"' Yast::HTML.List([res]) end @@ -69,15 +67,18 @@ def ask_user(param) "going_back" => true } - log.info "Asking user which SSH keys to import" - begin - Yast::Wizard.OpenAcceptDialog - result = WFM.CallFunction("inst_ssh_import", [args]) - ensure - Yast::Wizard.CloseDialog + if importer.configurations.empty? + result = :next + else + log.info "Asking user which SSH keys to import" + begin + Yast::Wizard.OpenAcceptDialog + result = WFM.CallFunction("inst_ssh_import", [args]) + ensure + Yast::Wizard.CloseDialog + end + log.info "Returning from ssh_import ask_user with #{result}" end - log.info "Returning from ssh_import ask_user with #{result}" - { "workflow_sequence" => result } end end diff --git a/src/lib/installation/dialogs/ssh_import.rb b/src/lib/installation/dialogs/ssh_import.rb index 00210240f..b8c814793 100644 --- a/src/lib/installation/dialogs/ssh_import.rb +++ b/src/lib/installation/dialogs/ssh_import.rb @@ -61,8 +61,7 @@ def copy_config end def dialog_content - HBox( - HStretch(), + HSquash( VBox( Left(CheckBoxFrame( Id(:import_ssh_key), @@ -75,13 +74,14 @@ def dialog_content HSpacing(2), partitions_list_widget ), - VSpacing(1), + VSpacing(3), HBox( HSpacing(2), Left(copy_config_widget) ) ) )), + HStretch() ) ) end @@ -97,7 +97,7 @@ def help_text "thus the identity- of its SSH server. The key files found in /etc/ssh " \ "(one pair of files per host key) will be copied to the new system " \ "being installed.

" \ - "

Check Insert SSH Configuration to also copy other files " \ + "

Check Import SSH Configuration to also copy other files " \ "found in /etc/ssh, in addition to the keys.

" ) end @@ -125,7 +125,7 @@ def partition_widget(dev, partition) end def copy_config_widget - CheckBox(Id(:copy_config), _("Insert SSH Configuration"), copy_config) + CheckBox(Id(:copy_config), _("Import SSH Configuration"), copy_config) end end end From 5fac26e14d4923a7698b4b341812d69f205d9ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Thu, 26 May 2016 12:18:11 +0100 Subject: [PATCH 06/10] Disable ssh_import sub proposal if no configuration available. --- src/lib/installation/clients/inst_pre_install.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/installation/clients/inst_pre_install.rb b/src/lib/installation/clients/inst_pre_install.rb index a61eb3eea..bae05da52 100644 --- a/src/lib/installation/clients/inst_pre_install.rb +++ b/src/lib/installation/clients/inst_pre_install.rb @@ -94,6 +94,12 @@ def main read_ssh_info(device, mount_point) end + # The ssh_import proposal doesn't make sense if there is no + # configuration to import from. + if ::Installation::SshImporter.instance.configurations.empty? + ProductControl.DisableSubProposal("inst_initial", "ssh_import") + end + # free the memory @useful_partitions = nil From 6c2f4855812d5f7f5069bdf0809efa22dfa31044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Thu, 26 May 2016 12:34:53 +0100 Subject: [PATCH 07/10] Left is not needed and also makes rubocop happy. --- src/lib/installation/dialogs/ssh_import.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/installation/dialogs/ssh_import.rb b/src/lib/installation/dialogs/ssh_import.rb index b8c814793..ed6e71acf 100644 --- a/src/lib/installation/dialogs/ssh_import.rb +++ b/src/lib/installation/dialogs/ssh_import.rb @@ -63,7 +63,7 @@ def copy_config def dialog_content HSquash( VBox( - Left(CheckBoxFrame( + CheckBoxFrame( Id(:import_ssh_key), _("I would like to import SSH keys from a previous installation"), true, @@ -80,7 +80,7 @@ def dialog_content Left(copy_config_widget) ) ) - )), + ), HStretch() ) ) From 0901ac4a5a2fff1c1ab62a371f89cd74a96350c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Thu, 26 May 2016 12:41:30 +0100 Subject: [PATCH 08/10] Workaround is not needed if proposal is disable. --- .../clients/ssh_import_proposal.rb | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/lib/installation/clients/ssh_import_proposal.rb b/src/lib/installation/clients/ssh_import_proposal.rb index 763dff054..ca9587e64 100644 --- a/src/lib/installation/clients/ssh_import_proposal.rb +++ b/src/lib/installation/clients/ssh_import_proposal.rb @@ -20,9 +20,7 @@ def description "rich_text_title" => _("Import SSH Host Keys and Configuration"), # menubutton entry "menu_title" => _("&Import SSH Host Keys and Configuration"), - # empty string is returned in case of not previous installation to - # avoid text link. - "id" => importer.configurations.empty? ? "" : "ssh_import" + "id" => "ssh_import" } end @@ -67,18 +65,15 @@ def ask_user(param) "going_back" => true } - if importer.configurations.empty? - result = :next - else - log.info "Asking user which SSH keys to import" - begin - Yast::Wizard.OpenAcceptDialog - result = WFM.CallFunction("inst_ssh_import", [args]) - ensure - Yast::Wizard.CloseDialog - end - log.info "Returning from ssh_import ask_user with #{result}" + log.info "Asking user which SSH keys to import" + begin + Yast::Wizard.OpenAcceptDialog + result = WFM.CallFunction("inst_ssh_import", [args]) + ensure + Yast::Wizard.CloseDialog end + log.info "Returning from ssh_import ask_user with #{result}" + { "workflow_sequence" => result } end end From 35dfed63625209a2acca513b6fd4809df1009aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Thu, 26 May 2016 12:50:07 +0100 Subject: [PATCH 09/10] Bumped version. --- package/yast2-installation.changes | 1 + package/yast2-installation.spec | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package/yast2-installation.changes b/package/yast2-installation.changes index 5be2614f7..cd7d3d3eb 100644 --- a/package/yast2-installation.changes +++ b/package/yast2-installation.changes @@ -3,6 +3,7 @@ Wed May 25 15:49:41 UTC 2016 - kanderssen@suse.com - More visual improvements in the SSH keys importing proposal summary based on blog entry feedback. (Fate#319624) +- 3.1.189 ------------------------------------------------------------------- Wed May 25 13:07:59 UTC 2016 - lslezak@suse.cz diff --git a/package/yast2-installation.spec b/package/yast2-installation.spec index e2f2d5107..25689fb5e 100644 --- a/package/yast2-installation.spec +++ b/package/yast2-installation.spec @@ -17,7 +17,7 @@ Name: yast2-installation -Version: 3.1.188 +Version: 3.1.189 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build From 0b23664823292247d777345d66c0cf4e91f1921f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Thu, 26 May 2016 14:26:38 +0100 Subject: [PATCH 10/10] System Role: centered dialog for ncurses. --- package/yast2-installation.changes | 5 +++++ src/lib/installation/select_system_role.rb | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/package/yast2-installation.changes b/package/yast2-installation.changes index cd7d3d3eb..67ab41d2e 100644 --- a/package/yast2-installation.changes +++ b/package/yast2-installation.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 26 13:17:42 UTC 2016 - kanderssen@suse.com + +- System Role: centered dialog (ncurses). + ------------------------------------------------------------------- Wed May 25 15:49:41 UTC 2016 - kanderssen@suse.com diff --git a/src/lib/installation/select_system_role.rb b/src/lib/installation/select_system_role.rb index ac398dabf..f8d2fc3fd 100644 --- a/src/lib/installation/select_system_role.rb +++ b/src/lib/installation/select_system_role.rb @@ -53,10 +53,12 @@ def help_text end def dialog_content - VBox( - Left(Label(Yast::ProductControl.GetTranslatedText("roles_text"))), - VSpacing(2), - role_buttons + HSquash( + VBox( + Left(Label(Yast::ProductControl.GetTranslatedText("roles_text"))), + VSpacing(2), + role_buttons + ) ) end