Hello community,

here is the log from the commit of package yast2-packager for openSUSE:Factory 
checked in at 2019-04-18 09:54:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-packager.new.17052 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-packager"

Thu Apr 18 09:54:54 2019 rev:372 rq:694431 version:4.2.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes    
2019-04-08 10:34:03.299198316 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-packager.new.17052/yast2-packager.changes 
2019-04-18 09:54:58.537286519 +0200
@@ -1,0 +2,6 @@
+Tue Apr  9 09:56:17 CEST 2019 - sch...@suse.de
+
+- Update proposal: Showing product obsoletes. (bsc#1131503)
+- 4.2.3
+
+-------------------------------------------------------------------

Old:
----
  yast2-packager-4.2.2.tar.bz2

New:
----
  yast2-packager-4.2.3.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.Vb53bM/_old  2019-04-18 09:54:59.189286934 +0200
+++ /var/tmp/diff_new_pack.Vb53bM/_new  2019-04-18 09:54:59.189286934 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        4.2.2
+Version:        4.2.3
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -35,8 +35,8 @@
 # break the yast2-packager -> yast2-storage-ng -> yast2-packager build cycle
 #!BuildIgnore: yast2-packager
 
-# Y2Packager::ProductLicense
-BuildRequires:  yast2 >= 4.0.63
+# Y2Packager::will_be_obsoleted_by
+BuildRequires:  yast2 >= 4.1.68
 
 # Pkg::PrdLicenseLocales
 BuildRequires:  yast2-pkg-bindings >= 4.0.8
@@ -50,8 +50,8 @@
 # Pkg::PrdLicenseLocales
 Requires:       yast2-pkg-bindings >= 4.0.8
 
-# Y2Packager::ProductLicense
-Requires:       yast2 >= 4.0.63
+# Y2Packager::will_be_obsoleted_by
+Requires:       yast2 >= 4.1.68
 
 # unzipping license file
 Requires:       unzip

++++++ yast2-packager-4.2.2.tar.bz2 -> yast2-packager-4.2.3.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.2/package/yast2-packager.changes 
new/yast2-packager-4.2.3/package/yast2-packager.changes
--- old/yast2-packager-4.2.2/package/yast2-packager.changes     2019-04-03 
14:25:52.000000000 +0200
+++ new/yast2-packager-4.2.3/package/yast2-packager.changes     2019-04-11 
14:56:13.000000000 +0200
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Tue Apr  9 09:56:17 CEST 2019 - sch...@suse.de
+
+- Update proposal: Showing product obsoletes. (bsc#1131503)
+- 4.2.3
+
+-------------------------------------------------------------------
 Wed Apr  3 10:38:03 CEST 2019 - sch...@suse.de
 
 - Package proposal: Reset solver state before starting the next
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.2/package/yast2-packager.spec 
new/yast2-packager-4.2.3/package/yast2-packager.spec
--- old/yast2-packager-4.2.2/package/yast2-packager.spec        2019-04-03 
14:25:52.000000000 +0200
+++ new/yast2-packager-4.2.3/package/yast2-packager.spec        2019-04-11 
14:56:13.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        4.2.2
+Version:        4.2.3
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -35,8 +35,8 @@
 # break the yast2-packager -> yast2-storage-ng -> yast2-packager build cycle
 #!BuildIgnore: yast2-packager
 
-# Y2Packager::ProductLicense
-BuildRequires:  yast2 >= 4.0.63
+# Y2Packager::will_be_obsoleted_by
+BuildRequires:  yast2 >= 4.1.68
 
 # Pkg::PrdLicenseLocales
 BuildRequires:  yast2-pkg-bindings >= 4.0.8
@@ -50,8 +50,8 @@
 # Pkg::PrdLicenseLocales
 Requires:       yast2-pkg-bindings >= 4.0.8
 
-# Y2Packager::ProductLicense
-Requires:       yast2 >= 4.0.63
+# Y2Packager::will_be_obsoleted_by
+Requires:       yast2 >= 4.1.68
 
 # unzipping license file
 Requires:       unzip
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.2/src/modules/Packages.rb 
new/yast2-packager-4.2.3/src/modules/Packages.rb
--- old/yast2-packager-4.2.2/src/modules/Packages.rb    2019-04-03 
14:25:52.000000000 +0200
+++ new/yast2-packager-4.2.3/src/modules/Packages.rb    2019-04-11 
14:56:13.000000000 +0200
@@ -8,6 +8,8 @@
 require "cgi"
 require "shellwords"
 
+require "y2packager/product_upgrade"
+
 # Yast namespace
 module Yast
   # Package selections
@@ -723,19 +725,28 @@
       end
 
       ret += status[:removed].map do |product|
-        transact_by = product["transact_by"]
-        log.warn "Product will be removed (by #{transact_by}): #{product}"
+        obsolete = 
Y2Packager::ProductUpgrade.will_be_obsoleted_by(product["name"])
+        if obsolete.empty?
+          transact_by = product["transact_by"]
+          log.warn "Product will be removed (by #{transact_by}): #{product}"
+
+          # Removing another product might be an issue
+          # (just warn if removed by user or by YaST)
+          msg = if [:user, :app_high].include?(transact_by)
+            _("<b>Warning:</b> Product <b>%s</b> will be removed.") % 
h(product_label(product))
+          else
+            _("<b>Error:</b> Product <b>%s</b> will be automatically 
removed.") %
+              h(product_label(product))
+          end
 
-        # Removing another product might be an issue
-        # (just warn if removed by user or by YaST)
-        msg = if [:user, :app_high].include?(transact_by)
-          _("<b>Warning:</b> Product <b>%s</b> will be removed.") % 
h(product_label(product))
+          re = HTML.Colorize(msg, "red")
         else
-          _("<b>Error:</b> Product <b>%s</b> will be automatically removed.") %
-            h(product_label(product))
+          # TRANSLATORS: Old product %{old_product} will be obsoleted by 
%{new_product} products.
+          re = _("Product <b>%{old_product}</b> will be updated to 
<b>%{new_product}</b>") % {
+            old_product: h(product_label(product)), new_product: 
obsolete.join(", ")
+          }
         end
-
-        HTML.Colorize(msg, "red")
+        re
       end
 
       log.info "Product update summary: #{ret}"
@@ -750,7 +761,12 @@
     def product_update_warning(products)
       status = group_products_by_status(products)
 
-      return {} if status[:removed].all? { |product| product["transact_by"] != 
:solver }
+      ret = status[:removed].all? do |product|
+        product["transact_by"] != :solver ||
+          
!Y2Packager::ProductUpgrade.will_be_obsoleted_by(product["name"]).empty?
+      end
+
+      return {} if ret
 
       # Automatic product removal MUST be confirmed by user, otherwise update
       # cannot be started.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.2/test/packages_test.rb 
new/yast2-packager-4.2.3/test/packages_test.rb
--- old/yast2-packager-4.2.2/test/packages_test.rb      2019-04-03 
14:25:52.000000000 +0200
+++ new/yast2-packager-4.2.3/test/packages_test.rb      2019-04-11 
14:56:13.000000000 +0200
@@ -448,6 +448,9 @@
 
   describe "#product_update_summary" do
     let(:products) { load_zypp("products_update.yml") }
+    before do
+      allow(Y2Packager::ProductUpgrade).to 
receive(:will_be_obsoleted_by).and_return([])
+    end
 
     it "describes the product update as a human readable summary" do
       summary_string = Yast::Packages.product_update_summary(products).to_s
@@ -479,13 +482,31 @@
   describe "#product_update_warning" do
     let(:products) { load_zypp("products_update.yml") }
 
-    it "returns a hash with warning when there is an automatically removed 
product" do
-      expect(Yast::Packages.product_update_warning(products)).to 
include("warning", "warning_level")
+    context "product will be removed due an obsolete" do
+      before do
+        allow(Y2Packager::ProductUpgrade).to receive(:will_be_obsoleted_by)
+          .and_return(["new_product"])
+      end
+
+      it "returns empty hash" do
+        expect(Yast::Packages.product_update_warning(products)).to eq({})
+      end
     end
 
-    it "returns empty hash when there is no automatically removed product" do
-      products.each { |product| product["transact_by"] = :user }
-      expect(Yast::Packages.product_update_warning(products)).to eq({})
+    context "product will be removed" do
+      before do
+        allow(Y2Packager::ProductUpgrade).to 
receive(:will_be_obsoleted_by).and_return([])
+      end
+
+      it "returns a hash with warning when there is an automatically removed 
product" do
+        expect(Yast::Packages.product_update_warning(products)).to 
include("warning",
+          "warning_level")
+      end
+
+      it "returns empty hash when there is no automatically removed product" do
+        products.each { |product| product["transact_by"] = :user }
+        expect(Yast::Packages.product_update_warning(products)).to eq({})
+      end
     end
   end
 


Reply via email to