Hello community, here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2016-11-15 17:53:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-10-26 13:26:49.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes 2016-11-15 17:53:37.000000000 +0100 @@ -1,0 +2,17 @@ +Tue Nov 15 11:58:58 UTC 2016 - [email protected] + +- Use a non-blocking error in the installation proposal for not + enough space issue during upgrade instead of just warning as it + can be easier to overlook by an user + (bsc#1003682) +- 3.2.7 + +------------------------------------------------------------------- +Mon Nov 14 11:40:56 UTC 2016 - [email protected] + +- Software proposal: display an error when a package or a pattern + required by YaST has been deselected by user, implement a generic + solution for bsc#885496 +- 3.2.6 + +------------------------------------------------------------------- Old: ---- yast2-packager-3.2.5.tar.bz2 New: ---- yast2-packager-3.2.7.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-packager.spec ++++++ --- /var/tmp/diff_new_pack.nCDYfd/_old 2016-11-15 17:53:38.000000000 +0100 +++ /var/tmp/diff_new_pack.nCDYfd/_new 2016-11-15 17:53:38.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.2.5 +Version: 3.2.7 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-packager-3.2.5.tar.bz2 -> yast2-packager-3.2.7.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.2.5/.travis.yml new/yast2-packager-3.2.7/.travis.yml --- old/yast2-packager-3.2.5/.travis.yml 2016-10-24 15:44:34.000000000 +0200 +++ new/yast2-packager-3.2.7/.travis.yml 2016-11-15 14:14:56.000000000 +0100 @@ -5,7 +5,7 @@ # disable rvm, use system Ruby - rvm reset - wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh - - sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2 yast2-pkg-bindings yast2-storage" -g "rspec:3.3.0 yast-rake simplecov coveralls" + - sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2 yast2-pkg-bindings yast2-storage" -g "rspec:3.3.0 yast-rake simplecov coveralls cheetah" script: - sudo rake install - COVERAGE=1 rake test:unit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.2.5/package/yast2-packager.changes new/yast2-packager-3.2.7/package/yast2-packager.changes --- old/yast2-packager-3.2.5/package/yast2-packager.changes 2016-10-24 15:44:34.000000000 +0200 +++ new/yast2-packager-3.2.7/package/yast2-packager.changes 2016-11-15 14:14:56.000000000 +0100 @@ -1,4 +1,21 @@ ------------------------------------------------------------------- +Tue Nov 15 11:58:58 UTC 2016 - [email protected] + +- Use a non-blocking error in the installation proposal for not + enough space issue during upgrade instead of just warning as it + can be easier to overlook by an user + (bsc#1003682) +- 3.2.7 + +------------------------------------------------------------------- +Mon Nov 14 11:40:56 UTC 2016 - [email protected] + +- Software proposal: display an error when a package or a pattern + required by YaST has been deselected by user, implement a generic + solution for bsc#885496 +- 3.2.6 + +------------------------------------------------------------------- Mon Oct 24 14:54:59 CEST 2016 - [email protected] - Faking /etc/mtab on target system for post RPM installation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.2.5/package/yast2-packager.spec new/yast2-packager-3.2.7/package/yast2-packager.spec --- old/yast2-packager-3.2.5/package/yast2-packager.spec 2016-10-24 15:44:34.000000000 +0200 +++ new/yast2-packager-3.2.7/package/yast2-packager.spec 2016-11-15 14:14:56.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.2.5 +Version: 3.2.7 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.2.5/src/modules/Packages.rb new/yast2-packager-3.2.7/src/modules/Packages.rb --- old/yast2-packager-3.2.5/src/modules/Packages.rb 2016-10-24 15:44:34.000000000 +0200 +++ new/yast2-packager-3.2.7/src/modules/Packages.rb 2016-11-15 14:14:56.000000000 +0100 @@ -593,7 +593,7 @@ _( "Not enough disk space. Remove some packages in the single selection." ), - "warning_level" => Mode.update ? :warning : :blocker + "warning_level" => Mode.update ? :error : :blocker } else # check available free space (less than 25% and less than 750MB) (see bnc#178357) @@ -627,6 +627,19 @@ end end + # Check the YaST required packages. + missing_resolvables = check_missing_resolvables + if !missing_resolvables.empty? + texts = missing_resolvables.map{ |type, list| format_missing_resolvables(type, list) } + texts << _("Please manually select the needed items to install.") + + # include the existing warning if defined + texts.unshift(ret["warning"]) if ret["warning"] + + ret["warning"] = texts.join("<br>") + ret["warning_level"] = :blocker + end + # add failed mounts ret = AddFailedMounts(ret) @@ -2766,6 +2779,53 @@ def has_window_manager? Pkg.IsSelected("windowmanager") || Pkg.IsProvided("windowmanager") end + + # Check whether all packages needed by YaST will be installed (the user can + # override the YaST settings) + # @return [Hash<Symbol,Array<String>>] The key is resolvable type (:pattern or + # :package), the value is list of names. + # If nothing is missing an empty Hash is returned. + def check_missing_resolvables + missing = {} + proposed = PackagesProposal.GetAllResolvablesForAllTypes + + proposed.each do |type, list| + list.each do |item| + statuses = Pkg.ResolvableProperties(item, type, "") + + # :selected = selected to install/update, :installed = keep installed (at upgrade) + if statuses.nil? || !statuses.find { |s| s["status"] == :selected || s["status"] == :installed } + missing[type] = [] unless missing[type] + # use quoted "summary" value for patterns as they usually contain spaces + name = (type == :pattern) ? statuses.first["summary"].inspect : item + missing[type] << name + end + end + end + + missing + end + + # Build a human readable string describing missing resolvables. + # @param [Symbol] type resolvable type, either :pattern or :packages + # @param [Array<String>] list of names + # @return [String] Translated message containing missing resolvables + def format_missing_resolvables(type, list) + list_str = list.join(", ") + + case type + when :package + # TRANSLATORS: %s is a package list + _("These packages need to be selected to install: %s") % list_str + when :pattern + # TRANSLATORS: %s is a pattern list + _("These patterns need to be selected to install: %s") % list_str + else + # TRANSLATORS: %{type} is a resolvable type, %{list} is a list of names + # This is a fallback message for unknown types, normally it should not be displayed + _("These items (%{type}) need to be selected to install: %{list}") % {type: type, list: list} + end + end end Packages = PackagesClass.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.2.5/test/packages_test.rb new/yast2-packager-3.2.7/test/packages_test.rb --- old/yast2-packager-3.2.5/test/packages_test.rb 2016-10-24 15:44:34.000000000 +0200 +++ new/yast2-packager-3.2.7/test/packages_test.rb 2016-11-15 14:14:56.000000000 +0100 @@ -993,4 +993,63 @@ end end + describe "#Summary" do + before do + # mock disk space calculation + allow(subject).to receive(:CheckDiskSize).and_return(true) + allow(Yast::SpaceCalculation).to receive(:CheckDiskFreeSpace).and_return([]) + allow(Yast::SpaceCalculation).to receive(:GetFailedMounts).and_return([]) + + allow(Yast::PackagesProposal).to receive(:GetAllResolvablesForAllTypes) + .and_return({package: ["grub2"], pattern: ["kde"]}) + end + + context "YaST preselected items are deselected by user" do + before do + expect(Yast::Pkg).to receive(:ResolvableProperties).with("grub2", :package, "") + .and_return(["status" => :available]) + expect(Yast::Pkg).to receive(:ResolvableProperties).with("kde", :pattern, "") + .and_return(["status" => :available, "summary" => "KDE Desktop Environment"]) + end + + it "Reports missing pre-selected packages" do + summary = subject.Summary([:package], false) + expect(summary["warning"]).to include("grub2") + end + + it "Reports missing pre-selected patterns" do + summary = subject.Summary([:package], false) + expect(summary["warning"]).to include("KDE Desktop Environment") + end + + it "Installation/upgrade is blocked" do + summary = subject.Summary([:package], false) + expect(summary["warning_level"]).to eq(:blocker) + end + end + + context "YaST preselected items are not deselected by user" do + before do + expect(Yast::Pkg).to receive(:ResolvableProperties).with("grub2", :package, "") + .and_return(["status" => :selected]) + expect(Yast::Pkg).to receive(:ResolvableProperties).with("kde", :pattern, "") + .and_return(["status" => :selected]) + end + + it "Does not report missing pre-selected packages" do + summary = subject.Summary([:package], false) + expect(summary["warning"]).to be_nil + end + + it "Does not report missing pre-selected patterns" do + summary = subject.Summary([:package], false) + expect(summary["warning"]).to be_nil + end + + it "Installation/upgrade is not blocked" do + summary = subject.Summary([:package], false) + expect(summary["warning_level"]).to_not eq(:blocker) + end + end + end end
