Hello community, here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2016-12-03 18:24:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old) and /work/SRC/openSUSE:Factory/.yast2-packager.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-packager" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes 2016-12-01 10:25:27.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes 2016-12-03 18:24:29.000000000 +0100 @@ -1,0 +2,8 @@ +Thu Dec 1 08:03:05 UTC 2016 - lslezak@suse.cz + +- Mark the selected default patterns as optional so the user can + change them without blocking the installation later (fixes + openQA tests) (related to bsc#885496) +- 3.2.10 + +------------------------------------------------------------------- Old: ---- yast2-packager-3.2.9.tar.bz2 New: ---- yast2-packager-3.2.10.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-packager.spec ++++++ --- /var/tmp/diff_new_pack.VNVDwf/_old 2016-12-03 18:24:30.000000000 +0100 +++ /var/tmp/diff_new_pack.VNVDwf/_new 2016-12-03 18:24:30.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.2.9 +Version: 3.2.10 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -32,8 +32,8 @@ BuildRequires: rubygem(rspec) BuildRequires: rubygem(yast-rake) -# Packages::Repository and Packages::Product classes -BuildRequires: yast2 >= 3.1.187 +# Optional resolvables support in PackagesProposal +BuildRequires: yast2 >= 3.2.7 # needed for icon for desktop file, it is verified at the end of build BuildRequires: yast2_theme @@ -47,8 +47,8 @@ # Pkg::SourceSetPriority() Requires: yast2-pkg-bindings >= 3.2.1 -# Packages::Repository and Packages::Product classes -Requires: yast2 >= 3.1.187 +# Optional resolvables support in PackagesProposal +Requires: yast2 >= 3.2.7 # unzipping license file Requires: unzip ++++++ yast2-packager-3.2.9.tar.bz2 -> yast2-packager-3.2.10.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.2.9/package/yast2-packager.changes new/yast2-packager-3.2.10/package/yast2-packager.changes --- old/yast2-packager-3.2.9/package/yast2-packager.changes 2016-11-25 11:46:28.000000000 +0100 +++ new/yast2-packager-3.2.10/package/yast2-packager.changes 2016-12-01 11:28:47.000000000 +0100 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Thu Dec 1 08:03:05 UTC 2016 - lslezak@suse.cz + +- Mark the selected default patterns as optional so the user can + change them without blocking the installation later (fixes + openQA tests) (related to bsc#885496) +- 3.2.10 + +------------------------------------------------------------------- Fri Nov 25 10:37:11 UTC 2016 - jreidinger@suse.com - Revert the last change, as it is more tricky to get the correct diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.2.9/package/yast2-packager.spec new/yast2-packager-3.2.10/package/yast2-packager.spec --- old/yast2-packager-3.2.9/package/yast2-packager.spec 2016-11-25 11:46:28.000000000 +0100 +++ new/yast2-packager-3.2.10/package/yast2-packager.spec 2016-12-01 11:28:47.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.2.9 +Version: 3.2.10 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -32,8 +32,8 @@ BuildRequires: rubygem(rspec) BuildRequires: rubygem(yast-rake) -# Packages::Repository and Packages::Product classes -BuildRequires: yast2 >= 3.1.187 +# Optional resolvables support in PackagesProposal +BuildRequires: yast2 >= 3.2.7 # needed for icon for desktop file, it is verified at the end of build BuildRequires: yast2_theme @@ -47,8 +47,8 @@ # Pkg::SourceSetPriority() Requires: yast2-pkg-bindings >= 3.2.1 -# Packages::Repository and Packages::Product classes -Requires: yast2 >= 3.1.187 +# Optional resolvables support in PackagesProposal +Requires: yast2 >= 3.2.7 # unzipping license file Requires: unzip diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.2.9/src/modules/DefaultDesktop.rb new/yast2-packager-3.2.10/src/modules/DefaultDesktop.rb --- old/yast2-packager-3.2.9/src/modules/DefaultDesktop.rb 2016-11-25 11:46:28.000000000 +0100 +++ new/yast2-packager-3.2.10/src/modules/DefaultDesktop.rb 2016-12-01 11:28:47.000000000 +0100 @@ -295,7 +295,8 @@ PackagesProposal.SetResolvables( @packages_proposal_ID_patterns, :pattern, - [] + [], + optional: true ) end elsif !Builtins.haskey(@all_desktops, new_desktop) @@ -312,7 +313,8 @@ PackagesProposal.SetResolvables( @packages_proposal_ID_patterns, :pattern, - Ops.get_list(@all_desktops, [@desktop, "patterns"], []) + Ops.get_list(@all_desktops, [@desktop, "patterns"], []), + optional: true ) end end @@ -321,7 +323,7 @@ end def SelectedPatterns - PackagesProposal.GetResolvables(@packages_proposal_ID_patterns, :pattern) + PackagesProposal.GetResolvables(@packages_proposal_ID_patterns, :pattern, optional: true) end # Deprecated: Packages are not selected by a desktop selection only patterns diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.2.9/src/modules/Packages.rb new/yast2-packager-3.2.10/src/modules/Packages.rb --- old/yast2-packager-3.2.9/src/modules/Packages.rb 2016-11-25 11:46:28.000000000 +0100 +++ new/yast2-packager-3.2.10/src/modules/Packages.rb 2016-12-01 11:28:47.000000000 +0100 @@ -28,6 +28,8 @@ DEFAULT_WM = "icewm" # Minimum set of packages required for installation with remote X11 server REMOTE_X11_BASE_TAGS = [ "xorg-x11-server", "xorg-x11-fonts", "icewm" ] + # Graphical packages for VNC installation + GRAPHIC_PACKAGES = [ "xorg-x11-server", "xorg-x11-server-glx", "libusb", "yast2-x11" ] def main Yast.import "UI" @@ -908,29 +910,6 @@ deep_copy(packages) end - - # graphicPackages () - # Compute graphic (x11) packages - # @return [Array](string) list of rpm packages needed - def graphicPackages - packages = [] - - # don't setup graphics if running via serial console - if !Linuxrc.serial_console - packages = [ - "xorg-x11-server", - "xorg-x11-server-glx", - "libusb", - "yast2-x11" - ] - end - - Builtins.y2milestone("X11 Packages to install: %1", packages) - - packages - end - - # Compute special packages # @return [Array](string) def modePackages @@ -991,26 +970,6 @@ deep_copy(ret) end - # Compute special java packages - # @return [Array](string) - def javaPackages - return [] if !Arch.alpha - - packages = [] - - cpus = Convert.to_list(SCR.Read(path(".probe.cpu"))) - model = Ops.get_string(cpus, [0, "model"], "EV4") - cputype = Builtins.substring(model, 2, 1) - - if cputype == "6" || cputype == "7" || cputype == "8" - packages = ["cpml_ev6"] - else - packages = ["cpml_ev5"] - end - deep_copy(packages) - end - - # Compute board (vendor) dependant packages # @return [Array](string) def boardPackages @@ -1086,11 +1045,9 @@ pattern_list = [] # also add the 'laptop' selection if PCMCIA detected if Arch.is_laptop || Arch.has_pcmcia - Builtins.foreach(["laptop", "Laptop"]) do |pat_name| + ["laptop", "Laptop"].each do |pat_name| pat_list = Pkg.ResolvableProperties(pat_name, :pattern, "") - if Ops.greater_than(Builtins.size(pat_list), 0) - pattern_list = Builtins.add(pattern_list, pat_name) - end + pattern_list << pat_name unless pat_list.empty? end end @@ -1103,23 +1060,16 @@ end end - # FATE #302116 - # BNC #431580 - required_patterns = PackagesProposal.GetAllResolvables(:pattern) - if required_patterns != nil && required_patterns != [] - Builtins.y2milestone( - "Patterns required by PackagesProposal: %1", - required_patterns - ) - pattern_list = Convert.convert( - Builtins.merge(pattern_list, required_patterns), - :from => "list", - :to => "list <string>" - ) - end + # FATE #302116, BNC #431580 + # select both mandatory and optional patterns + proposed_patterns = PackagesProposal.GetAllResolvables(:pattern) + proposed_patterns.concat(PackagesProposal.GetAllResolvables(:pattern, optional: true)) + + log.info("PackagesProposal patterns: #{proposed_patterns}") + pattern_list.concat(proposed_patterns) - Builtins.y2milestone("System patterns: %1", pattern_list) - deep_copy(pattern_list) + log.info("System patterns: #{pattern_list}") + pattern_list end @@ -1129,118 +1079,52 @@ # @return [Array<String>] packages def ComputeSystemPackageList install_list = architecturePackages + install_list.concat(modePackages) - install_list = Convert.convert( - Builtins.union(install_list, modePackages), - :from => "list", - :to => "list <string>" - ) - - # No longer needed - partitions_proposal uses PackagesProposal now - # to gather the list of pkgs needed by y2-storage (#433001) - #list<string> storage_packages = (list<string>)WFM::call("wrapper_storage", ["AddPackageList"]); - - if Ops.greater_than(Builtins.size(@additional_packages), 0) - Builtins.y2warning( - "Additional packages are still in use, please, change it to use PackagesProposal API" - ) - Builtins.y2milestone("Additional packages: %1", @additional_packages) - install_list = Convert.convert( - Builtins.union(install_list, @additional_packages), - :from => "list", - :to => "list <string>" - ) + if !@additional_packages.empty? + log.warn("Additional packages are still in use, please, change it to use PackagesProposal API") + log.info("Additional packages: #{@additional_packages}") + install_list.concat(@additional_packages) end # bnc #431580 # New API for packages selected by other modules - packages_proposal_all_packages = PackagesProposal.GetAllResolvables( - :package - ) - if Ops.greater_than(Builtins.size(packages_proposal_all_packages), 0) - Builtins.y2milestone( - "PackagesProposal::GetAllResolvables returned: %1", - packages_proposal_all_packages - ) - install_list = Convert.convert( - Builtins.union(install_list, packages_proposal_all_packages), - :from => "list", - :to => "list <string>" - ) - else - Builtins.y2milestone("No packages required by PackagesProposal") - end + # use both mandatory and optional packages + packages_proposal_all_packages = PackagesProposal.GetAllResolvables(:package, optional: true) + packages_proposal_all_packages.concat(PackagesProposal.GetAllResolvables(:package)) + + log.info("PackagesProposal packages: #{packages_proposal_all_packages}") + install_list.concat(packages_proposal_all_packages) # Kernel is added in autoinstPackages () if autoinst is enabled if !Mode.update || !Mode.autoinst kernel_pkgs = Kernel.ComputePackages - kernel_pkgs_additional = ComputeAdditionalKernelPackages() - install_list = Convert.convert( - Builtins.union(install_list, kernel_pkgs), - :from => "list", - :to => "list <string>" - ) - if Ops.greater_than(Builtins.size(kernel_pkgs_additional), 0) && - kernel_pkgs_additional != nil - install_list = Convert.convert( - Builtins.union(install_list, kernel_pkgs_additional), - :from => "list", - :to => "list <string>" - ) - end - end + install_list.concat(kernel_pkgs) - if Pkg.IsSelected("xorg-x11-Xvnc") && Linuxrc.vnc - install_list = Convert.convert( - Builtins.union(install_list, graphicPackages), - :from => "list", - :to => "list <string>" - ) - else - Builtins.y2milestone("Not selecting graphic packages") + kernel_pkgs_additional = ComputeAdditionalKernelPackages() + install_list.concat(kernel_pkgs_additional) end - if Pkg.IsSelected("java") - install_list = Convert.convert( - Builtins.union(install_list, javaPackages), - :from => "list", - :to => "list <string>" - ) - else - Builtins.y2milestone("Not selecting java packages") + # TODO: um, VNC packages are also selected in modePackages(),... ??? + if Pkg.IsSelected("xorg-x11-Xvnc") && Linuxrc.vnc && !Linuxrc.serial_console + log.info("Selecting graphic packages: #{GRAPHIC_PACKAGES}") + install_list.concat(GRAPHIC_PACKAGES) end - install_list = Convert.convert( - Builtins.union(install_list, kernelCmdLinePackages), - :from => "list", - :to => "list <string>" - ) + install_list.concat(kernelCmdLinePackages) - install_list = Convert.convert( - Builtins.union(install_list, boardPackages), - :from => "list", - :to => "list <string>" - ) + install_list.concat(boardPackages) # add packages required to access the repository in the 2nd stage and at run-time - install_list = Convert.convert( - Builtins.union(install_list, sourceAccessPackages), - :from => "list", - :to => "list <string>" - ) + install_list.concat(sourceAccessPackages) # and the most flexible enhancement for other products # NOTE: not really flexible, because it requires the client # in the instsys, instead use <kernel-packages> in the control file. - if ProductFeatures.GetFeature("software", "packages_transmogrify") != "" + pkg_mogrify_client = ProductFeatures.GetFeature("software", "packages_transmogrify") + if !pkg_mogrify_client.empty? tmp_list = Convert.convert( - WFM.CallFunction( - ProductFeatures.GetStringFeature( - "software", - "packages_transmogrify" - ), - [install_list] - ), + WFM.CallFunction(pkg_mogrify_client, [install_list]), :from => "any", :to => "list <string>" ) @@ -1250,23 +1134,15 @@ install_list = deep_copy(tmp_list) if tmp_list != nil end - packages = Convert.convert( - ProductFeatures.GetFeature("software", "packages"), - :from => "any", - :to => "list <string>" - ) - if Ops.greater_than(Builtins.size(packages), 0) && packages != nil - Builtins.y2milestone("Adding packages from control file: %1", packages) - install_list = Convert.convert( - Builtins.union(install_list, packages), - :from => "list", - :to => "list <string>" - ) + packages = ProductFeatures.GetFeature("software", "packages") + if !packages.empty? + log.info("Adding packages from control file: #{packages}") + install_list.concat(packages) end - install_list = Builtins.toset(install_list) - Builtins.y2milestone("auto-adding packages: %1", install_list) - deep_copy(install_list) + install_list.uniq! + log.info("Computed packages for the system: #{install_list}") + install_list end # Check whether content file in the specified repository is the same diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.2.9/test/default_desktop_test.rb new/yast2-packager-3.2.10/test/default_desktop_test.rb --- old/yast2-packager-3.2.9/test/default_desktop_test.rb 2016-11-25 11:46:28.000000000 +0100 +++ new/yast2-packager-3.2.10/test/default_desktop_test.rb 2016-12-01 11:28:47.000000000 +0100 @@ -5,6 +5,8 @@ Yast.import "DefaultDesktop" describe Yast::DefaultDesktop do + subject { Yast::DefaultDesktop } + def mock_product_features allow(Yast::ProductFeatures).to receive(:GetFeature) .with("software", "default_desktop").and_return("kde") @@ -85,12 +87,12 @@ before do mock_product_features - Yast::DefaultDesktop.ForceReinit + subject.ForceReinit end describe ".GetAllDesktopsMap" do it "returns hash with all desktops defined in product" do - expect(Yast::DefaultDesktop.GetAllDesktopsMap.keys).to (match_array( + expect(subject.GetAllDesktopsMap.keys).to (match_array( ["gnome", "kde", "min_x", "xfce", "lxde", "textmode"] )) end @@ -98,18 +100,23 @@ describe ".Desktop" do it "returns default desktop name if not set" do - expect(Yast::DefaultDesktop.Desktop).to eq "kde" + expect(subject.Desktop).to eq "kde" end it "returns name specified with #SetDesktop" do - Yast::DefaultDesktop.SetDesktop("gnome") - expect(Yast::DefaultDesktop.Desktop).to eq "gnome" + subject.SetDesktop("gnome") + expect(subject.Desktop).to eq "gnome" end end describe ".SelectedPatterns" do it "returns resolved patterns specified in control for chosen desktop" do - expect(Yast::DefaultDesktop.SelectedPatterns).to eq ["kde", "x11", "base"] + expect(subject.SelectedPatterns).to eq ["kde", "x11", "base"] + end + + it "the patterns are marked as optional for the PackagesProposal module" do + expect(Yast::PackagesProposal).to receive(:GetResolvables).with(anything, :pattern, optional: true) + subject.SelectedPatterns end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.2.9/test/packages_test.rb new/yast2-packager-3.2.10/test/packages_test.rb --- old/yast2-packager-3.2.9/test/packages_test.rb 2016-11-25 11:46:28.000000000 +0100 +++ new/yast2-packager-3.2.10/test/packages_test.rb 2016-12-01 11:28:47.000000000 +0100 @@ -410,6 +410,7 @@ expect(Yast::Arch).to receive(:is_laptop).and_return(false) expect(Yast::Arch).to receive(:has_pcmcia).and_return(false) expect(Yast::PackagesProposal).to receive(:GetAllResolvables).with(:pattern).and_return([]) + expect(Yast::PackagesProposal).to receive(:GetAllResolvables).with(:pattern, optional: true).and_return([]) end context "when fips pattern is available" do