Hello community,

here is the log from the commit of package yast2-online-update for 
openSUSE:Factory checked in at 2014-03-11 09:24:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-online-update (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-online-update.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-online-update"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-online-update/yast2-online-update.changes  
2014-02-16 10:28:31.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-online-update.new/yast2-online-update.changes 
    2014-03-11 09:24:15.000000000 +0100
@@ -1,0 +2,7 @@
+Fri Mar  7 17:21:05 CET 2014 - loci...@suse.com
+
+- Reporting products that have reached their end of support when
+  Online Update module is started (FATE#316172)
+- 3.1.3
+
+-------------------------------------------------------------------

Old:
----
  yast2-online-update-3.1.2.tar.bz2

New:
----
  yast2-online-update-3.1.3.tar.bz2

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

Other differences:
------------------
++++++ yast2-online-update.spec ++++++
--- /var/tmp/diff_new_pack.vWJZDh/_old  2014-03-11 09:24:15.000000000 +0100
+++ /var/tmp/diff_new_pack.vWJZDh/_new  2014-03-11 09:24:15.000000000 +0100
@@ -17,8 +17,9 @@
 
 
 Name:           yast2-online-update
-Version:        3.1.2
+Version:        3.1.3
 Release:        0
+Url:            https://github.com/yast/yast-online-update
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source0:        %{name}-%{version}.tar.bz2
@@ -29,8 +30,8 @@
 BuildRequires:  update-desktop-files
 BuildRequires:  yast2-devtools >= 3.1.10
 BuildRequires:  yast2-packager
-# patch contents
-Requires:       yast2-pkg-bindings >= 2.23.0
+# Product EOL tag
+Requires:       yast2-pkg-bindings >= 3.1.6
 # Kernel::InformAboutKernelChange
 Requires:       yast2 >= 2.23.8
 # PackageCallbacks::FormatPatchName

++++++ yast2-online-update-3.1.2.tar.bz2 -> yast2-online-update-3.1.3.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-online-update-3.1.2/package/yast2-online-update.changes 
new/yast2-online-update-3.1.3/package/yast2-online-update.changes
--- old/yast2-online-update-3.1.2/package/yast2-online-update.changes   
2014-02-10 17:38:02.000000000 +0100
+++ new/yast2-online-update-3.1.3/package/yast2-online-update.changes   
2014-03-07 18:08:43.000000000 +0100
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Fri Mar  7 17:21:05 CET 2014 - loci...@suse.com
+
+- Reporting products that have reached their end of support when
+  Online Update module is started (FATE#316172)
+- 3.1.3
+
+-------------------------------------------------------------------
 Mon Feb 10 10:44:16 CET 2014 - loci...@suse.com
 
 - Added functionality which informs user that some of the selected
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-online-update-3.1.2/package/yast2-online-update.spec 
new/yast2-online-update-3.1.3/package/yast2-online-update.spec
--- old/yast2-online-update-3.1.2/package/yast2-online-update.spec      
2014-02-10 17:38:02.000000000 +0100
+++ new/yast2-online-update-3.1.3/package/yast2-online-update.spec      
2014-03-07 18:08:43.000000000 +0100
@@ -17,8 +17,9 @@
 
 
 Name:           yast2-online-update
-Version:        3.1.2
+Version:        3.1.3
 Release:        0
+Url:            https://github.com/yast/yast-online-update
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source0:        %{name}-%{version}.tar.bz2
@@ -28,8 +29,8 @@
 BuildRequires: gcc-c++ libtool update-desktop-files yast2-packager 
 BuildRequires:  yast2-devtools >= 3.1.10
 BuildRequires:  rubygem-rspec
-# patch contents
-Requires:      yast2-pkg-bindings >= 2.23.0
+# Product EOL tag
+Requires:      yast2-pkg-bindings >= 3.1.6
 # Kernel::InformAboutKernelChange
 Requires:      yast2 >= 2.23.8
 # PackageCallbacks::FormatPatchName
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-online-update-3.1.2/src/clients/online_update_select.rb 
new/yast2-online-update-3.1.3/src/clients/online_update_select.rb
--- old/yast2-online-update-3.1.2/src/clients/online_update_select.rb   
2014-02-10 17:38:02.000000000 +0100
+++ new/yast2-online-update-3.1.3/src/clients/online_update_select.rb   
2014-03-07 18:08:43.000000000 +0100
@@ -71,6 +71,9 @@
         return :abort if @canceled
       end
 
+      # FATE#316172: Report products that have reached their end of life
+      OnlineUpdateDialogs.report_eol_products
+
       @restart_yast = false
       @reboot_needed = false
       @relogin_needed = false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-online-update-3.1.2/src/modules/OnlineUpdateDialogs.rb 
new/yast2-online-update-3.1.3/src/modules/OnlineUpdateDialogs.rb
--- old/yast2-online-update-3.1.2/src/modules/OnlineUpdateDialogs.rb    
2014-02-10 17:38:02.000000000 +0100
+++ new/yast2-online-update-3.1.3/src/modules/OnlineUpdateDialogs.rb    
2014-03-07 18:08:43.000000000 +0100
@@ -496,6 +496,22 @@
       confirm_rebooting_patches
     end
 
+    # Reports products that have reached their end of life (EOL) support
+    #
+    # @return [Boolean] whether all products are still alive
+    def report_eol_products
+      products_to_report = eol_products
+      return true if products_to_report.empty?
+
+      product_names = products_to_report.map do |product|
+        log.warn "Product out of support: #{product.inspect}"
+        product["display_name"] || product["name"] || product["short_name"]
+      end
+
+      show_eol_products(product_names)
+      false
+    end
+
     publish :function => :IgnoreWarningPopup, :type => "symbol (string, 
string)"
     publish :function => :IgnorePopup, :type => "symbol (string, string)"
     publish :function => :SkipPopup, :type => "symbol (string, string)"
@@ -505,6 +521,57 @@
     publish :function => :DisplayMsgYouOk, :type => "boolean (string, string, 
string)"
     publish :function => :MessagePopup, :type => "boolean (list <map>, 
boolean)"
     publish :function => :validate_selected_patches, :type => "boolean ()"
+    publish :function => :report_eol_products, :type => "boolean ()"
+
+    private
+
+    MAX_PRODUCTS_WIDGET_HEIGHT = 12
+
+    def show_eol_products(products)
+      # 2 is an additional constant for borders
+      min_richtext_heigth = [products.size, MAX_PRODUCTS_WIDGET_HEIGHT].min + 2
+
+      dialog_description = HBox(
+        HSpacing(2),
+        VBox(
+          HSpacing(65),
+          # Dialog label above a list of products (out of support)
+          Left(Label(_(
+            "These products have reached their end of general support\n" +
+            "and thus do not provide new updates anymore.\n\n" +
+            "In case that your subscription contains extended support,\n" +
+            "please make sure that you have activated the extension.\n\n" +
+            "Contact us if you need further assistance."
+          ))),
+          MinHeight(
+            min_richtext_heigth,
+            RichText(Opt(:vstretch), products.sort.join("<br>"))
+          ),
+          PushButton(Id(:ok), Opt(:default), Label.OKButton),
+        ),
+        HSpacing(2)
+      )
+
+      UI.OpenDialog(dialog_description)
+      user_ret = UI.UserInput
+      UI.CloseDialog
+    end
+
+    # Returns all products over the end of life support
+    def eol_products
+      time_now = Time.now.to_i
+
+      installed_products.select do |p|
+        p["eol"] && p["eol"].to_i < time_now
+      end
+    end
+
+    # Returns all installed products
+    def installed_products
+      Pkg.ResolvableProperties("", :product, "").select do |p|
+        p["status"] == :installed
+      end
+    end
   end
 
   OnlineUpdateDialogs = OnlineUpdateDialogsClass.new
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-online-update-3.1.2/test/online_update_dialogs_test.rb 
new/yast2-online-update-3.1.3/test/online_update_dialogs_test.rb
--- old/yast2-online-update-3.1.2/test/online_update_dialogs_test.rb    
2014-02-10 17:38:02.000000000 +0100
+++ new/yast2-online-update-3.1.3/test/online_update_dialogs_test.rb    
2014-03-07 18:08:43.000000000 +0100
@@ -8,18 +8,20 @@
 Yast.import "Pkg"
 Yast.import "UI"
 
-DEFAULT_PATCH = {
+def default_patch
+{
     "status" => :selected,
     "name" => "patch_#{$patch_id}",
     "reboot_needed" => false,
     "description" => "...",
     "arch" => "noarch",
 }
+end
 
 def patch(args = {})
   $patch_id ||= 0
   $patch_id += 1
-  DEFAULT_PATCH.merge(args)
+  default_patch.merge(args)
 end
 
 # Two patches have "reboot_needed" => true
@@ -28,6 +30,53 @@
 # All patches are "reboot_needed" => false
 PATCHES_WITHOUT_REBOOTING = Array.new(4){ patch }
 
+def default_product
+{
+  "arch" => "x86_64",
+  "category" => "base",
+  "description" => "...",
+  "display_name" => "openSUSE v#{$product_id}",
+  "download_size" => 0,
+  "flags" => [],
+  "flavor" => "dvd-promo",
+  "inst_size" => 0,
+  "locked" => false,
+  "medium_nr" => 0,
+  "name" => "openSUSE",
+  "product_file" => "/etc/products.d/openSUSE.prod",
+  "register_release" => "",
+  "register_target" => "openSUSE-800.#{$product_id}-x86_64",
+  "relnotes_url" => 
"http://doc.opensuse.org/release-notes/x86_64/openSUSE/800.#{$product_id}/release-notes-openSUSE.rpm";,
+  "relnotes_urls" => 
["http://doc.opensuse.org/release-notes/x86_64/openSUSE/800.#{$product_id}/release-notes-openSUSE.rpm";],
+  "short_name" => "openSUSE",
+  "source" => -1,
+  "status" => :unknown,
+  "summary" => "openSUSE Product #{$product_id}",
+  "transact_by" => :solver,
+  "type" => "base",
+  "update_urls" => [],
+  "upgrades" => [],
+  "vendor" => "openSUSE",
+  "version" => "800.#{$product_id}-1.123456"
+}
+end
+
+def product(args = {})
+  $product_id ||= 0
+  $product_id += 1
+  default_product.merge(args)
+end
+
+AVAILABLE_PRODUCTS = Array.new(2){ product("status" => :available) }
+
+# Products after end of life
+EOL_TIME = Time.now.to_i - 123456
+EOL_PRODUCTS = Array.new(2){ product("status" => :installed, "eol" => 
EOL_TIME) }
+
+# Products before end of life
+NON_EOL_TIME = Time.now.to_i + 123456
+NON_EOL_PRODUCTS = Array.new(2){ product("status" => :installed, "eol" => 
NON_EOL_TIME) }
+
 describe "OnlineUpdateDialogs" do
   before(:each) do
     Yast::Pkg.stub(:ResolvableProperties).and_return(PATCHES)
@@ -106,4 +155,27 @@
       expect { Yast::OnlineUpdateDialogs.confirm_rebooting_patches }.to 
raise_error
     end
   end
+
+  describe "#report_eol_products" do
+    it "reports all products that have ended their support" do
+      Yast::UI.stub(:OpenDialog).and_return(true)
+      Yast::UI.stub(:UserInput).and_return(:ok)
+      Yast::UI.stub(:CloseDialog).and_return(true)
+
+      # These products are still alive
+      Yast::Pkg.stub(:ResolvableProperties).and_return(AVAILABLE_PRODUCTS + 
NON_EOL_PRODUCTS)
+      expect(Yast::OnlineUpdateDialogs.report_eol_products).to be_true
+
+      # Some of these products have reached their EOL
+      Yast::Pkg.stub(:ResolvableProperties).and_return(AVAILABLE_PRODUCTS + 
EOL_PRODUCTS + NON_EOL_PRODUCTS)
+      expect(Yast::OnlineUpdateDialogs.report_eol_products).to be_false
+    end
+  end
+
+  describe "#eol_products" do
+    it "returns all products that are out of support" do
+      Yast::Pkg.stub(:ResolvableProperties).and_return(AVAILABLE_PRODUCTS + 
EOL_PRODUCTS + NON_EOL_PRODUCTS)
+      expect(Yast::OnlineUpdateDialogs.send(:eol_products)).to eq(EOL_PRODUCTS)
+    end
+  end
 end

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to