Hello community, here is the log from the commit of package yast2-registration for openSUSE:Factory checked in at 2017-10-23 16:42:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-registration (Old) and /work/SRC/openSUSE:Factory/.yast2-registration.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-registration" Mon Oct 23 16:42:47 2017 rev:4 rq:535367 version:4.0.7 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-registration/yast2-registration.changes 2017-10-19 19:31:06.687754827 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-registration.new/yast2-registration.changes 2017-10-23 16:42:48.326130567 +0200 @@ -1,0 +2,10 @@ +Thu Oct 19 11:53:37 UTC 2017 - lsle...@suse.cz + +- Display an informative popup when upgrading an unregistered + system, preselect adding DVD add-ons to make upgrade using media + easier (fate#323163) +- Support "media_upgrade=1" boot parameter for media based upgrade + even for registered systems (fate#323163) +- 4.0.7 + +------------------------------------------------------------------- Old: ---- yast2-registration-4.0.6.tar.bz2 New: ---- yast2-registration-4.0.7.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-registration.spec ++++++ --- /var/tmp/diff_new_pack.uxZZE1/_old 2017-10-23 16:42:49.194089947 +0200 +++ /var/tmp/diff_new_pack.uxZZE1/_new 2017-10-23 16:42:49.194089947 +0200 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 4.0.6 +Version: 4.0.7 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-registration-4.0.6.tar.bz2 -> yast2-registration-4.0.7.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.0.6/package/yast2-registration.changes new/yast2-registration-4.0.7/package/yast2-registration.changes --- old/yast2-registration-4.0.6/package/yast2-registration.changes 2017-10-17 14:04:37.413281844 +0200 +++ new/yast2-registration-4.0.7/package/yast2-registration.changes 2017-10-20 08:36:48.223887981 +0200 @@ -1,4 +1,14 @@ ------------------------------------------------------------------- +Thu Oct 19 11:53:37 UTC 2017 - lsle...@suse.cz + +- Display an informative popup when upgrading an unregistered + system, preselect adding DVD add-ons to make upgrade using media + easier (fate#323163) +- Support "media_upgrade=1" boot parameter for media based upgrade + even for registered systems (fate#323163) +- 4.0.7 + +------------------------------------------------------------------- Thu Oct 12 11:57:29 UTC 2017 - mfi...@suse.com - fate#323450 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.0.6/package/yast2-registration.spec new/yast2-registration-4.0.7/package/yast2-registration.spec --- old/yast2-registration-4.0.6/package/yast2-registration.spec 2017-10-17 14:04:37.413281844 +0200 +++ new/yast2-registration-4.0.7/package/yast2-registration.spec 2017-10-20 08:36:48.223887981 +0200 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 4.0.6 +Version: 4.0.7 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.0.6/src/lib/registration/ui/migration_repos_workflow.rb new/yast2-registration-4.0.7/src/lib/registration/ui/migration_repos_workflow.rb --- old/yast2-registration-4.0.6/src/lib/registration/ui/migration_repos_workflow.rb 2017-10-17 14:04:37.541281844 +0200 +++ new/yast2-registration-4.0.7/src/lib/registration/ui/migration_repos_workflow.rb 2017-10-20 08:36:48.231887981 +0200 @@ -33,6 +33,8 @@ Yast.import "Sequencer" Yast.import "Mode" + Yast.import "SourceDialogs" + Yast.import "Linuxrc" # the constructor def initialize @@ -96,6 +98,7 @@ "ws_start" => "registration_check", "registration_check" => { abort: :abort, + skip: :next, next: "not_installed_products_check" }, "not_installed_products_check" => { @@ -146,6 +149,12 @@ # if the system is not registered # @return [Symbol] workflow symbol, :next if registered, :abort when not def registration_check + # handle system upgrade (fate#323163) + if Yast::Stage.initial && Yast::Mode.update + log.info "System upgrade mode detected" + return system_upgrade_check + end + return :next if Registration.is_registered? # TRANSLATORS: a popup message with [Continue] [Cancel] buttons, @@ -384,6 +393,64 @@ :next end + + # check the system status at upgrade and return the symbol for the next step + # @return [Symabol] workflow symbol, :skip => do not use the SCC/SMT upgrade + # (unregistered system or explicitly requested by user), :next => + # continue with the SCC/SMT based upgrade + def system_upgrade_check + # media based upgrade requested by user + if Yast::Linuxrc.InstallInf("UpgradeMedia") == "1" + log.info "Skipping SCC upgrade, media based upgrade requested" + Yast::Popup.LongMessage(media_upgrade) + return :skip + # the system is registered, continue with the SCC/SMT based upgrade + elsif Registration.is_registered? + log.info "The system is registered, using the registration server for upgrade" + return :next + else + log.info "The system is NOT registered, activating the media based upgrade" + # we do not support registering the old system at upgrade, that must + # be done before the upgrade, skip registration in that case + Yast::Popup.LongMessage(unregistered_message) + # do not display the "I would like to install an additional Add On Product" + # check box, allow adding the upgrade media directly + Yast::SourceDialogs.display_addon_checkbox = false + # preselect the DVD repository type + Yast::SourceDialogs.SetURL("dvd://") + return :skip + end + end + + # Informative message + # @return [String] translated message + def unregistered_message + # TRANSLATORS: Unregistered system message (1/3) + # Message displayed during upgrade for unregistered systems. + # The user can either boot the old system and register it or use the + # DVD media for upgrade. Use the RichText format. + _("<h2>Unregistered System</h2><p>The system is not registered, that means " \ + "the installer cannot add the new software repositories required for migration " \ + "automatically.</p>") + + # TRANSLATORS: Unregistered system message (2/3) + _("<p>Please add the installation media manually in the next step.</p>") + + # TRANSLATORS: Unregistered system message (3/3) + _("<p>If you cannot provide the installation media you can abort the migration " \ + "and boot the original system to register it. Then start the migration again.</p>") + end + + # Informative message + # @return [String] translated message + def media_upgrade + # TRANSLATORS: Media based upgrade requested by user (1/2) + # User requested media based upgrade which does not use SCC/SMT + # but the downloaded media (physical DVD or shared repo on a local server). + _("<h2>Media Based Upgrade</h2><p>The media based upgrade is requested. " \ + "In this mode YaST will not contact the registration server to obtain " \ + "the new software repositories required for migration.</p>") + + # TRANSLATORS: Media based upgrade requested by user (2/2) + _("<p>Please add the installation media manually in the next step.</p>") + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.0.6/test/migration_repos_workflow_spec.rb new/yast2-registration-4.0.7/test/migration_repos_workflow_spec.rb --- old/yast2-registration-4.0.6/test/migration_repos_workflow_spec.rb 2017-10-17 14:04:37.665281844 +0200 +++ new/yast2-registration-4.0.7/test/migration_repos_workflow_spec.rb 2017-10-20 08:36:48.255887981 +0200 @@ -15,11 +15,48 @@ allow(Yast::Pkg).to receive(:SourceRestore) allow(Yast::Pkg).to receive(:SourceGetCurrent).and_return([]) allow(Registration::SwMgmt).to receive(:check_repositories).and_return(true) + allow(Yast::Stage).to receive(:initial).and_return(false) + allow(Yast::Mode).to receive(:update).and_return(false) + allow(Yast::Linuxrc).to receive(:InstallInf) + end + + shared_examples "media based upgrade" do + before do + expect(Yast::Linuxrc).to receive(:InstallInf).with("UpgradeMedia").and_return("1") + end + + it "displays a popup about media based upgrade" do + expect(Yast::Popup).to receive(:LongMessage).with(/media based upgrade/i) + subject.run_sequence + end + + it "returns :next symbol" do + expect(subject.run_sequence).to eq(:next) + end + end + + context "the system is registered" do + before do + allow(Registration::Registration).to receive(:is_registered?).and_return(true) + allow(Yast::Mode).to receive(:SetMode) + end + + context "at system upgrade" do + before do + allow(Yast::Stage).to receive(:initial).and_return(true) + allow(Yast::Mode).to receive(:update).and_return(true) + allow(Yast::Popup).to receive(:LongMessage) + end + + context "the 'media_upgrade=1' boot parameter is used" do + include_examples "media based upgrade" + end + end end context "the system is not registered" do before do - expect(Registration::Registration).to receive(:is_registered?).and_return(false) + allow(Registration::Registration).to receive(:is_registered?).and_return(false) allow(Yast::Mode).to receive(:SetMode) end @@ -44,6 +81,35 @@ expect(Yast::WFM).to receive(:call).with("inst_scc").and_return(:abort) expect(subject.run_sequence).to eq(:abort) end + + context "at system upgrade" do + before do + allow(Yast::Stage).to receive(:initial).and_return(true) + allow(Yast::Mode).to receive(:update).and_return(true) + allow(Yast::Popup).to receive(:LongMessage) + allow(Yast::SourceDialogs).to receive(:display_addon_checkbox=) + allow(Yast::SourceDialogs).to receive(:SetURL) + end + + it "displays a popup about unregistered system" do + expect(Yast::Popup).to receive(:LongMessage).with(/unregistered system/i) + subject.run_sequence + end + + it "preselects a dvd:// add-on repository to be added later" do + expect(Yast::SourceDialogs).to receive(:display_addon_checkbox=).with(false) + expect(Yast::SourceDialogs).to receive(:SetURL).with("dvd://") + subject.run_sequence + end + + it "returns :next symbol" do + expect(subject.run_sequence).to eq(:next) + end + + context "the 'media_upgrade=1' boot parameter is used" do + include_examples "media based upgrade" + end + end end context "if package management initialization succeeds" do