Script 'mail_helper' called by ro Hello packager, This is just FYI. Your package was checked in in distribution "sle12" by autobuild-member: ro. Here comes the log... ---------------------------%<------------------------------ Hi, here is the log from ci_new_pac /mounts/work_src_done/SLE12/yast2-packager -> sle12 ## BNC# 886662 : ""Abort" button aborts the installation without confirmation" (NEW/) Changes: -------- --- /work/SRC/SUSE:SLE-12:GA/yast2-packager/yast2-packager.changes 2014-08-05 13:34:58.000000000 +0200 +++ /mounts/work_src_done/SLE12/yast2-packager/yast2-packager.changes 2014-08-06 15:19:54.000000000 +0200 @@ -1,0 +2,7 @@ +Wed Aug 6 13:31:31 CEST 2014 - locilka@suse.com + +- Cleanup in license dialog handling, especially in handling while + aborting the installation (bnc#886662) +- 3.1.39 + +------------------------------------------------------------------- calling whatdependson for sle12-i586 Packages directly triggered for rebuild: - yast2-packager - at least 26 other packages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/SUSE:SLE-12:GA/yast2-packager (Old) and /mounts/work_src_done/SLE12/yast2-packager (BS:build ID:42318 MAIL:yast-commit@opensuse.org) (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-packager", Maintainer is "yast-commit@opensuse.org" Old: ---- yast2-packager-3.1.38.tar.bz2 New: ---- yast2-packager-3.1.39.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-packager.spec ++++++ --- /var/tmp/diff_new_pack.fMstkn/_old 2014-08-06 16:43:00.000000000 +0200 +++ /var/tmp/diff_new_pack.fMstkn/_new 2014-08-06 16:43:00.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.1.38 +Version: 3.1.39 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-packager-3.1.38.tar.bz2 -> yast2-packager-3.1.39.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.38/package/yast2-packager.changes new/yast2-packager-3.1.39/package/yast2-packager.changes --- old/yast2-packager-3.1.38/package/yast2-packager.changes 2014-07-31 15:44:53.000000000 +0200 +++ new/yast2-packager-3.1.39/package/yast2-packager.changes 2014-08-06 15:15:19.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Aug 6 13:31:31 CEST 2014 - locilka@suse.com + +- Cleanup in license dialog handling, especially in handling while + aborting the installation (bnc#886662) +- 3.1.39 + +------------------------------------------------------------------- Thu Jul 31 14:43:16 CEST 2014 - locilka@suse.com - Added user confirmation for aborting the repositories dialogs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.38/package/yast2-packager.spec new/yast2-packager-3.1.39/package/yast2-packager.spec --- old/yast2-packager-3.1.38/package/yast2-packager.spec 2014-07-31 15:44:53.000000000 +0200 +++ new/yast2-packager-3.1.39/package/yast2-packager.spec 2014-08-06 15:15:19.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.1.38 +Version: 3.1.39 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.38/src/modules/ProductLicense.rb new/yast2-packager-3.1.39/src/modules/ProductLicense.rb --- old/yast2-packager-3.1.38/src/modules/ProductLicense.rb 2014-07-31 15:44:53.000000000 +0200 +++ new/yast2-packager-3.1.39/src/modules/ProductLicense.rb 2014-08-06 15:15:20.000000000 +0200 @@ -16,6 +16,8 @@ class ProductLicenseClass < Module attr_accessor :license_patterns, :license_file_print + include Yast::Logger + def main Yast.import "Pkg" Yast.import "UI" @@ -1058,95 +1060,79 @@ while true ret = UI.UserInput + log.info "User ret: #{ret}" - if Ops.is_string?(ret) && - Builtins.regexpmatch(Builtins.tostring(ret), "^license_language_") + if ret.is_a?(::String) && ret.start_with?("license_language_") licenses_ref = arg_ref(licenses.value) - UpdateLicenseContent(licenses_ref, GetId(Builtins.tostring(ret))) + UpdateLicenseContent(licenses_ref, GetId(ret)) licenses.value = licenses_ref.value ret = :language - # bugzilla #303828 - # disabled next button unless yes/no is selected - elsif Ops.is_string?(ret) && ret.start_with?("eula_") + # bugzilla #303828 + # disabled next button unless yes/no is selected + elsif ret.is_a?(::String) && ret.start_with?("eula_") Wizard.EnableNextButton if AllLicensesAcceptedOrDeclined() - # Aborting the license dialog + # Aborting the license dialog elsif ret == :abort - # bugzilla #218677 - if base_product - if Popup.ConfirmAbort(:painless) - Builtins.y2milestone("Aborting...") - ret = :abort - break - end + # bnc#886662 + if Stage.initial + next unless Popup.ConfirmAbort(:painless) else # popup question - if Popup.YesNo(_("Really abort the add-on product installation?")) - Builtins.y2milestone("Aborting...") - ret = :abort - break - end + next unless Popup.YesNo(_("Really abort the add-on product installation?")) end + + log.warn "Aborting..." + break elsif ret == :next + if AllLicensesAccepted() + log.info "All licenses have been accepted." + ret = :accepted + break + end + # License declined - if AllLicensesAccepted() != true - # message is void in case not accepting license doesn't stop the installation - if action == "continue" - Builtins.y2milestone( - "action in case of license refusal is continue, not asking user" - ) - ret = :accepted - break - end - # text changed due to bug #162499 - refuse_popup_text = base_product ? - # text asking whether to refuse a license (Yes-No popup) - _( - "Refusing the license agreement cancels the installation.\nReally refuse the agreement?" - ) : - # text asking whether to refuse a license (Yes-No popup) - _( - "Refusing the license agreement cancels the add-on\nproduct installation. Really refuse the agreement?" - ) - if !Popup.YesNo(refuse_popup_text) - next - else - Builtins.y2milestone("License has been declined.") - if action == "abort" - ret = :abort - break - elsif action == "continue" - ret = :accepted - break - elsif action == "halt" - ret = :halt - break - # timed ok/cancel popup - if !Popup.TimedOKCancel(_("The system is shutting down..."), 10) - next - else - ret = :halt - break - end - else - Builtins.y2error("Unknown action %1", action) - ret = :abort - break - end - end - else - Builtins.y2milestone("All licenses have been accepted.") + + # message is void in case not accepting license doesn't stop the installation + if action == "continue" + log.info "action in case of license refusal is continue, not asking user" ret = :accepted break end + + # text changed due to bug #162499 + refuse_popup_text = base_product ? + # text asking whether to refuse a license (Yes-No popup) + _("Refusing the license agreement cancels the installation.\nReally refuse the agreement?") + : + # text asking whether to refuse a license (Yes-No popup) + _("Refusing the license agreement cancels the add-on\nproduct installation. Really refuse the agreement?") + next unless Popup.YesNo(refuse_popup_text) + + log.info "License has been declined." + + case action + when "abort" + ret = :abort + when "halt" + # timed ok/cancel popup + next unless Popup.TimedOKCancel(_("The system is shutting down..."), 10) + ret = :halt + else + log.error "Unknown action #{action}" + ret = :abort + end + + break elsif ret == :back ret = :back break else - Builtins.y2error("Unhandled input: %1", ret) + log.error "Unhandled input: #{ret}" end end - Convert.to_symbol(ret) + log.info "Returning #{ret}" + ret end # Generic cleanup diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.38/test/product_license_test.rb new/yast2-packager-3.1.39/test/product_license_test.rb --- old/yast2-packager-3.1.38/test/product_license_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-packager-3.1.39/test/product_license_test.rb 2014-08-06 15:15:20.000000000 +0200 @@ -0,0 +1,123 @@ +#! /usr/bin/env rspec + +require_relative "./test_helper" + +Yast.import "ProductLicense" +Yast.import "UI" +Yast.import "Wizard" +Yast.import "Popup" +Yast.import "Stage" + +describe Yast::ProductLicense do + describe "#HandleLicenseDialogRet" do + before(:each) do + # By default, always exit the dialog with :accepted (all licenses accepted) + allow(Yast::ProductLicense).to receive(:AllLicensesAccepted).and_return(true) + + # Make sure that Yast::UI.:UserInput always returns a symbol as the last item + # to exit from the while loop, :back is a safe default + allow(Yast::UI).to receive(:UserInput).and_return(:back) + end + + licenses_ref = Yast::ArgRef.new({}) + + context "while changing a license language" do + it "updates the UI with new license translation" do + expect(Yast::UI).to receive(:UserInput).and_return("license_language_pt_BR", :next) + expect(Yast::ProductLicense).to receive(:UpdateLicenseContent).and_return(nil) + expect(Yast::ProductLicense.HandleLicenseDialogRet(licenses_ref, "base_prod", "abort")).to eq(:accepted) + end + end + + context "while adjusting EULA agreement buttons" do + it "enables the [Next] button" do + expect(Yast::UI).to receive(:UserInput).and_return("eula_some_ID", :next) + expect(Yast::ProductLicense).to receive(:AllLicensesAcceptedOrDeclined).and_return(true) + expect(Yast::Wizard).to receive(:EnableNextButton).and_return(true) + expect(Yast::ProductLicense.HandleLicenseDialogRet(licenses_ref, "base_prod", "abort")).to eq(:accepted) + end + end + + context "while user wants to abort from the License Agreement dialog" do + context "in inst-sys" do + before(:each) do + expect(Yast::Stage).to receive(:stage).and_return("initial") + end + + context "user confirms the aborting" do + it "returns :abort" do + expect(Yast::UI).to receive(:UserInput).and_return(:abort) + expect(Yast::Popup).to receive(:ConfirmAbort).and_return(true) + expect(Yast::ProductLicense.HandleLicenseDialogRet(licenses_ref, "base_prod", "abort")).to eq(:abort) + end + end + + context "user declines the aborting" do + it "continues handling the user input" do + expect(Yast::UI).to receive(:UserInput).and_return(:abort, :next) + expect(Yast::Popup).to receive(:ConfirmAbort).and_return(false) + expect(Yast::ProductLicense.HandleLicenseDialogRet(licenses_ref, "base_prod", "abort")).to eq(:accepted) + end + end + end + + context "on running system" do + before(:each) do + expect(Yast::Stage).to receive(:stage).and_return("normal") + end + + context "user confirms the aborting" do + it "returns :abort" do + expect(Yast::UI).to receive(:UserInput).and_return(:abort) + expect(Yast::Popup).to receive(:YesNo).and_return(true) + expect(Yast::ProductLicense.HandleLicenseDialogRet(licenses_ref, "base_prod", "abort")).to eq(:abort) + end + end + + context "user declines the aborting" do + it "continues handling the user input" do + expect(Yast::UI).to receive(:UserInput).and_return(:abort, :next) + expect(Yast::Popup).to receive(:YesNo).and_return(false) + expect(Yast::ProductLicense.HandleLicenseDialogRet(licenses_ref, "base_prod", "abort")).to eq(:accepted) + end + end + end + end + + context "while going back to previous dialog" do + it "returns :back" do + expect(Yast::UI).to receive(:UserInput).and_return(:back) + expect(Yast::ProductLicense.HandleLicenseDialogRet(licenses_ref, "base_prod", "abort")).to eq(:back) + end + end + + context "while going to the next dialog" do + before(:each) do + expect(Yast::UI).to receive(:UserInput).and_return(:next).at_least(:once) + # Confirm that I do not agree with the license + allow(Yast::Popup).to receive(:YesNo).and_return(true) + end + + context "while all licenses have been accepted" do + it "returns :accepted" do + expect(Yast::ProductLicense).to receive(:AllLicensesAccepted).and_return(true) + expect(Yast::ProductLicense.HandleLicenseDialogRet(licenses_ref, "base_prod", "abort")).to eq(:accepted) + end + end + + context "while some license(s) have not been accepted" do + it "returns symbol :abort, :accepted, :halt according to the third function parameter" do + expect(Yast::ProductLicense).to receive(:AllLicensesAccepted).and_return(false).at_least(:once) + # :halt case + allow(Yast::ProductLicense).to receive(:TimedOKCancel).and_return(true) + + expect(Yast::ProductLicense.HandleLicenseDialogRet(licenses_ref, "base_prod", "abort")).to eq(:abort) + expect(Yast::ProductLicense.HandleLicenseDialogRet(licenses_ref, "base_prod", "continue")).to eq(:accepted) + expect(Yast::ProductLicense.HandleLicenseDialogRet(licenses_ref, "base_prod", "halt")).to eq(:halt) + expect(Yast::ProductLicense.HandleLicenseDialogRet(licenses_ref, "base_prod", "unknown")).to eq(:abort) + end + end + end + + end +end continue with "q"... Checked in at Wed Aug 6 16:43:18 CEST 2014 by ro Remember to have fun... -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org