commit yast2-packager for openSUSE:Factory
Hello community, here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2018-04-26 13:29:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old) and /work/SRC/openSUSE:Factory/.yast2-packager.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-packager" Thu Apr 26 13:29:40 2018 rev:351 rq:598497 version:4.0.59 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes 2018-04-07 20:51:42.382010291 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes 2018-04-26 13:29:42.218387903 +0200 @@ -1,0 +2,31 @@ +Fri Apr 19 08:26:41 UTC 2018 - gsouza@suse.com + +- Added warning to inform the user that changes in a repository + managed by a service will be lost in the next refresh of the + service (bsc#1078323). +- 3.2.26 + +------------------------------------------------------------------- +Mon Apr 16 16:48:14 UTC 2018 - igonzalezsosa@suse.com + +- In AutoYaST, skip base product license dialog when the same + license was already accepted (fate#325461). +- 4.0.58 + +------------------------------------------------------------------- +Mon Apr 16 13:46:16 UTC 2018 - lslezak@suse.cz + +- The Advanced Systems Management Module has been moved to the + Basesystem module, added the product change into the list + (related to bsc#1089477) +- 4.0.57 + +------------------------------------------------------------------- +Tue Apr 10 16:21:29 CEST 2018 - schubi@suse.de + +- Error: Add-On products has been reset during the installation + workflow (bnc#1086846). Set it again while setting the base + product. +- 4.0.56 + +------------------------------------------------------------------- Old: ---- yast2-packager-4.0.55.tar.bz2 New: ---- yast2-packager-4.0.59.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-packager.spec ++++++ --- /var/tmp/diff_new_pack.McZQu1/_old 2018-04-26 13:29:42.746368564 +0200 +++ /var/tmp/diff_new_pack.McZQu1/_new 2018-04-26 13:29:42.750368417 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 4.0.55 +Version: 4.0.59 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-packager-4.0.55.tar.bz2 -> yast2-packager-4.0.59.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.55/package/yast2-packager.changes new/yast2-packager-4.0.59/package/yast2-packager.changes --- old/yast2-packager-4.0.55/package/yast2-packager.changes 2018-04-06 09:15:23.000000000 +0200 +++ new/yast2-packager-4.0.59/package/yast2-packager.changes 2018-04-19 12:55:10.000000000 +0200 @@ -1,4 +1,35 @@ ------------------------------------------------------------------- +Fri Apr 19 08:26:41 UTC 2018 - gsouza@suse.com + +- Added warning to inform the user that changes in a repository + managed by a service will be lost in the next refresh of the + service (bsc#1078323). +- 3.2.26 + +------------------------------------------------------------------- +Mon Apr 16 16:48:14 UTC 2018 - igonzalezsosa@suse.com + +- In AutoYaST, skip base product license dialog when the same + license was already accepted (fate#325461). +- 4.0.58 + +------------------------------------------------------------------- +Mon Apr 16 13:46:16 UTC 2018 - lslezak@suse.cz + +- The Advanced Systems Management Module has been moved to the + Basesystem module, added the product change into the list + (related to bsc#1089477) +- 4.0.57 + +------------------------------------------------------------------- +Tue Apr 10 16:21:29 CEST 2018 - schubi@suse.de + +- Error: Add-On products has been reset during the installation + workflow (bnc#1086846). Set it again while setting the base + product. +- 4.0.56 + +------------------------------------------------------------------- Thu Apr 5 15:32:19 UTC 2018 - knut.anderssen@suse.com - Given a license, remember whether another one with the same diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.55/package/yast2-packager.spec new/yast2-packager-4.0.59/package/yast2-packager.spec --- old/yast2-packager-4.0.55/package/yast2-packager.spec 2018-04-06 09:15:23.000000000 +0200 +++ new/yast2-packager-4.0.59/package/yast2-packager.spec 2018-04-19 12:55:10.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 4.0.55 +Version: 4.0.59 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.55/src/lib/packager/clients/repositories.rb new/yast2-packager-4.0.59/src/lib/packager/clients/repositories.rb --- old/yast2-packager-4.0.55/src/lib/packager/clients/repositories.rb 2018-04-06 09:15:23.000000000 +0200 +++ new/yast2-packager-4.0.59/src/lib/packager/clients/repositories.rb 2018-04-19 12:55:10.000000000 +0200 @@ -43,12 +43,17 @@ NO_SERVICE = :no_service NO_SERVICE_ITEM = :no_service_item - def main - textdomain "packager" + def import_modules + Yast.import "Pkg" + Yast.import "UI" Yast.include self, "packager/inst_source_dialogs.rb" Yast.include self, "packager/key_manager_dialogs.rb" Yast.include self, "packager/repositories_include.rb" + end + + def initialize + textdomain "packager" @full_mode = false @@ -87,6 +92,14 @@ "guihandler" => fun_ref(method(:StartInstSource), "symbol ()") } + # list of repositories that was already informed to the user that they are + # managed by service + @services_repos = [] + end + + def main + import_modules + if WFM.Args == [:sw_single_mode] Builtins.y2milestone("Started from sw_single, switching the mode") @@ -1660,6 +1673,7 @@ return end + warn_service_repository(sourceState) state = !sourceState["enabled"] # corresponds to the "Enable/Disable" button state_symbol = state ? UI.Glyph(:CheckMark) : "" @@ -1701,6 +1715,8 @@ src_data = Pkg.SourceGeneralData(source_id) return if !plugin_service_check(sourceState["service"], repo_change_msg) + warn_service_repository(sourceState) + type = src_data["type"] state = !sourceState["autorefresh"] @@ -1743,6 +1759,7 @@ def repo_priority_handler(sourceState, global_current, current) return if !plugin_service_check(sourceState["service"], repo_change_msg) + warn_service_repository(sourceState) # refresh the value in the table new_priority = UI.QueryWidget(Id(:priority), :Value) log.debug("New priority: #{new_priority}") @@ -1762,6 +1779,8 @@ def repo_keeppackages_handler(sourceState, global_current) return if !plugin_service_check(sourceState["service"], repo_change_msg) + warn_service_repository(sourceState) + # refresh the value in the table new_keep = UI.QueryWidget(Id(:keeppackages), :Value) log.info("New keep packages option: #{new_keep}") @@ -1921,6 +1940,8 @@ new_name = SourceDialogs.GetRepoName if new_name != Ops.get_string(sourceState, "name", "") + warn_service_repository(sourceState) + Ops.set(sourceState, "name", new_name) Ops.set(@sourceStatesOut, global_current, sourceState) @@ -2056,5 +2077,17 @@ Popup.Message(msg) false end + + # Shows a warning message when repository managed by a service + # @param [Hash] source_state the current state of the repository or service + def warn_service_repository(source_state) + msg = _("Repository '%{name}' is managed by service '%{service}'.\n"\ + "Your manual changes might be reset by the next service refresh!") % + { name: source_state["name"], service: source_state["service"] } + if source_state["service"] != "" && !@services_repos.include?(source_state["SrcId"]) + Popup.Warning(msg) + @services_repos.push(source_state["SrcId"]) + end + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.55/src/lib/y2packager/clients/inst_product_license.rb new/yast2-packager-4.0.59/src/lib/y2packager/clients/inst_product_license.rb --- old/yast2-packager-4.0.55/src/lib/y2packager/clients/inst_product_license.rb 2018-04-06 09:15:23.000000000 +0200 +++ new/yast2-packager-4.0.59/src/lib/y2packager/clients/inst_product_license.rb 2018-04-19 12:55:10.000000000 +0200 @@ -15,24 +15,32 @@ require "y2packager/product" Yast.import "Language" Yast.import "GetInstArgs" +Yast.import "Mode" module Y2Packager module Clients # This client shows a license confirmation dialog for the base selected product # - # The client will be skipped (returning `:auto`) in these situations: + # The client will be skipped (returning `:auto` or `:next`) in these + # situations: # # * There is no license available for the selected base product. - # * There is only 1 base product (not a multi-product media at all). In - # that case, the license is supposed to has been already accepted in the - # welcome screen. + # * Running AutoYaST but the license has been already confirmed. + # * Running a normal installation but there is only 1 base product + # (not a multi-product media at all). In that case, the license is + # supposed to has been already confirmed in the welcome screen. class InstProductLicense include Yast::I18n include Yast::Logger def main textdomain "installation" - return :auto unless multi_product_media? && available_license? + + if Yast::Mode.auto + return :next if !available_license? || license_confirmed? + else + return :auto unless available_license? && multi_product_media? + end Yast::Wizard.EnableAbortButton disable_buttons = !Yast::GetInstArgs.enable_back ? [:back] : [] @@ -47,7 +55,10 @@ # @return [Y2Packager::Product] # @see Y2Packager::Product.selected_base def product - @product ||= Y2Packager::Product.selected_base + return @product if @product + @product = Y2Packager::Product.selected_base + log.warn "No base product is selected for installation" unless @product + @product end # Determines whether a multi-product media is being used @@ -64,13 +75,16 @@ # @return [Boolean] true if the license is available; false otherwise. def available_license? return true if product && product.license? - if product.nil? - log.warn "No base product is selected for installation" - else - log.warn "No license for product '#{product.label}' was found" - end + log.warn "No license for product '#{product.label}' was found" if product false end + + # Determine whether the product's license has been already confirmed + # + # @return [Boolean] true if the license was confirmed; false otherwise. + def license_confirmed? + product && product.license_confirmed? + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.55/src/modules/AddOnProduct.rb new/yast2-packager-4.0.59/src/modules/AddOnProduct.rb --- old/yast2-packager-4.0.55/src/modules/AddOnProduct.rb 2018-04-06 09:15:23.000000000 +0200 +++ new/yast2-packager-4.0.59/src/modules/AddOnProduct.rb 2018-04-19 12:55:10.000000000 +0200 @@ -12,33 +12,38 @@ # @return [Hash] Product renames default map. Used when information is not # found elsewhere. DEFAULT_PRODUCT_RENAMES = { - "SUSE_SLES" => ["SLES"], + "SUSE_SLES" => ["SLES"], # SLED or Workstation extension - "SUSE_SLED" => ["SLED", "sle-we"], + "SUSE_SLED" => ["SLED", "sle-we"], # SLE11 HA has been renamed since SLE12 - "sle-hae" => ["sle-ha"], + "sle-hae" => ["sle-ha"], # SLE11 HA GEO is now included in SLE15 HA - "sle-haegeo" => ["sle-ha"], + "sle-haegeo" => ["sle-ha"], # SLE12 HA GEO is now included in SLE15 HA - "sle-ha-geo" => ["sle-ha"], - "SUSE_SLES_SAP" => ["SLES_SAP"], + "sle-ha-geo" => ["sle-ha"], + "SUSE_SLES_SAP" => ["SLES_SAP"], # SLES-12 with HPC module can be replaced by SLES_HPC-15 - "SLES" => ["SLES_HPC"], + "SLES" => ["SLES_HPC"], # this is an internal product so far... - "SLE-HPC" => ["SLES_HPC"], + "SLE-HPC" => ["SLES_HPC"], # SMT is now integrated into the base SLES - "sle-smt" => ["SLES"], + "sle-smt" => ["SLES"], # Live patching is a module now (bsc#1074154) - "sle-live-patching" => ["sle-module-live-patching"], + "sle-live-patching" => ["sle-module-live-patching"], + # The Advanced Systems Management Module has been moved to the Basesystem module + "sle-module-adv-systems-management" => ["sle-module-basesystem"], # Toolchain and SDK are now included in the Development Tools SLE15 module - "sle-module-toolchain" => ["sle-module-development-tools"], - "sle-sdk" => ["sle-module-development-tools"] + "sle-module-toolchain" => ["sle-module-development-tools"], + "sle-sdk" => ["sle-module-development-tools"] }.freeze # @return [Hash] Product renames added externally through the #add_rename method attr_accessor :external_product_renames private :external_product_renames, :external_product_renames= + # Products which are selected for installation in libzypp. + attr_reader :selected_installation_products + def main Yast.import "UI" Yast.import "Pkg" @@ -154,6 +159,13 @@ # additional product renames needed for detecting the product update # @see #add_rename @external_product_renames = {} + + # Products which are selected for installation in libzypp. + # Due the "buddy" libzypp functionality also the release packages will + # be regarded. + # E.g.: product:sle-module-basesystem-15-0.x86_64 has buddy + # sle-module-basesystem-release-15-91.2.x86_64 + @selected_installation_products = [] # e.g.: ["sle-module-basesystem"] end # Downloads a requested file, caches it and returns path to that cached file. @@ -1237,7 +1249,15 @@ "Selecting product '%1' for installation", one_prod ) - Pkg.ResolvableInstall(one_prod, :product) + if !Pkg.ResolvableInstall(one_prod, :product) + Report.Error( + # TRANSLATORS: Product cannot be set for installation. + # %1 is the product name. + Builtins.sformat(_("Product %1 not found on media."), one_prod) + ) + else + @selected_installation_products << one_prod + end end # install all products from the destination @@ -1253,9 +1273,12 @@ "Selecting product '%1' for installation", Ops.get_string(p, "name", "") ) - Pkg.ResolvableInstall(Ops.get_string(p, "name", ""), :product) + one_prod = p["name"] || "" + Pkg.ResolvableInstall(one_prod, :product) + @selected_installation_products << one_prod end end + @selected_installation_products.uniq! nil end @@ -1470,6 +1493,7 @@ # adding the product to the list of products (BNC #269625) prod = Pkg.SourceProductData(repo_id) log.info "Repository (#{repo_id} product data: #{prod})" + @selected_installation_products = [] InstallProductsFromRepository(one_product.fetch("install_products", []), repo_id) new_add_on_product = { "media" => repo_id, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.55/test/addon_product_test.rb new/yast2-packager-4.0.59/test/addon_product_test.rb --- old/yast2-packager-4.0.55/test/addon_product_test.rb 2018-04-06 09:15:23.000000000 +0200 +++ new/yast2-packager-4.0.59/test/addon_product_test.rb 2018-04-19 12:55:10.000000000 +0200 @@ -290,6 +290,48 @@ end end + context "when install_products is given in the add-on description" do + let(:repo_id) { 1 } + let(:repo) do + ADDON_REPO.merge("install_products" => ["available_product", + "not_available_product"]) + end + + before do + allow(subject).to receive(:AcceptedLicenseAndInfoFile).and_return(true) + allow(Yast::Pkg).to receive(:SourceProductData).with(repo_id) + allow(Yast::Pkg).to receive(:ResolvableInstall).with("available_product", + :product).and_return(true) + allow(Yast::Pkg).to receive(:ResolvableInstall).with("not_available_product", + :product).and_return(false) + allow(subject).to receive(:ReIntegrateFromScratch) + allow(subject).to receive(:Integrate) + allow(subject).to receive(:AddRepo).with(repo["url"], repo["path"], repo["priority"]) + .and_return(repo_id) + end + + it "adds the repository" do + subject.AddPreselectedAddOnProducts(filelist) + expect(subject.add_on_products).to_not be_empty + end + + it "tries to install given products" do + expect(Yast::Pkg).to receive(:ResolvableInstall).with("available_product", + :product).and_return(true) + expect(Yast::Pkg).to receive(:ResolvableInstall).with("not_available_product", + :product).and_return(false) + subject.AddPreselectedAddOnProducts(filelist) + expect(subject.selected_installation_products).to eq(["available_product"]) + end + + it "reports an error for none existing products" do + expect(Yast::Report).to receive(:Error) + .with(format(_("Product %s not found on media."), "not_available_product")) + subject.AddPreselectedAddOnProducts(filelist) + end + + end + context "when the add-on is on a CD/DVD" do let(:repo_id) { 1 } let(:cd_url) { "cd:///?device=/dev/sr0" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.55/test/lib/clients/inst_product_license_test.rb new/yast2-packager-4.0.59/test/lib/clients/inst_product_license_test.rb --- old/yast2-packager-4.0.55/test/lib/clients/inst_product_license_test.rb 2018-04-06 09:15:23.000000000 +0200 +++ new/yast2-packager-4.0.59/test/lib/clients/inst_product_license_test.rb 2018-04-19 12:55:10.000000000 +0200 @@ -23,12 +23,14 @@ let(:confirmation_required?) { true } let(:license_confirmed?) { false } let(:language) { double("Yast::Language", language: "en_US") } + let(:auto) { false } before do allow(Y2Packager::Dialogs::InstProductLicense).to receive(:new) .and_return(dialog) allow(Y2Packager::Product).to receive(:selected_base).and_return(product) allow(Y2Packager::Product).to receive(:available_base_products).and_return(products) + allow(Yast::Mode).to receive(:auto).and_return(auto) stub_const("Yast::Language", language) end @@ -81,14 +83,6 @@ end end - context "when only one base product is found" do - let(:products) { [product] } - - it "returns :auto" do - expect(client.main).to eq(:auto) - end - end - context "when no license is found for the selected base product" do let(:license?) { false } @@ -98,8 +92,60 @@ client.main end - it "returns :auto" do - expect(client.main).to eq(:auto) + context "and running during normal installation" do + let(:auto) { false } + + it "returns :auto" do + expect(client.main).to eq(:auto) + end + end + + context "and running during autoinstallation" do + let(:auto) { true } + + it "returns :next" do + expect(client.main).to eq(:next) + end + end + end + + context "during normal installation" do + let(:auto) { false } + + context "when only one base product is found" do + let(:products) { [product] } + + it "returns :auto" do + expect(client.main).to eq(:auto) + end + end + + context "when more than one product is found" do + it "opens the license dialog" do + expect(Y2Packager::Dialogs::InstProductLicense).to receive(:new) + client.main + end + end + end + + context "during autoinstallation" do + let(:auto) { true } + + context "when the license has been accepted" do + let(:license_confirmed?) { true } + + it "returns :next" do + expect(client.main).to eq(:next) + end + end + + context "when the license has not been accepted" do + let(:license_confirmed?) { false } + + it "opens the license dialog" do + expect(Y2Packager::Dialogs::InstProductLicense).to receive(:new) + client.main + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-4.0.55/test/lib/clients/repositories_test.rb new/yast2-packager-4.0.59/test/lib/clients/repositories_test.rb --- old/yast2-packager-4.0.55/test/lib/clients/repositories_test.rb 2018-04-06 09:15:23.000000000 +0200 +++ new/yast2-packager-4.0.59/test/lib/clients/repositories_test.rb 2018-04-19 12:55:10.000000000 +0200 @@ -84,4 +84,25 @@ end end end + + describe "#warn_service_repository" do + context "when the repository is managed by a service" do + let(:source_state) { { "name" => "repo", "service" => "some-service", "SrcId" => "1" } } + + it "shows a warning message only once" do + expect(Yast::Popup).to receive(:Warning).with(/manual changes might be reset/).once + client.warn_service_repository(source_state) + client.warn_service_repository(source_state) + end + end + + context "when the repository is not managed by a service" do + let(:source_state) { { "name" => "repo", "service" => "", "SrcId" => "1" } } + + it "shows no warning message" do + expect(Yast::Popup).to_not receive(:Warning) + client.warn_service_repository(source_state) + end + end + end end
participants (1)
-
root@hilbert.suse.de