From d1565c7ca465be0f57fbbf80d1c8ff1166d76c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Alejandro=20Anderssen=20Gonz=C3=A1lez?= Date: Fri, 19 Aug 2016 13:37:54 +0100 Subject: [PATCH] Remove fixes for self_update not needed anymore. --- package/yast2-installation.changes | 7 + package/yast2-installation.spec | 2 +- .../clients/inst_complex_welcome.rb | 35 ----- .../clients/inst_disks_activate.rb | 2 - test/inst_complex_welcome_test.rb | 123 +++++++----------- test/inst_disks_activate_test.rb | 11 -- 6 files changed, 56 insertions(+), 124 deletions(-) diff --git a/package/yast2-installation.changes b/package/yast2-installation.changes index bf1decbb1..07b6ce1c0 100644 --- a/package/yast2-installation.changes +++ b/package/yast2-installation.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Aug 19 11:15:21 UTC 2016 - kanderssen@suse.com + +- Removing remember state fix related to update_installre from + inst_complex_welcome and from disk_activation +- 3.1.210 + ------------------------------------------------------------------- Tue Aug 16 15:34:43 UTC 2016 - kanderssen@suse.com diff --git a/package/yast2-installation.spec b/package/yast2-installation.spec index ccfb124bb..d29ad0157 100644 --- a/package/yast2-installation.spec +++ b/package/yast2-installation.spec @@ -17,7 +17,7 @@ Name: yast2-installation -Version: 3.1.208 +Version: 3.1.210 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/src/lib/installation/clients/inst_complex_welcome.rb b/src/lib/installation/clients/inst_complex_welcome.rb index 19479a846..6769dc4bd 100644 --- a/src/lib/installation/clients/inst_complex_welcome.rb +++ b/src/lib/installation/clients/inst_complex_welcome.rb @@ -45,10 +45,6 @@ def main @license_id = Ops.get(Pkg.SourceGetCurrent(true), 0, 0) # ------------------------------------- main part of the client ----------- - if Installation.restarting? && data_stored? - apply_data - return :next - end @argmap = GetInstArgs.argmap @@ -127,8 +123,6 @@ def event_loop setup_final_choice - store_data - return :next when :show_fulscreen_license UI.OpenDialog(all_licenses_dialog) @@ -383,35 +377,6 @@ def setup_final_choice log.info "Language: '#{@language}', system encoding '#{WFM.GetEncoding}'" end - DATA_PATH = "/var/lib/YaST2/complex_welcome_store.yaml".freeze - - def data_stored? - ::File.exist?(DATA_PATH) - end - - def store_data - data = { - "language" => @language, - "keyboard" => @keyboard, - "license_accepted" => InstData.product_license_accepted - } - - File.write(DATA_PATH, data.to_yaml) - end - - def apply_data - data = YAML.load(File.read(DATA_PATH)) - @language = data["language"] - @keyboard = data["keyboard"] - InstData.product_license_accepted = data["license_accepted"] - ProductLicense.info_seen!(@license_id) - - change_language - setup_final_choice - - ::FileUtils.rm_rf(DATA_PATH) - end - def text_mode? return @text_mode unless @text_mode.nil? diff --git a/src/lib/installation/clients/inst_disks_activate.rb b/src/lib/installation/clients/inst_disks_activate.rb index f57314f82..2b80b88b0 100644 --- a/src/lib/installation/clients/inst_disks_activate.rb +++ b/src/lib/installation/clients/inst_disks_activate.rb @@ -58,8 +58,6 @@ def main @have_zfcp = false @want_fcoe = false - return :next if Installation.restarting? - if Arch.s390 # popup label UI.OpenDialog(Label(_("Detecting Available Controllers"))) diff --git a/test/inst_complex_welcome_test.rb b/test/inst_complex_welcome_test.rb index f60480063..6e645269a 100755 --- a/test/inst_complex_welcome_test.rb +++ b/test/inst_complex_welcome_test.rb @@ -44,105 +44,78 @@ allow(Yast::Installation).to receive(:restarting?) { restarting } end - context "and installer is restarting" do - let(:restarting) { true } - it "applies data if exists and returns next" do - allow(subject).to receive(:data_stored?) { true } - expect(subject).to receive(:apply_data) + it "initializes dialog" do + allow(subject).to receive(:event_loop) + expect(subject).to receive(:initialize_dialog) - expect(subject.main).to eql(:next) - end + subject.main + end - it "does not apply data if not exists and continues as not restarting" do - allow(subject).to receive(:data_stored?) { false } - expect(subject).not_to receive(:apply_data) - allow(subject).to receive(:event_loop) - expect(subject).to receive(:initialize_dialog) + it "starts input loop" do + expect(subject).to receive(:initialize_dialog) + expect(subject).to receive(:event_loop) - subject.main - end + subject.main end - context "and installer is not restarting" do - before do - allow(subject).to receive(:data_stored?) { false } - end + context "when back is selected" do - it "initializes dialog" do - allow(subject).to receive(:event_loop) + it "returns back" do expect(subject).to receive(:initialize_dialog) + expect(Yast::UI).to receive(:UserInput).and_return(:back) - subject.main + expect(subject.main).to eql(:back) end + end - it "starts input loop" do - expect(subject).to receive(:initialize_dialog) - expect(subject).to receive(:event_loop) + context "when next is selected" do + before do + allow(Yast::Mode).to receive(:config).and_return(false) + allow(Yast::Stage).to receive(:initial).and_return(true) - subject.main - end + allow(Yast::Language).to receive(:CheckIncompleteTranslation).and_return(true) + allow(Yast::Language).to receive(:CheckLanguagesSupport) - context "when back is selected" do + allow(Yast::ProductLicense).to receive(:AcceptanceNeeded).and_return(license_needed) + allow(Yast::ProductLicense).to receive(:cache_license_acceptance_needed).and_return(nil) + allow(subject).to receive(:license_accepted?).and_return(license_accepted) + end - it "returns back" do - expect(subject).to receive(:initialize_dialog) - expect(Yast::UI).to receive(:UserInput).and_return(:back) + context "when license is required and not accepted" do + let(:license_needed) { true } + let(:license_accepted) { false } + it "not returns" do + expect(Yast::UI).to receive(:UserInput).and_return(:next, :back) + expect(Yast::Report).to receive(:Message) + .with(_("You must accept the license to install this product")) expect(subject.main).to eql(:back) end end - context "when next is selected" do - before do - allow(Yast::Mode).to receive(:config).and_return(false) - allow(Yast::Stage).to receive(:initial).and_return(true) + context "when license is not required" do + let(:license_needed) { false } + let(:license_accepted) { false } - allow(Yast::Language).to receive(:CheckIncompleteTranslation).and_return(true) - allow(Yast::Language).to receive(:CheckLanguagesSupport) + it "stores selected data and returns next" do + expect(Yast::UI).to receive(:UserInput).and_return(:next) + expect(subject).to receive(:setup_final_choice) + expect(Yast::Report).to_not receive(:Message) - allow(Yast::ProductLicense).to receive(:AcceptanceNeeded).and_return(license_needed) - allow(Yast::ProductLicense).to receive(:cache_license_acceptance_needed).and_return(nil) - allow(subject).to receive(:license_accepted?).and_return(license_accepted) - end - - context "when license is required and not accepted" do - let(:license_needed) { true } - let(:license_accepted) { false } - - it "not returns" do - expect(Yast::UI).to receive(:UserInput).and_return(:next, :back) - expect(Yast::Report).to receive(:Message) - .with(_("You must accept the license to install this product")) - expect(subject.main).to eql(:back) - end - end - - context "when license is not required" do - let(:license_needed) { false } - let(:license_accepted) { false } - - it "stores selected data and returns next" do - expect(Yast::UI).to receive(:UserInput).and_return(:next) - expect(subject).to receive(:setup_final_choice) - expect(subject).to receive(:store_data) - expect(Yast::Report).to_not receive(:Message) - - expect(subject.main).to eql(:next) - end + expect(subject.main).to eql(:next) end + end - context "when license is required and accepted" do - let(:license_needed) { true } - let(:license_accepted) { true } + context "when license is required and accepted" do + let(:license_needed) { true } + let(:license_accepted) { true } - it "stores selected data and returns next" do - expect(Yast::UI).to receive(:UserInput).and_return(:next) - expect(subject).to receive(:setup_final_choice) - expect(subject).to receive(:store_data) - expect(Yast::Report).to_not receive(:Message) + it "stores selected data and returns next" do + expect(Yast::UI).to receive(:UserInput).and_return(:next) + expect(subject).to receive(:setup_final_choice) + expect(Yast::Report).to_not receive(:Message) - expect(subject.main).to eql(:next) - end + expect(subject.main).to eql(:next) end end end diff --git a/test/inst_disks_activate_test.rb b/test/inst_disks_activate_test.rb index 08aebffe9..09985d45e 100755 --- a/test/inst_disks_activate_test.rb +++ b/test/inst_disks_activate_test.rb @@ -14,7 +14,6 @@ describe "#main" do let(:probed_disks) { [] } let(:s390) { false } - let(:restarting) { false } before do allow(Yast::Linuxrc).to receive(:InstallInf).with("WithFCoE").and_return("0") @@ -23,19 +22,9 @@ allow(Yast::Popup).to receive(:ConfirmAbort).with(:painless).and_return(true) allow(Yast::Arch).to receive(:s390).and_return(s390) allow(Yast::GetInstArgs).to receive(:going_back) { going_back } - allow(Yast::Installation).to receive(:restarting?) { restarting } stub_const("Yast::Storage", double("Yast::Storage", ReReadTargetMap: true)) end - context "when installation is restarting" do - let(:restarting) { true } - it "returns next" do - expect(Yast::Arch).to_not receive(:s390) - - expect(subject.main).to eql(:next) - end - end - context "when architecture is s390" do let(:s390) { true } before do