Hello community,

here is the log from the commit of package yast2-packager for openSUSE:Factory 
checked in at 2019-11-20 10:25:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-packager.new.26869 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-packager"

Wed Nov 20 10:25:58 2019 rev:381 rq:747528 version:4.2.32

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes    
2019-10-03 14:06:51.472501839 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-packager.new.26869/yast2-packager.changes 
2019-11-20 10:25:59.934547476 +0100
@@ -1,0 +2,14 @@
+Fri Nov  8 18:58:23 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Preselect the installed add-ons when upgrading from the Full
+  installation medium (related to jsc#SLE-7101)
+- 4.2.32
+
+-------------------------------------------------------------------
+Fri Nov  1 18:52:02 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Do not crash when the product licenses cannot be read
+  (bsc#1155454)
+- 4.2.31
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.GjyhhU/_old  2019-11-20 10:26:00.602547609 +0100
+++ /var/tmp/diff_new_pack.GjyhhU/_new  2019-11-20 10:26:00.606547610 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        4.2.30
+Version:        4.2.32
 Release:        0
 Summary:        YaST2 - Package Library
 License:        GPL-2.0-or-later

++++++ yast2-packager-4.2.30.tar.bz2 -> yast2-packager-4.2.32.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.30/package/yast2-packager.changes 
new/yast2-packager-4.2.32/package/yast2-packager.changes
--- old/yast2-packager-4.2.30/package/yast2-packager.changes    2019-10-02 
10:27:03.000000000 +0200
+++ new/yast2-packager-4.2.32/package/yast2-packager.changes    2019-11-12 
10:03:54.000000000 +0100
@@ -1,4 +1,18 @@
 -------------------------------------------------------------------
+Fri Nov  8 18:58:23 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Preselect the installed add-ons when upgrading from the Full
+  installation medium (related to jsc#SLE-7101)
+- 4.2.32
+
+-------------------------------------------------------------------
+Fri Nov  1 18:52:02 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Do not crash when the product licenses cannot be read
+  (bsc#1155454)
+- 4.2.31
+
+-------------------------------------------------------------------
 Tue Oct  1 17:13:42 UTC 2019 - Ladislav Slezák <[email protected]>
 
 - Do not add an empty repository from the offline medium root
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.30/package/yast2-packager.spec 
new/yast2-packager-4.2.32/package/yast2-packager.spec
--- old/yast2-packager-4.2.30/package/yast2-packager.spec       2019-10-02 
10:27:03.000000000 +0200
+++ new/yast2-packager-4.2.32/package/yast2-packager.spec       2019-11-12 
10:03:54.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-packager
-Version:        4.2.30
+Version:        4.2.32
 Release:        0
 Summary:        YaST2 - Package Library
 License:        GPL-2.0-or-later
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-packager-4.2.30/src/lib/y2packager/dialogs/addon_selector.rb 
new/yast2-packager-4.2.32/src/lib/y2packager/dialogs/addon_selector.rb
--- old/yast2-packager-4.2.30/src/lib/y2packager/dialogs/addon_selector.rb      
2019-10-02 10:27:03.000000000 +0200
+++ new/yast2-packager-4.2.32/src/lib/y2packager/dialogs/addon_selector.rb      
2019-11-12 10:03:54.000000000 +0100
@@ -13,7 +13,10 @@
 require "yast"
 require "erb"
 require "ui/installation_dialog"
+require "y2packager/resolvable"
 
+Yast.import "AddOnProduct"
+Yast.import "Mode"
 Yast.import "Report"
 Yast.import "Stage"
 Yast.import "UI"
@@ -77,7 +80,7 @@
         "subdirectories. Select which products you want to install.</p>")
       end
 
-      # Handle changing the current item or chaging the selection
+      # Handle changing the current item or changing the selection
       def addon_repos_handler
         current_item = Yast::UI.QueryWidget(Id(:addon_repos), :CurrentItem)
         current_product = products.find { |p| p.dir == current_item }
@@ -113,7 +116,8 @@
       attr_writer :selected_products
 
       def selection_content
-        products.map { |p| Item(Id(p.dir), p.summary || p.name) }
+        defaults = preselected_products
+        products.map { |p| Item(Id(p.dir), p.summary || p.name, 
defaults.include?(p)) }
       end
 
       # Dialog content
@@ -229,6 +233,19 @@
         # render the ERB template in the context of this object
         erb.result(binding)
       end
+
+      # return a list of the preselected products
+      # during upgrade we want to preselect the installed products
+      # @return [Array<Y2Packager::ProductLocation>] the products
+      def preselected_products
+        return [] unless Yast::Mode.update
+
+        missing_products = Yast::AddOnProduct.missing_upgrades
+        # installed but not selected yet products (to avoid duplicates)
+        products.select do |p|
+          missing_products.include?(p.details&.product)
+        end
+      end
     end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.30/src/modules/AddOnProduct.rb 
new/yast2-packager-4.2.32/src/modules/AddOnProduct.rb
--- old/yast2-packager-4.2.30/src/modules/AddOnProduct.rb       2019-10-02 
10:27:03.000000000 +0200
+++ new/yast2-packager-4.2.32/src/modules/AddOnProduct.rb       2019-11-12 
10:03:54.000000000 +0100
@@ -1967,6 +1967,38 @@
         old_name, new_name)
     end
 
+    # Return a list of the product add-ons which are installed but are not 
selected for upgrade.
+    # These add-ons should be additionally selected to install.
+    # It handles also the product renames, the returned list might contain 
different
+    # (new) names than the currently installed products.
+    # @return [Array<String>] the product names
+    def missing_upgrades
+      installed_addons = Y2Packager::Resolvable.find(
+        kind: :product, status: :installed, type: "addon"
+      ).map(&:name) + Y2Packager::Resolvable.find(
+        kind: :product, status: :removed, type: "addon"
+      ).map(&:name)
+
+      selected_addons = Y2Packager::Resolvable.find(
+        kind: :product, status: :selected, type: "addon"
+      ).map(&:name)
+
+      # handle the product renames, if a renamed product was installed
+      # replace it with the new product so the new product is preselected
+      DEFAULT_PRODUCT_RENAMES.each do |k, v|
+        next unless installed_addons.include?(k)
+
+        installed_addons.delete(k)
+        installed_addons.concat(v)
+      end
+
+      # installed but not selected
+      ret = installed_addons - selected_addons
+
+      log.info "Found missing product upgrades: #{ret}"
+      ret
+    end
+
     publish variable: :add_on_products, type: "list <map <string, any>>"
     publish variable: :src_id, type: "integer"
     publish variable: :last_ret, type: "symbol"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-4.2.30/src/modules/ProductLicense.rb 
new/yast2-packager-4.2.32/src/modules/ProductLicense.rb
--- old/yast2-packager-4.2.30/src/modules/ProductLicense.rb     2019-10-02 
10:27:03.000000000 +0200
+++ new/yast2-packager-4.2.32/src/modules/ProductLicense.rb     2019-11-12 
10:03:54.000000000 +0100
@@ -1709,7 +1709,9 @@
       found_license = false
 
       product_names.each do |product_name|
-        locales = Pkg.PrdLicenseLocales(product_name)
+        # in some corner cases the repository might contain a broken product
+        # for which we get 'nil' locales (bsc#1155454)
+        locales = Pkg.PrdLicenseLocales(product_name) || []
         log.info("License locales for product #{product_name.inspect}: 
#{locales.inspect}")
 
         locales.each do |locale|


Reply via email to