Hello community, here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2020-03-01 21:27:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old) and /work/SRC/openSUSE:Factory/.yast2-packager.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-packager" Sun Mar 1 21:27:11 2020 rev:387 rq:780348 version:4.2.54 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes 2020-01-30 09:41:43.161500333 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-packager.new.26092/yast2-packager.changes 2020-03-01 21:27:31.384496640 +0100 @@ -1,0 +2,49 @@ +Fri Feb 28 16:53:10 UTC 2020 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> + +- Do not crash when the list of preselected modules is not defined + (related to jsc#SLE-8040, jsc#SLE-11455). +- 4.2.54 + +------------------------------------------------------------------- +Thu Feb 27 13:44:18 UTC 2020 - Ladislav Slezák <lsle...@suse.cz> + +- Fixed going back (bsc#1163023) +- 4.2.53 + +------------------------------------------------------------------- +Tue Feb 25 09:00:30 UTC 2020 - Ladislav Slezák <lsle...@suse.cz> + +- Preselect the default modules in the offline installation + (jsc#SLE-8040, jsc#SLE-11455) +- 4.2.52 + +------------------------------------------------------------------- +Wed Feb 19 15:34:23 UTC 2020 - José Iván López González <jlo...@suse.com> + +- Media checker does not complain because sha checksums + (bsc#1158432). +- Media checker shows information about the signature. +- 4.2.51 + +------------------------------------------------------------------- +Tue Feb 18 15:47:45 UTC 2020 - David Diaz <dgonza...@suse.com> + +- Avoid crashing when changing a language and keyboard layout + (bsc#1161842). +- 4.2.50 + +------------------------------------------------------------------- +Wed Feb 5 15:36:54 UTC 2020 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> + +- Enable the "Search Online" menu entry for those systems that + are registered or that can be registered (jsc#SLE-9109). +- 4.2.49 + +------------------------------------------------------------------- +Tue Feb 4 14:09:29 UTC 2020 - Josef Reidinger <jreidin...@suse.com> + +- Mark packager and repositories as WSL capable modules + (bsc#1162650) +- 4.2.48 + +------------------------------------------------------------------- Old: ---- yast2-packager-4.2.47.tar.bz2 New: ---- yast2-packager-4.2.54.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-packager.spec ++++++ --- /var/tmp/diff_new_pack.cWyMb3/_old 2020-03-01 21:27:32.100498094 +0100 +++ /var/tmp/diff_new_pack.cWyMb3/_new 2020-03-01 21:27:32.100498094 +0100 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 4.2.47 +Version: 4.2.54 Release: 0 Summary: YaST2 - Package Library License: GPL-2.0-or-later ++++++ yast2-packager-4.2.47.tar.bz2 -> yast2-packager-4.2.54.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.2.47/package/yast2-packager.changes new/yast2-packager-4.2.54/package/yast2-packager.changes --- old/yast2-packager-4.2.47/package/yast2-packager.changes 2020-01-29 16:58:49.000000000 +0100 +++ new/yast2-packager-4.2.54/package/yast2-packager.changes 2020-02-28 18:09:47.000000000 +0100 @@ -1,4 +1,53 @@ ------------------------------------------------------------------- +Fri Feb 28 16:53:10 UTC 2020 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> + +- Do not crash when the list of preselected modules is not defined + (related to jsc#SLE-8040, jsc#SLE-11455). +- 4.2.54 + +------------------------------------------------------------------- +Thu Feb 27 13:44:18 UTC 2020 - Ladislav Slezák <lsle...@suse.cz> + +- Fixed going back (bsc#1163023) +- 4.2.53 + +------------------------------------------------------------------- +Tue Feb 25 09:00:30 UTC 2020 - Ladislav Slezák <lsle...@suse.cz> + +- Preselect the default modules in the offline installation + (jsc#SLE-8040, jsc#SLE-11455) +- 4.2.52 + +------------------------------------------------------------------- +Wed Feb 19 15:34:23 UTC 2020 - José Iván López González <jlo...@suse.com> + +- Media checker does not complain because sha checksums + (bsc#1158432). +- Media checker shows information about the signature. +- 4.2.51 + +------------------------------------------------------------------- +Tue Feb 18 15:47:45 UTC 2020 - David Diaz <dgonza...@suse.com> + +- Avoid crashing when changing a language and keyboard layout + (bsc#1161842). +- 4.2.50 + +------------------------------------------------------------------- +Wed Feb 5 15:36:54 UTC 2020 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> + +- Enable the "Search Online" menu entry for those systems that + are registered or that can be registered (jsc#SLE-9109). +- 4.2.49 + +------------------------------------------------------------------- +Tue Feb 4 14:09:29 UTC 2020 - Josef Reidinger <jreidin...@suse.com> + +- Mark packager and repositories as WSL capable modules + (bsc#1162650) +- 4.2.48 + +------------------------------------------------------------------- Wed Jan 29 15:35:20 UTC 2020 - Stefan Hundhammer <shundham...@suse.com> - Don't overwrite the default English license for add-on modules diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.2.47/package/yast2-packager.spec new/yast2-packager-4.2.54/package/yast2-packager.spec --- old/yast2-packager-4.2.47/package/yast2-packager.spec 2020-01-29 16:58:49.000000000 +0100 +++ new/yast2-packager-4.2.54/package/yast2-packager.spec 2020-02-28 18:09:47.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 4.2.47 +Version: 4.2.54 Release: 0 Summary: YaST2 - Package Library License: GPL-2.0-or-later diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.2.47/src/clients/sw_single.rb new/yast2-packager-4.2.54/src/clients/sw_single.rb --- old/yast2-packager-4.2.47/src/clients/sw_single.rb 2020-01-29 16:58:49.000000000 +0100 +++ new/yast2-packager-4.2.54/src/clients/sw_single.rb 2020-02-28 18:09:47.000000000 +0100 @@ -456,7 +456,7 @@ end end repo_management = Mode.normal if repo_management.nil? - online_search = Mode.normal && registered? + online_search = Mode.normal && online_search_available? ret = { "mode" => mode, "enable_repo_mgr" => repo_management, @@ -804,14 +804,14 @@ private - # Determines whether the running system is registered or not + # Determines whether the online search can be used in the running system # - # @return [Booolean] true if the system is registered; false otherwise - def registered? - require "registration/registration" - ::Registration::Registration.is_registered? - rescue LoadError - false + # @note The online search feature is available in those systems that + # can be installed. For the time being, we rely on the online_search + # client being available (from `yast2-registration`). + # @return [Boolean] + def online_search_available? + Yast::WFM.ClientExists("online_search") end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.2.47/src/desktop/org.opensuse.yast.SWSingle.desktop new/yast2-packager-4.2.54/src/desktop/org.opensuse.yast.SWSingle.desktop --- old/yast2-packager-4.2.47/src/desktop/org.opensuse.yast.SWSingle.desktop 2020-01-29 16:58:49.000000000 +0100 +++ new/yast2-packager-4.2.54/src/desktop/org.opensuse.yast.SWSingle.desktop 2020-02-28 18:09:47.000000000 +0100 @@ -14,6 +14,7 @@ X-SuSE-YaST-SortKey=20 X-SuSE-YaST-AutoInstResource= X-SuSE-YaST-Keywords=software,packages,rpm,repositories,installation,deletion +X-SuSE-YaST-WSL=true Icon=yast-sw_single Exec=xdg-su -c "/sbin/yast2 sw_single" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.2.47/src/desktop/org.opensuse.yast.SWSource.desktop new/yast2-packager-4.2.54/src/desktop/org.opensuse.yast.SWSource.desktop --- old/yast2-packager-4.2.47/src/desktop/org.opensuse.yast.SWSource.desktop 2020-01-29 16:58:49.000000000 +0100 +++ new/yast2-packager-4.2.54/src/desktop/org.opensuse.yast.SWSource.desktop 2020-02-28 18:09:47.000000000 +0100 @@ -14,6 +14,7 @@ X-SuSE-YaST-SortKey= X-SuSE-YaST-AutoInstResource= X-SuSE-YaST-Keywords=software,packages,rpm,repositories +X-SuSE-YaST-WSL=true Icon=yast-sw_source Exec=xdg-su -c "/sbin/yast2 repositories" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.2.47/src/include/checkmedia/ui.rb new/yast2-packager-4.2.54/src/include/checkmedia/ui.rb --- old/yast2-packager-4.2.47/src/include/checkmedia/ui.rb 2020-01-29 16:58:49.000000000 +0100 +++ new/yast2-packager-4.2.54/src/include/checkmedia/ui.rb 2020-02-28 18:09:47.000000000 +0100 @@ -1,3 +1,22 @@ +# Copyright (c) [2013-2020] SUSE LLC +# +# 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 SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + require "shellwords" # encoding: utf-8 @@ -71,10 +90,11 @@ ret = [] - Builtins.foreach(info) do |i| - parts = Builtins.splitstring(i, ":") - key = String.CutBlanks(Ops.get(parts, 0, "")) - val = String.CutBlanks(Ops.get(parts, 1, "")) + info.each do |i| + key, val = i.split(":").map(&:strip) + + next unless key + trasmap = { # rich text message, %1 = CD identification "app" => Ops.add( @@ -86,23 +106,27 @@ "<UL><LI>Medium: %1</LI></UL>" ), # rich text message, %1 = size of the medium - "size" => _( + "iso size" => _( "<UL><LI>Size: %1</LI></UL>" ), # rich text message, %1 = result of the check - "check" => _( + "result" => _( "<UL><LI>Result: %1</LI></UL>" ), + # rich text message, %1 = signature check + "signature" => _( + "<UL><LI>Signature: %1</LI></UL>" + ), # rich text - error message "not an iso" => "<FONT COLOR=red>" + _( "The drive does not contain a medium or the ISO file system is broken." ) + "</FONT>" } - if key == "check" + + if key == "result" # try to translate result string - # correct MD5 - if val == "md5sum ok" + if val.match?(/ok/) # result of the check - success val = "<FONT COLOR=\"darkGreen\">" + _("<B>OK</B> -- The medium has been successfully verified.") + "</FONT>" @@ -117,49 +141,24 @@ val = _( "<B>Unknown</B> -- The correct MD5 sum of the medium is unknown." ) - # progress output - elsif Builtins.issubstring(val, "%\b\b\b\b") - key = "" - Builtins.y2milestone( - "Ignoring progress output: %1", - Builtins.mergestring(Builtins.splitstring(val, "\b"), "\\b") - ) end - # don't print MD5 sum (it doesn't help user) - elsif key == "md5" - Builtins.y2milestone("Expected MD5 of the medium: %1", val) - key = "" end - newstr = Ops.get(trasmap, key, "") - if !newstr.nil? && newstr != "" - newstr = Builtins.sformat(newstr, val) - ret = Builtins.add(ret, newstr) - end - end + # don't print checksum (it doesn't help user) + Builtins.y2milestone("Expected checksum of the medium: %1", val) if key.match?(/md5|sha.*/) - Builtins.y2milestone("Translated info: %1", ret) + newstr = Ops.get(trasmap, key, "") - deep_copy(ret) - end + next if newstr.nil? || newstr.empty? + + newstr = Builtins.sformat(newstr, val) - # does the medium contain MD5 checksum in the application area? - def md5sumTagPresent(input) - command = "/usr/bin/dd if=#{input.shellescape} bs=1 skip=33651 count=512" - - res = SCR.Execute(path(".target.bash_output"), command) - - if Ops.get_integer(res, "exit", -1).nonzero? - Builtins.y2warning("command failed: %1", command) - return nil + ret = Builtins.add(ret, newstr) end - Builtins.y2milestone( - "Read application area: %1", - Ops.get_string(res, "stdout", "") - ) + Builtins.y2milestone("Translated info: %1", ret) - Builtins.regexpmatch(Ops.get_string(res, "stdout", ""), "md5sum=") + deep_copy(ret) end # mount CD drive and check whether there is directory 'media.1' (the first medium) @@ -447,17 +446,15 @@ ) ) else - if md5sumTagPresent(selecteddrive) == false - if !Popup.ContinueCancel( - _( - "The medium does not contain a MD5 checksum.\n" \ - "The content of the medium cannot be verified.\n" \ - "\n" \ - "Only readability of the medium will be checked.\n" - ) + if !CheckMedia.valid_checksum?(selecteddrive) + continue_checking = Popup.ContinueCancel( + _("The medium does not contain a valid checksum.\n" \ + "The content of the medium cannot be verified.\n" \ + "\n" \ + "Only readability of the medium will be checked.\n") ) - next - end + + next unless continue_checking end CheckMedia.Start(selecteddrive) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.2.47/src/lib/y2packager/clients/inst_repositories_initialization.rb new/yast2-packager-4.2.54/src/lib/y2packager/clients/inst_repositories_initialization.rb --- old/yast2-packager-4.2.47/src/lib/y2packager/clients/inst_repositories_initialization.rb 2020-01-29 16:58:49.000000000 +0100 +++ new/yast2-packager-4.2.54/src/lib/y2packager/clients/inst_repositories_initialization.rb 2020-02-28 18:09:47.000000000 +0100 @@ -16,6 +16,7 @@ require "y2packager/self_update_addon_repo" require "y2packager/medium_type" +Yast.import "GetInstArgs" Yast.import "Packages" Yast.import "PackageCallbacks" Yast.import "Popup" @@ -37,6 +38,9 @@ def main textdomain "packager" + # no changes if going back + return :back if Yast::GetInstArgs.going_back + if Y2Packager::MediumType.skip_step? log.info "Skipping the client on the #{Y2Packager::MediumType.type} medium" return :auto diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.2.47/src/lib/y2packager/dialogs/addon_selector.rb new/yast2-packager-4.2.54/src/lib/y2packager/dialogs/addon_selector.rb --- old/yast2-packager-4.2.47/src/lib/y2packager/dialogs/addon_selector.rb 2020-01-29 16:58:49.000000000 +0100 +++ new/yast2-packager-4.2.54/src/lib/y2packager/dialogs/addon_selector.rb 2020-02-28 18:09:47.000000000 +0100 @@ -17,6 +17,7 @@ Yast.import "AddOnProduct" Yast.import "Mode" +Yast.import "ProductFeatures" Yast.import "Report" Yast.import "Stage" Yast.import "UI" @@ -234,18 +235,49 @@ erb.result(binding) end - # return a list of the preselected products - # during upgrade we want to preselect the installed products + # return a list of the preselected products depending on the installation mode # @return [Array<Y2Packager::ProductLocation>] the products def preselected_products - return [] unless Yast::Mode.update + # at upgrade preselect the installed addons + return preselected_upgrade_products if Yast::Mode.update + # in installation preselect the defaults defined in the control.xml/installation.xml + return preselected_installation_products if Yast::Mode.installation + # in other modes (e.g. installed system) do not preselect anything + [] + end + + # return a list of the preselected products at upgrade, + # preselect the installed products + # @return [Array<Y2Packager::ProductLocation>] the products + def preselected_upgrade_products missing_products = Yast::AddOnProduct.missing_upgrades # installed but not selected yet products (to avoid duplicates) products.select do |p| missing_products.include?(p.details&.product) end end + + # return a list of the preselected products at installation, + # preselect the default products specified in the control.xml/installation.xml, + # the already selected products are ignored + # @return [Array<Y2Packager::ProductLocation>] the products + def preselected_installation_products + default_modules = Yast::ProductFeatures.GetFeature("software", "default_modules") + return [] unless default_modules.is_a?(Array) + + log.info("Defined default modules: #{default_modules.inspect}") + # skip the already selected products (to avoid duplicates) + selected_products = Y2Packager::Resolvable.find(kind: :product, status: :selected) + .map(&:name) + default_modules -= selected_products + log.info("Using default modules: #{default_modules.inspect}") + + # select the default products + products.select do |p| + default_modules.include?(p.details&.product) + end + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.2.47/src/modules/CheckMedia.rb new/yast2-packager-4.2.54/src/modules/CheckMedia.rb --- old/yast2-packager-4.2.47/src/modules/CheckMedia.rb 2020-01-29 16:58:49.000000000 +0100 +++ new/yast2-packager-4.2.54/src/modules/CheckMedia.rb 2020-02-28 18:09:47.000000000 +0100 @@ -1,4 +1,25 @@ +# Copyright (c) [2013-2020] SUSE LLC +# +# 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 SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + require "yast" +require "yast2/execute" +require "shellwords" # Yast namespace module Yast @@ -82,9 +103,11 @@ # try to read whole lines out = Convert.to_string(SCR.Read(path(".process.read_line"), @process)) + if @inprogress # read progress status buffer = Convert.to_string(SCR.Read(path(".process.read"), @process)) + if !out.nil? @output = Builtins.add(@output, out) @@ -96,9 +119,11 @@ ) end - # finished - @progress = 100 - @inprogress = false + # finishing if there is no out and the progress was already started + if @progress > 0 + @progress = 100 + @inprogress = false + end elsif !buffer.nil? Builtins.y2debug("buffer: %1", buffer) @@ -111,12 +136,10 @@ end elsif !out.nil? @output = Builtins.add(@output, out) - - # check whether we need to switch to progress mode - if Builtins.regexpmatch(out, "^ *pad: ") - @inprogress = true - Builtins.y2milestone("Switching into progress mode") - end + else + Builtins.y2milestone("Switching into progress mode") + @inprogress = true + @progress = 0 end nil @@ -194,6 +217,15 @@ nil end + # Whether the medium inside the drive contains a checksum in the application area + # + # @return [Boolean] + def valid_checksum?(drive) + tagmedia = Execute.locally.stdout("tagmedia", drive.shellescape) + + tagmedia.match?(/^(md5|sha.*)sum =/) + end + publish variable: :checkmedia, type: "const string" publish variable: :preferred_drive, type: "string" publish variable: :forced_start, type: "boolean" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.2.47/src/modules/PackageSlideShow.rb new/yast2-packager-4.2.54/src/modules/PackageSlideShow.rb --- old/yast2-packager-4.2.47/src/modules/PackageSlideShow.rb 2020-01-29 16:58:49.000000000 +0100 +++ new/yast2-packager-4.2.54/src/modules/PackageSlideShow.rb 2020-02-28 18:09:47.000000000 +0100 @@ -417,6 +417,8 @@ while @next_src_no < @remaining_sizes_per_cd_per_src.size remaining_sizes = @remaining_sizes_per_cd_per_src[@next_src_no] + break if remaining_sizes.nil? + while @next_cd_no < remaining_sizes.size return if remaining_sizes[@next_cd_no] > 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.2.47/test/addon_selector_test.rb new/yast2-packager-4.2.54/test/addon_selector_test.rb --- old/yast2-packager-4.2.47/test/addon_selector_test.rb 2020-01-29 16:58:49.000000000 +0100 +++ new/yast2-packager-4.2.54/test/addon_selector_test.rb 2020-02-28 18:09:47.000000000 +0100 @@ -3,13 +3,24 @@ require_relative "./test_helper" require "y2packager/product_location" +require "y2packager/product_location_details" require "y2packager/dialogs/addon_selector" describe Y2Packager::Dialogs::AddonSelector do let(:media_products) do - prods = [["SLE-15-Module-Basesystem 15.0-0", "/Basesystem"], - ["SLE-15-Module-Legacy 15.0-0", "/Legacy"]] - prods.map { |r| Y2Packager::ProductLocation.new(r[0], r[1]) } + prods = [ + [ + "SLE-15-Module-Basesystem 15.0-0", + "/Basesystem", + Y2Packager::ProductLocationDetails.new(product: "sle-module-basesystem") + ], + [ + "SLE-15-Module-Legacy 15.0-0", + "/Legacy", + Y2Packager::ProductLocationDetails.new(product: "sle-module-legacy") + ] + ] + prods.map { |r| Y2Packager::ProductLocation.new(r[0], r[1], product: r[2]) } end subject { described_class.new(media_products) } @@ -87,4 +98,39 @@ end end end + + describe "#create_dialog" do + context "in installation" do + before do + allow(Yast::Stage).to receive(:initial).and_return(true) + allow(Yast::Mode).to receive(:installation).and_return(true) + end + + it "preselects the default products from control.xml" do + # mock the control.xml default + expect(Yast::ProductFeatures).to receive(:GetFeature) + .with("software", "default_modules").and_return(["sle-module-basesystem"]) + + allow(Y2Packager::Resolvable).to receive(:find) + .with(kind: :product, status: :selected).and_return([]) + + expect(Yast::Wizard).to receive(:SetContents) do |_title, content, _help, _back, _next| + # find the MultiSelectionBox term in the UI definition + term = content.nested_find do |t| + t.respond_to?(:value) && t.value == :MultiSelectionBox + end + + # verify that the Basesystem module is preselected + expect(term.params[3][0].params[1]).to eq("SLE-15-Module-Basesystem 15.0-0") + expect(term.params[3][0].params[2]).to eq(true) + + # verify that the Legacy module is NOT preselected + expect(term.params[3][1].params[1]).to eq("SLE-15-Module-Legacy 15.0-0") + expect(term.params[3][1].params[2]).to eq(false) + end + + subject.create_dialog + end + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.2.47/test/lib/clients/inst_repositories_initialization_test.rb new/yast2-packager-4.2.54/test/lib/clients/inst_repositories_initialization_test.rb --- old/yast2-packager-4.2.47/test/lib/clients/inst_repositories_initialization_test.rb 2020-01-29 16:58:49.000000000 +0100 +++ new/yast2-packager-4.2.54/test/lib/clients/inst_repositories_initialization_test.rb 2020-02-28 18:09:47.000000000 +0100 @@ -21,6 +21,7 @@ allow(Y2Packager::SelfUpdateAddonRepo).to receive(:present?).and_return(false) allow(Y2Packager::MediumType).to receive(:online?).and_return(false) allow(Y2Packager::MediumType).to receive(:offline?).and_return(false) + allow(Yast::GetInstArgs).to receive(:going_back).and_return(false) end it "initializes Packages subsystem" do @@ -44,6 +45,21 @@ client.main end + context "going back" do + before do + allow(Yast::GetInstArgs).to receive(:going_back).and_return(true) + end + + it "does not initialize Packages subsystem" do + expect(Yast::Packages).to_not receive(:InitializeCatalogs) + client.main + end + + it "returns :back" do + expect(client.main).to eq(:back) + end + end + context "when initialization fails" do let(:success) { false }