Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-installation for 
openSUSE:Factory checked in at 2021-11-28 21:29:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-installation (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-installation.new.1895 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-installation"

Sun Nov 28 21:29:59 2021 rev:483 rq:933801 version:4.4.23

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-installation/yast2-installation.changes    
2021-11-20 02:38:34.988890441 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-installation.new.1895/yast2-installation.changes
  2021-11-28 21:30:13.494053918 +0100
@@ -1,0 +2,7 @@
+Wed Nov 24 15:13:23 UTC 2021 - David Diaz <dgonza...@suse.com>
+
+- Remove no longer used extra warning about destructive actions
+  before starting the installation process (related to bsc#1057437).
+- 4.4.23
+
+-------------------------------------------------------------------

Old:
----
  yast2-installation-4.4.22.tar.bz2

New:
----
  yast2-installation-4.4.23.tar.bz2

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

Other differences:
------------------
++++++ yast2-installation.spec ++++++
--- /var/tmp/diff_new_pack.tVsRr2/_old  2021-11-28 21:30:16.078045649 +0100
+++ /var/tmp/diff_new_pack.tVsRr2/_new  2021-11-28 21:30:16.082045637 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-installation
-Version:        4.4.22
+Version:        4.4.23
 Release:        0
 Summary:        YaST2 - Installation Parts
 License:        GPL-2.0-only

++++++ yast2-installation-4.4.22.tar.bz2 -> yast2-installation-4.4.23.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.4.22/package/yast2-installation.changes 
new/yast2-installation-4.4.23/package/yast2-installation.changes
--- old/yast2-installation-4.4.22/package/yast2-installation.changes    
2021-11-15 15:53:19.000000000 +0100
+++ new/yast2-installation-4.4.23/package/yast2-installation.changes    
2021-11-25 16:50:42.000000000 +0100
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Wed Nov 24 15:13:23 UTC 2021 - David Diaz <dgonza...@suse.com>
+
+- Remove no longer used extra warning about destructive actions
+  before starting the installation process (related to bsc#1057437).
+- 4.4.23
+
+-------------------------------------------------------------------
 Fri Nov 12 14:08:02 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
 
 - bsc#1192626:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.4.22/package/yast2-installation.spec 
new/yast2-installation-4.4.23/package/yast2-installation.spec
--- old/yast2-installation-4.4.22/package/yast2-installation.spec       
2021-11-15 15:53:19.000000000 +0100
+++ new/yast2-installation-4.4.23/package/yast2-installation.spec       
2021-11-25 16:50:42.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-installation
-Version:        4.4.22
+Version:        4.4.23
 Release:        0
 Summary:        YaST2 - Installation Parts
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.4.22/src/include/installation/misc.rb 
new/yast2-installation-4.4.23/src/include/installation/misc.rb
--- old/yast2-installation-4.4.22/src/include/installation/misc.rb      
2021-11-15 15:53:19.000000000 +0100
+++ new/yast2-installation-4.4.23/src/include/installation/misc.rb      
2021-11-25 16:50:42.000000000 +0100
@@ -1,38 +1,21 @@
-# encoding: utf-8
-
-# 
------------------------------------------------------------------------------
-# Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved.
+# Copyright (c) [2006-2021] SUSE LLC
 #
+# All Rights Reserved.
 #
-# This program is free software; you can redistribute it and/or modify it under
-# the terms of version 2 of the GNU General Public License as published by the
-# Free Software Foundation.
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
 #
 # This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more 
details.
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, contact Novell, Inc.
-#
-# To contact Novell about this file by physical or electronic mail, you may 
find
-# current contact information at www.novell.com.
-# 
------------------------------------------------------------------------------
-
-# File:
-#      include/installation/misc.ycp
-#
-# Module:
-#      System installation
-#
-# Summary:
-#      Miscelaneous functions
-#
-# Authors:
-#      Jiri Srain <jsr...@suse.cz>
-#
-# $Id$
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
 #
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
 
 require "shellwords"
 
@@ -52,11 +35,6 @@
       Yast.import "Linuxrc"
       Yast.import "InstData"
       Yast.import "HTML"
-# storage-ng
-# rubocop:disable Style/BlockComments
-=begin
-      Yast.import "Storage"
-=end
 
       @modules_to_enable_with_AC_on = nil
     end
@@ -84,84 +62,12 @@
       nil
     end
 
-    # moved from clients/inst_doit.ycp
-    # to fix bug #219097
-
-    # Confirm installation or update.
-    # Returns 'true' if the user confirms, 'false' otherwise.
+    # Confirm installation or update
+    #
+    # @note moved from clients/inst_doit.ycp to fix bug #219097
     #
+    # @return [Booelan] true if the user confirms; false otherwise
     def confirmInstallation
-      heading = ""
-      body = ""
-      confirm_button_label = ""
-
-      if !Mode.update
-        # Heading for confirmation popup before the installation really starts
-        heading = HTML.Heading(_("Confirm Installation"))
-
-        # Text for confirmation popup before the installation really starts 1/3
-        body = _(
-          "<p>Information required for the base installation is now 
complete.</p>"
-        )
-
-        # storage-ng
-        some_destructive = false
-=begin
-        some_destructive = Storage.GetCommitInfos.any? do |info|
-          Ops.get_boolean(info, :destructive, false)
-        end
-=end
-
-        if some_destructive
-          # Text for confirmation popup before the installation really starts 
2/3
-          body = Ops.add(
-            body,
-            _(
-              "<p>If you continue now, <b>existing\n" \
-                "partitions</b> on your hard disk will be <b>deleted</b> or 
<b>formatted</b>\n" \
-                "(<b>erasing any existing data</b> in those partitions) 
according to the\n" \
-                "installation settings in the previous dialogs.</p>"
-            )
-          )
-        else
-          # Text for confirmation popup before the installation really starts 
2/3
-          body = Ops.add(
-            body,
-            _(
-              "<p>If you continue now, partitions on your\n" \
-                "hard disk will be modified according to the installation 
settings in the\n" \
-                "previous dialogs.</p>"
-            )
-          )
-        end
-
-        # Text for confirmation popup before the installation really starts 3/3
-        body = Ops.add(
-          body,
-          _("<p>Go back and check the settings if you are unsure.</p>")
-        )
-
-        confirm_button_label = Label.InstallButton
-      else
-        # Heading for confirmation popup before the update really starts
-        heading = HTML.Heading(_("Confirm Update"))
-
-        body =
-          # Text for confirmation popup before the update really starts 1/3
-          _("<p>Information required to perform an update is now 
complete.</p>") +
-          # Text for confirmation popup before the update really starts 2/3
-          _(
-            "\n" \
-              "<p>If you continue now, data on your hard disk will be 
overwritten\n" \
-              "according to the settings in the previous dialogs.</p>"
-          ) +
-          # Text for confirmation popup before the update really starts 3/3
-          _("<p>Go back and check the settings if you are unsure.</p>")
-
-        # Label for the button that confirms startint the installation
-        confirm_button_label = _("Start &Update")
-      end
-
       display_info = UI.GetDisplayInfo
       size_x = Builtins.tointeger(Ops.get_integer(display_info, "Width", 800))
       size_y = Builtins.tointeger(Ops.get_integer(display_info, "Height", 600))
@@ -183,7 +89,7 @@
           HBox(
             HSpacing(0.7),
             VSpacing(size_y), # force height
-            RichText(heading + body),
+            RichText(Mode.update ? confirm_update_text : 
confirm_installation_text),
             HSpacing(0.7)
           ),
           ButtonBox(
@@ -203,6 +109,47 @@
       button == :ok
     end
 
+    # Text for confirmation popup before the installation really starts
+    #
+    # @return [String]
+    def confirm_installation_text
+      result = ""
+
+      result << HTML.Heading(_("Confirm Installation"))
+      result << _("<p>Information required for the base installation is now 
complete.</p>")
+      result << _(
+        "<p>If you continue now, partitions on your\n" \
+          "hard disk will be modified according to the installation settings 
in the\n" \
+          "previous dialogs.</p>"
+      )
+      result << _(
+        "<p>Go back and check the settings if you are unsure.</p>"
+      )
+    end
+
+    # Text for confirmation popup before the update really starts
+    #
+    # @return [String]
+    def confirm_update_text
+      result = ""
+
+      result << HTML.Heading(_("Confirm Update"))
+      result << _("<p>Information required to perform an update is now 
complete.</p>")
+      result << _(
+        "\n" \
+          "<p>If you continue now, data on your hard disk will be 
overwritten\n" \
+          "according to the settings in the previous dialogs.</p>"
+      )
+      result << _("<p>Go back and check the settings if you are unsure.</p>")
+    end
+
+    # Label for the confirmation button before starting the installation or 
update process
+    #
+    # @return [String]
+    def confirm_button_label
+      Mode.update ? _("Start &Update") : Label.InstallButton
+    end
+
     # Some client calls have to be called even if using AC
     def EnableRequiredModules
       # Lazy init
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.4.22/test/installation_misc_test.rb 
new/yast2-installation-4.4.23/test/installation_misc_test.rb
--- old/yast2-installation-4.4.22/test/installation_misc_test.rb        
2021-11-15 15:53:19.000000000 +0100
+++ new/yast2-installation-4.4.23/test/installation_misc_test.rb        
2021-11-25 16:50:42.000000000 +0100
@@ -1,13 +1,81 @@
 #! /usr/bin/env rspec
 
+# Copyright (c) [2015-2021] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
 require_relative "./test_helper"
 require_relative "../src/include/installation/misc"
 
-# a testing class for includign the "misc" include
-class InstallationMiscIncludeTest
-  include Yast::InstallationMiscInclude
+Yast.import "UI"
+Yast.import "Mode"
+
+# A dummy class for testing the "misc" include
+class InstallationMiscIncludeTest < Yast::Client
+  include Yast::I18n
+
+  def initialize
+    Yast.include self, "installation/misc.rb"
+  end
 end
 
 describe Yast::InstallationMiscInclude do
-  pending
+  subject { InstallationMiscIncludeTest.new }
+
+  RSpec.shared_examples "confirmation dialog" do
+    it "displays proper heading, text, and confirmation label" do
+      expect(Yast::UI).to receive(:OpenDialog) do |term|
+        content = term.nested_find { |e| e.is_a?(Yast::Term) && e.value == 
:RichText }
+
+        confirm_button = term.nested_find do |e|
+          e.is_a?(Yast::Term) && e.value == :PushButton && 
e.params.include?(confirm_label)
+        end
+
+        expect(content.params).to include(/#{heading}/)
+        expect(content.params).to include(/#{body_fragment}/)
+        expect(confirm_button).to_not be_nil
+      end
+
+      subject.confirmInstallation
+    end
+  end
+
+  describe "#confirmInstallation" do
+    before do
+      allow(Yast::Mode).to receive(:update).and_return(update_mode)
+    end
+
+    context "when performing an installation" do
+      let(:update_mode) { false }
+      let(:heading) { "<h3>Confirm Installation</h3>" }
+      let(:body_fragment) { "partitions on your\nhard disk will be modified" }
+      let(:confirm_label) { "&Install" }
+
+      include_examples "confirmation dialog"
+    end
+
+    context "when performing an update" do
+      let(:update_mode) { true }
+      let(:heading) { "<h3>Confirm Update</h3>" }
+      let(:body_fragment) { "data on your hard disk will be overwritten" }
+      let(:confirm_label) { "Start &Update" }
+
+      include_examples "confirmation dialog"
+    end
+  end
 end

Reply via email to