Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2019-03-14 22:42:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2 (Old) and /work/SRC/openSUSE:Factory/.yast2.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2" Thu Mar 14 22:42:21 2019 rev:448 rq:685077 version:4.1.65 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2019-03-13 09:09:30.499422172 +0100 +++ /work/SRC/openSUSE:Factory/.yast2.new.28833/yast2.changes 2019-03-14 22:42:23.438640068 +0100 @@ -1,0 +2,23 @@ +Thu Mar 14 15:36:31 UTC 2019 - Ladislav Slezak <[email protected]> + +- Fixed evaluating the base product, the same products with + the available and selected status must be treated as duplicate + products (bsc#1129257) +- 4.1.65 + +------------------------------------------------------------------- +Wed Mar 13 15:34:17 UTC 2019 - Ladislav Slezak <[email protected]> + +- Process the "specialproduct" value like a linuxrc parameter + (ignore "-_." characters, ignore case) (bsc#1128901) +- 4.1.64 + +------------------------------------------------------------------- +Wed Mar 13 09:02:12 UTC 2019 - David Díaz <[email protected]> + +- Fix how a product features is read in a running system. +- Update default path for base product licenses + (fate#324053, jsc#SLE-4173). +- 4.1.63 + +------------------------------------------------------------------- Old: ---- yast2-4.1.62.tar.bz2 New: ---- yast2-4.1.65.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.cWuYAk/_old 2019-03-14 22:42:24.190639807 +0100 +++ /var/tmp/diff_new_pack.cWuYAk/_new 2019-03-14 22:42:24.194639805 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 4.1.62 +Version: 4.1.65 Release: 0 Summary: YaST2 - Main Package License: GPL-2.0-only ++++++ yast2-4.1.62.tar.bz2 -> yast2-4.1.65.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.62/library/control/src/modules/ProductFeatures.rb new/yast2-4.1.65/library/control/src/modules/ProductFeatures.rb --- old/yast2-4.1.62/library/control/src/modules/ProductFeatures.rb 2019-03-12 16:59:48.000000000 +0100 +++ new/yast2-4.1.65/library/control/src/modules/ProductFeatures.rb 2019-03-14 17:42:46.000000000 +0100 @@ -71,7 +71,7 @@ "disable_os_prober" => false, "enable_local_users" => true, # FATE #304865 - "base_product_license_directory" => "/etc/YaST2/licenses/base/", + "base_product_license_directory" => "/usr/share/licenses/product/base/", "full_system_media_name" => "", "full_system_download_url" => "", "save_y2logs" => true @@ -168,7 +168,8 @@ # Restore product features in running system # @note This is a stable API function def Restore - InitFeatures(true) + InitFeatures(false) + groups = SCR.Dir(path(".product.features.section")) Builtins.foreach(groups) do |group| Ops.set(@features, group, Ops.get(@features, group, {})) @@ -191,7 +192,6 @@ # @note This is a stable API function # Either read from /etc/YaST2/ProductFeatures or set default values def InitIfNeeded - return if [email protected]? if Stage.normal || Stage.firstboot Restore() else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.62/library/control/test/ProductFeatures_test.rb new/yast2-4.1.65/library/control/test/ProductFeatures_test.rb --- old/yast2-4.1.62/library/control/test/ProductFeatures_test.rb 2019-03-12 16:59:48.000000000 +0100 +++ new/yast2-4.1.65/library/control/test/ProductFeatures_test.rb 2019-03-14 17:42:46.000000000 +0100 @@ -158,4 +158,81 @@ end end end + + describe "#GetFeature" do + let(:scr_root_dir) { File.join(File.dirname(__FILE__), "data") } + let(:normal_stage) { false } + let(:firstboot_stage) { false } + + before do + allow(Yast::Stage).to receive(:normal).and_return(normal_stage) + allow(Yast::Stage).to receive(:firstboot).and_return(firstboot_stage) + end + + around do |example| + change_scr_root(scr_root_dir, &example) + end + + it "initializes feature if needed" do + expect(subject).to receive(:InitIfNeeded) + + subject.GetFeature("globals", "base_product_license_directory") + end + + context "in normal stage" do + let(:normal_stage) { true } + + it "reads the value from the running system" do + # value read from data/etc/YaST2/ProductFeatures file + expect(subject.GetFeature("globals", "base_product_license_directory")) + .to eq("/path/to/licenses/product/base") + end + end + + context "in firstboot stage" do + let(:firstboot_stage) { true } + + it "reads the value from the running system" do + # value read from data/etc/YaST2/ProductFeatures file + expect(subject.GetFeature("globals", "base_product_license_directory")) + .to eq("/path/to/licenses/product/base") + end + end + end + + describe "#InitIfNeeded" do + let(:normal_stage) { false } + let(:firstboot_stage) { false } + + before do + allow(Yast::Stage).to receive(:normal).and_return(normal_stage) + allow(Yast::Stage).to receive(:firstboot).and_return(firstboot_stage) + end + + it "ensures that features are initialized" do + expect(subject).to receive(:InitFeatures).with(false) + + subject.InitIfNeeded + end + + context "in normal stage" do + let(:normal_stage) { true } + + it "restores the available values in the running system" do + expect(subject).to receive(:Restore) + + subject.InitIfNeeded + end + end + + context "in firstboot stage" do + let(:firstboot_stage) { true } + + it "restores the available values in the running system" do + expect(subject).to receive(:Restore) + + subject.InitIfNeeded + end + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.62/library/control/test/data/etc/YaST2/ProductFeatures new/yast2-4.1.65/library/control/test/data/etc/YaST2/ProductFeatures --- old/yast2-4.1.62/library/control/test/data/etc/YaST2/ProductFeatures 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.1.65/library/control/test/data/etc/YaST2/ProductFeatures 2019-03-14 17:42:46.000000000 +0100 @@ -0,0 +1,59 @@ +[globals] + additional_kernel_parameters = "" + addons_default = "no" + base_product_license_directory = "/path/to/licenses/product/base" + debug_deploying = "no" + default_ntp_setup = "yes" + default_target = "" + disable_os_prober = "no" + disable_register_w3m = "yes" + display_register_forcereg = "yes" + enable_autologin = "yes" + enable_clone = "no" + enable_firewall = "yes" + enable_kdump = "yes" + enable_register_hwdata = "yes" + enable_register_optional = "yes" + enable_sshd = "no" + fam_local_only = "never" + firewall_enable_ssh = "no" + incomplete_translation_treshold = "95" + inform_about_suboptimal_distribution = "yes" + kexec_reboot = "yes" + keyboard = "" + language = "" + manual_online_update = "yes" + online_repositories_default = "yes" + register_monthly = "no" + relnotesurl = "" + rle_offer_rulevel_4 = "no" + root_password_as_first_user = "yes" + root_password_ca_check = "no" + run_init_scripts_in_parallel = "yes" + run_you = "yes" + show_addons = "yes" + show_drivers_info = "no" + show_online_repositories = "yes" + skip_language_dialog = "yes" + timezone = "" + ui_mode = "simple" + vendor_url = "" + write_hostname_to_hosts = "no" +[network] + force_static_ip = "no" + network_manager = "laptop" + startmode = "ifplugd" +[partitioning] + expert_partitioner_warning = "no" + use_flexible_partitioning = "no" + vm_keep_unpartitioned_region = "no" +[software] + base_selection = "" + default_desktop = "gnome" + delete_old_packages = "yes" + external_sources_link = "https://download.opensuse.org/YaST/Repos/openSUSE_Factory_Servers.xml" + inform_about_suboptimal_distribution = "no" + online_repos_preselected = "no" + only_update_installed = "no" + packages_transmogrify = "" + software_proposal = "selection" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.62/library/control/testsuite/tests/restore.out new/yast2-4.1.65/library/control/testsuite/tests/restore.out --- old/yast2-4.1.62/library/control/testsuite/tests/restore.out 2019-03-12 16:59:48.000000000 +0100 +++ new/yast2-4.1.65/library/control/testsuite/tests/restore.out 2019-03-14 17:42:46.000000000 +0100 @@ -1,5 +1,8 @@ Dir .product.features.section: [] Return expert +Dir .product.features.section: [] Return yes +Dir .product.features.section: [] Return true +Dir .product.features.section: [] Return 95 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.62/library/packages/src/lib/y2packager/product_reader.rb new/yast2-4.1.65/library/packages/src/lib/y2packager/product_reader.rb --- old/yast2-4.1.62/library/packages/src/lib/y2packager/product_reader.rb 2019-03-12 16:59:48.000000000 +0100 +++ new/yast2-4.1.65/library/packages/src/lib/y2packager/product_reader.rb 2019-03-14 17:42:46.000000000 +0100 @@ -67,7 +67,7 @@ # @return [Array<Product>] Available products def all_products linuxrc_special_products = if Yast::Linuxrc.InstallInf("specialproduct") - Yast::Linuxrc.InstallInf("specialproduct").split(",") + linuxrc_string(Yast::Linuxrc.InstallInf("specialproduct")).split(",") else [] end @@ -78,7 +78,7 @@ if prod_pkg # remove special products if they have not been defined in linuxrc prod_pkg["deps"].find { |dep| dep["provides"] =~ /\Aspecialproduct\(\s*(.*?)\s*\)\z/ } - special_product_tag = Regexp.last_match[1] if Regexp.last_match + special_product_tag = linuxrc_string(Regexp.last_match[1]) if Regexp.last_match if special_product_tag && !linuxrc_special_products.include?(special_product_tag) log.info "Special product #{prod["name"]} has not been defined via linuxrc. --> do not offer it" next @@ -146,11 +146,11 @@ def zypp_products products = Yast::Pkg.ResolvableProperties("", :product, "") - # remove duplicates, there migth be different flavors ("DVD"/"POOL") + # remove duplicates, there might be different flavors ("DVD"/"POOL") # or archs (x86_64/i586), when selecting the product to install later # libzypp will select the correct arch automatically, - # keep products with different state, they are filtered out later - products.uniq! { |p| "#{p["name"]}__#{p["version"]}__#{p["status"]}" } + # keep products with different location, they are filtered out later + products.uniq! { |p| "#{p["name"]}__#{p["version"]}__#{resolvable_location(p)}" } log.info "Found products: #{products.map { |p| p["name"] }}" products @@ -175,7 +175,7 @@ def base_product # The base product is identified by the /etc/products.d/baseproduct symlink # and because a symlink can point only to one file there can be only one base product. - # The "installed" conditition is actually not required because that symlink is created + # The "installed" condition is actually not required because that symlink is created # only for installed products. (Just make sure it still works in case the libzypp # internal implementation is changed.) base = installed_products.find { |p| p["type"] == "base" } @@ -187,5 +187,38 @@ def installation_package_mapping @installation_package_mapping ||= self.class.installation_package_mapping end + + # Process the string in a linuxrc way: remove the "-", "_", "." characters, + # convert it to downcase for case insensitive comparison. + # + # @param input [String] the input string + # + # @return [String] the processed string + # + def linuxrc_string(input) + return nil if input.nil? + + ret = input.gsub(/[-_.]/, "") + ret.downcase + end + + # + # Evaluate the resolvable location (on system or on media). + # + # @param res [Hash] the resolvable hash obtained from pkg-bindings + # + # @return [Symbol] `:on_medium` or `:on_system` + # + def resolvable_location(res) + case res["status"] + when :available, :selected + :on_medium + when :installed, :removed + :on_system + else + # just in case pkg-bindings add some new status... + raise "Unexpected resolvable status: #{res["status"]}" + end + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.62/library/packages/test/y2packager/product_reader_test.rb new/yast2-4.1.65/library/packages/test/y2packager/product_reader_test.rb --- old/yast2-4.1.62/library/packages/test/y2packager/product_reader_test.rb 2019-03-12 16:59:48.000000000 +0100 +++ new/yast2-4.1.65/library/packages/test/y2packager/product_reader_test.rb 2019-03-14 17:42:46.000000000 +0100 @@ -138,6 +138,31 @@ expect(subject.all_products.size).to eq(2) end + it "ignores case of the linuxrc specialproduct parameter" do + allow(Yast::Linuxrc).to receive(:InstallInf).with("specialproduct").and_return("sles_bcl") + expect(subject.all_products.size).to eq(2) + end + + it "ignores underscores in the linuxrc specialproduct parameter" do + allow(Yast::Linuxrc).to receive(:InstallInf).with("specialproduct").and_return("sles_b_c_l") + expect(subject.all_products.size).to eq(2) + end + + it "ignores underscores in the product name" do + allow(Yast::Linuxrc).to receive(:InstallInf).with("specialproduct").and_return("SLESBCL") + expect(subject.all_products.size).to eq(2) + end + + it "ignores dashes in the linuxrc specialproduct parameter" do + allow(Yast::Linuxrc).to receive(:InstallInf).with("specialproduct").and_return("sles-b-c-l") + expect(subject.all_products.size).to eq(2) + end + + it "ignores dots in the linuxrc specialproduct parameter" do + allow(Yast::Linuxrc).to receive(:InstallInf).with("specialproduct").and_return("sles.b.c.l") + expect(subject.all_products.size).to eq(2) + end + it "returns the available product also when an installed product is found" do installed = products.first.dup installed["status"] = :installed @@ -150,5 +175,18 @@ expect(subject.all_products).to_not be_empty end + + it "treats the selected and available products as duplicates even with different arch" do + selected = products.first.dup + selected["status"] = :selected + available = products.first.dup + available["status"] = :available + available["arch"] = "i586" + + allow(Yast::Pkg).to receive(:ResolvableProperties).with("", :product, "") + .and_return([selected, available]) + + expect(subject.all_products.size).to eq(1) + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.62/package/yast2.changes new/yast2-4.1.65/package/yast2.changes --- old/yast2-4.1.62/package/yast2.changes 2019-03-12 16:59:48.000000000 +0100 +++ new/yast2-4.1.65/package/yast2.changes 2019-03-14 17:42:46.000000000 +0100 @@ -1,4 +1,27 @@ ------------------------------------------------------------------- +Thu Mar 14 15:36:31 UTC 2019 - Ladislav Slezak <[email protected]> + +- Fixed evaluating the base product, the same products with + the available and selected status must be treated as duplicate + products (bsc#1129257) +- 4.1.65 + +------------------------------------------------------------------- +Wed Mar 13 15:34:17 UTC 2019 - Ladislav Slezak <[email protected]> + +- Process the "specialproduct" value like a linuxrc parameter + (ignore "-_." characters, ignore case) (bsc#1128901) +- 4.1.64 + +------------------------------------------------------------------- +Wed Mar 13 09:02:12 UTC 2019 - David Díaz <[email protected]> + +- Fix how a product features is read in a running system. +- Update default path for base product licenses + (fate#324053, jsc#SLE-4173). +- 4.1.63 + +------------------------------------------------------------------- Tue Mar 12 08:38:32 UTC 2019 - [email protected] - Fixed product filtering in product_reader.rb, fixes problem diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.62/package/yast2.spec new/yast2-4.1.65/package/yast2.spec --- old/yast2-4.1.62/package/yast2.spec 2019-03-12 16:59:48.000000000 +0100 +++ new/yast2-4.1.65/package/yast2.spec 2019-03-14 17:42:46.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 4.1.62 +Version: 4.1.65 Release: 0 Summary: YaST2 - Main Package License: GPL-2.0-only
