Hello community,

here is the log from the commit of package yast2-installation for 
openSUSE:Factory checked in at 2016-03-09 15:16:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-installation (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-installation.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-installation"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-installation/yast2-installation.changes    
2016-03-01 09:34:37.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-installation.new/yast2-installation.changes   
    2016-03-09 15:16:54.000000000 +0100
@@ -1,0 +2,6 @@
+Fri Mar  4 14:24:49 UTC 2016 - mvid...@suse.com
+
+- Added a System Role step in the installation (FATE#317481).
+- 3.1.172
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-installation.spec ++++++
--- /var/tmp/diff_new_pack.KP3lee/_old  2016-03-09 15:16:55.000000000 +0100
+++ /var/tmp/diff_new_pack.KP3lee/_new  2016-03-09 15:16:55.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-installation
-Version:        3.1.171
+Version:        3.1.172
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -40,9 +40,8 @@
 BuildRequires:  yast2-devtools >= 3.1.10
 BuildRequires:  rubygem(rspec)
 
-# Base clients for inst clients
-# Arch::is_zkvm
-BuildRequires:  yast2 >= 3.1.162
+# ProductFeatures.SetOverlay
+BuildRequires:  yast2 >= 3.1.177
 
 # Yast::Remote
 BuildRequires:  yast2-network
@@ -50,8 +49,8 @@
 # AutoinstSoftware.SavePackageSelection()
 Requires:       autoyast2-installation >= 3.1.105
 
-# Wizard.OpenLeftTitleNextBackDialog
-Requires:       yast2 >= 3.1.126
+# ProductFeatures.SetOverlay
+Requires:       yast2 >= 3.1.177
 
 # Language::GetLanguageItems and other API
 # Language::Set (handles downloading the translation extensions)

++++++ yast2-installation-3.1.171.tar.bz2 -> yast2-installation-3.1.172.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-installation-3.1.171/.rubocop.yml 
new/yast2-installation-3.1.172/.rubocop.yml
--- old/yast2-installation-3.1.171/.rubocop.yml 2016-02-29 13:49:28.000000000 
+0100
+++ new/yast2-installation-3.1.172/.rubocop.yml 2016-03-09 09:50:30.000000000 
+0100
@@ -33,12 +33,6 @@
 Metrics/PerceivedComplexity:
   Max: 63
 
-# Offense count: 6
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle, SupportedStyles.
-Style/AccessModifierIndentation:
-  Enabled: false
-
 # Offense count: 85
 Style/Documentation:
   Enabled: false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-installation-3.1.171/doc/control-file.md 
new/yast2-installation-3.1.172/doc/control-file.md
--- old/yast2-installation-3.1.171/doc/control-file.md  2016-02-29 
13:49:28.000000000 +0100
+++ new/yast2-installation-3.1.172/doc/control-file.md  2016-03-09 
09:50:30.000000000 +0100
@@ -842,6 +842,59 @@
 
     Text ID used for desktop selection label.
 
+### System Roles
+
+System Roles, if defined in the control file, are presented during
+the first stage of the installation. The user will select one of them
+and they will affect the proposed configuration of Partitioning and Software.
+
+They were requested in FATE#317481 and they are an evolution of the earlier
+concept of Server Scenarios used in SLE 11.
+
+Example:
+
+```xml
+<productDefines  xmlns="http://www.suse.com/1.0/yast2ns";
+    xmlns:config="http://www.suse.com/1.0/configns";>
+    <!-- ... -->
+    <system_roles config:type="list">
+      <system_role>
+        <id>plain</id>
+        <!-- nothing else here, no overrides -->
+      </system_role>
+
+      <system_role>
+        <id>virtualization_host_kvm</id>
+        <partitioning>
+          <proposal_lvm config:type="boolean">true</proposal_lvm>
+        </partitioning>
+        <software>
+          <default_patterns>base Minimal kvm_server</default_patterns>
+        </software>
+      </system_role>
+    </system_roles>
+
+    <texts>
+      <plain><label>General Server</label></plain>
+      <plain_description>
+        <label>Suitable for physical machines.</label>
+      </plain_description>
+      <virtualization_host_kvm>
+        <label>KVM Virtualization Host</label>
+      </virtualization_host_kvm>
+      <virtualization_host_kvm_description>
+        <label>Will install the appropriate packages.
+Will use LVM disk layout.</label>
+      </virtualization_host_kvm_description>
+    </texts>
+</productDefines>
+```
+
+Each role has a short label and a few lines of description in the *texts*
+section, identified by a matching *id* element. The contents of *partitioning*
+and *software* are merged with the corresponding top-level definitions. See
+[Partitioning](#partitioning) and [Software](#software).
+
 ### System Scenarios
 
 System scenarios contain definition of dialog *inst\_scenarios* in the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.171/doc/installation_overview.md 
new/yast2-installation-3.1.172/doc/installation_overview.md
--- old/yast2-installation-3.1.171/doc/installation_overview.md 2016-02-29 
13:49:28.000000000 +0100
+++ new/yast2-installation-3.1.172/doc/installation_overview.md 2016-03-09 
09:50:30.000000000 +0100
@@ -183,5 +183,5 @@
 in `/y2update/control.xml`, `/control.xml` and `/etc/YaST2/control.xml` and 
each SUSE product will
 have their own file.
 
-Quite nice [documentation](doc/control-file.md) lives in this repository about
+Quite nice [documentation](control-file.md) lives in this repository about
 the content of these files.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.171/package/yast2-installation.changes 
new/yast2-installation-3.1.172/package/yast2-installation.changes
--- old/yast2-installation-3.1.171/package/yast2-installation.changes   
2016-02-29 13:49:28.000000000 +0100
+++ new/yast2-installation-3.1.172/package/yast2-installation.changes   
2016-03-09 09:50:30.000000000 +0100
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Fri Mar  4 14:24:49 UTC 2016 - mvid...@suse.com
+
+- Added a System Role step in the installation (FATE#317481).
+- 3.1.172
+
+-------------------------------------------------------------------
 Mon Feb 29 09:05:16 UTC 2016 - mfi...@suse.com
 
 - bsc#956473
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.171/package/yast2-installation.spec 
new/yast2-installation-3.1.172/package/yast2-installation.spec
--- old/yast2-installation-3.1.171/package/yast2-installation.spec      
2016-02-29 13:49:28.000000000 +0100
+++ new/yast2-installation-3.1.172/package/yast2-installation.spec      
2016-03-09 09:50:30.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-installation
-Version:        3.1.171
+Version:        3.1.172
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -37,9 +37,8 @@
 BuildRequires:  yast2-devtools >= 3.1.10
 BuildRequires:  rubygem(rspec)
 
-# Base clients for inst clients
-# Arch::is_zkvm
-BuildRequires: yast2 >= 3.1.162
+# ProductFeatures.SetOverlay
+BuildRequires: yast2 >= 3.1.177
 
 # Yast::Remote
 BuildRequires: yast2-network
@@ -47,8 +46,8 @@
 # AutoinstSoftware.SavePackageSelection()
 Requires:       autoyast2-installation >= 3.1.105
 
-# Wizard.OpenLeftTitleNextBackDialog
-Requires:      yast2 >= 3.1.126
+# ProductFeatures.SetOverlay
+Requires:       yast2 >= 3.1.177
 
 # Language::GetLanguageItems and other API
 # Language::Set (handles downloading the translation extensions)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-installation-3.1.171/src/Makefile.am 
new/yast2-installation-3.1.172/src/Makefile.am
--- old/yast2-installation-3.1.171/src/Makefile.am      2016-02-29 
13:49:28.000000000 +0100
+++ new/yast2-installation-3.1.172/src/Makefile.am      2016-03-09 
09:50:30.000000000 +0100
@@ -50,6 +50,7 @@
   clients/inst_save_hardware_status.rb \
   clients/inst_scenarios.rb \
   clients/inst_system_analysis.rb \
+  clients/inst_system_role.rb \
   clients/inst_upgrade_urls.rb \
   clients/inst_welcome.rb \
   clients/inst_worker_continue.rb \
@@ -111,6 +112,7 @@
   lib/installation/proposal_runner.rb \
   lib/installation/proposal_store.rb \
   lib/installation/remote_finish_client.rb \
+  lib/installation/select_system_role.rb \
   lib/installation/snapshots_finish.rb
 
 ylibclientdir = "${yast2dir}/lib/installation/clients"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.171/src/clients/inst_system_role.rb 
new/yast2-installation-3.1.172/src/clients/inst_system_role.rb
--- old/yast2-installation-3.1.171/src/clients/inst_system_role.rb      
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-installation-3.1.172/src/clients/inst_system_role.rb      
2016-03-09 09:50:30.000000000 +0100
@@ -0,0 +1,2 @@
+require "installation/select_system_role"
+Installation::SelectSystemRole.new.run
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.171/src/lib/installation/cio_ignore.rb 
new/yast2-installation-3.1.172/src/lib/installation/cio_ignore.rb
--- old/yast2-installation-3.1.171/src/lib/installation/cio_ignore.rb   
2016-02-29 13:49:28.000000000 +0100
+++ new/yast2-installation-3.1.172/src/lib/installation/cio_ignore.rb   
2016-03-09 09:50:31.000000000 +0100
@@ -26,7 +26,7 @@
       end
     end
 
-    private
+  private
 
     def kvm?
       File.exist?("/proc/sysinfo") &&
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.171/src/lib/installation/clients/inst_disk_for_image.rb
 
new/yast2-installation-3.1.172/src/lib/installation/clients/inst_disk_for_image.rb
--- 
old/yast2-installation-3.1.171/src/lib/installation/clients/inst_disk_for_image.rb
  2016-02-29 13:49:28.000000000 +0100
+++ 
new/yast2-installation-3.1.172/src/lib/installation/clients/inst_disk_for_image.rb
  2016-03-09 09:50:31.000000000 +0100
@@ -65,7 +65,7 @@
       ret
     end
 
-    private
+  private
 
     def disks_to_use
       target_map = Storage.GetTargetMap
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.171/src/lib/installation/clients/inst_upgrade_urls.rb
 
new/yast2-installation-3.1.172/src/lib/installation/clients/inst_upgrade_urls.rb
--- 
old/yast2-installation-3.1.171/src/lib/installation/clients/inst_upgrade_urls.rb
    2016-02-29 13:49:28.000000000 +0100
+++ 
new/yast2-installation-3.1.172/src/lib/installation/clients/inst_upgrade_urls.rb
    2016-03-09 09:50:31.000000000 +0100
@@ -1242,7 +1242,7 @@
       :next
     end
 
-    private
+  private
 
     # FIXME: share this code better
     def target_distribution
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.171/src/lib/installation/select_system_role.rb 
new/yast2-installation-3.1.172/src/lib/installation/select_system_role.rb
--- old/yast2-installation-3.1.171/src/lib/installation/select_system_role.rb   
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-installation-3.1.172/src/lib/installation/select_system_role.rb   
2016-03-09 09:50:31.000000000 +0100
@@ -0,0 +1,112 @@
+# Copyright (c) 2016 SUSE LLC.
+#  All Rights Reserved.
+
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of version 2 or 3 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 about this file by physical or electronic mail,
+#  you may find current contact information at www.suse.com
+
+require "yast"
+require "ui/installation_dialog"
+Yast.import "ProductControl"
+Yast.import "ProductFeatures"
+
+module Installation
+  class SelectSystemRole < ::UI::InstallationDialog
+    def initialize
+      super
+
+      textdomain "installation"
+    end
+
+    def run
+      if raw_roles.empty?
+        log.info "No roles defined, skipping their dialog"
+        return :auto            # skip forward or backward
+      end
+
+      super
+    end
+
+    def dialog_title
+      _("System Role")
+    end
+
+    def help_text
+      ""                    # no Help, besides the descriptions in dialog body
+    end
+
+    def dialog_content
+      ui_roles = role_attributes.each_with_object(VBox()) do |r, vbox|
+        vbox << Left(RadioButton(Id(r[:id]), r[:label]))
+        vbox << HBox(
+          HSpacing(4),
+          Left(Label(r[:description]))
+        )
+        vbox << VSpacing(2)
+      end
+
+      RadioButtonGroup(Id(:roles), ui_roles)
+    end
+
+    def create_dialog
+      clear_role
+      ok = super
+      Yast::UI.ChangeWidget(Id(:roles), :CurrentButton, 
role_attributes.first[:id])
+      ok
+    end
+
+    def next_handler
+      role_id = Yast::UI.QueryWidget(Id(:roles), :CurrentButton)
+      apply_role(role_id)
+
+      super
+    end
+
+  private
+
+    def clear_role
+      Yast::ProductFeatures.ClearOverlay
+    end
+
+    def apply_role(role_id)
+      log.info "Applying system role '#{role_id}'"
+      features = raw_roles.find { |r| r["id"] == role_id }
+      features = features.dup
+      features.delete("id")
+      Yast::ProductFeatures.SetOverlay(features)
+    end
+
+    # the contents is an overlay for ProductFeatures sections
+    # [
+    #  { "id" => "foo", "partitioning" => ... },
+    #  { "id" => "bar", "partitioning" => ... , "software" => ...},
+    # ]
+    # @return [Array<Hash{String => Object}>]
+    def raw_roles
+      Yast::ProductControl.productControl.fetch("system_roles", [])
+    end
+
+    def role_attributes
+      raw_roles.map do |r|
+        id = r["id"]
+
+        {
+          id:          id,
+          label:       Yast::ProductControl.GetTranslatedText(id),
+          description: Yast::ProductControl.GetTranslatedText(id + 
"_description")
+        }
+      end
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.171/src/lib/installation/snapshots_finish.rb 
new/yast2-installation-3.1.172/src/lib/installation/snapshots_finish.rb
--- old/yast2-installation-3.1.171/src/lib/installation/snapshots_finish.rb     
2016-02-29 13:49:28.000000000 +0100
+++ new/yast2-installation-3.1.172/src/lib/installation/snapshots_finish.rb     
2016-03-09 09:50:31.000000000 +0100
@@ -41,7 +41,7 @@
       _("Creating root filesystem snapshot...")
     end
 
-    private
+  private
 
     def create_post_snapshot
       pre_number = Yast2::FsSnapshotStore.load("update")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-installation-3.1.171/test/Makefile.am 
new/yast2-installation-3.1.172/test/Makefile.am
--- old/yast2-installation-3.1.171/test/Makefile.am     2016-02-29 
13:49:28.000000000 +0100
+++ new/yast2-installation-3.1.172/test/Makefile.am     2016-03-09 
09:50:31.000000000 +0100
@@ -8,6 +8,7 @@
   proposal_store_test.rb \
   proposal_runner_test.rb \
   remote_finish_test.rb \
+  select_system_role_test.rb \
   snapshots_finish_test.rb
 
 TEST_EXTENSIONS = .rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-installation-3.1.171/test/cio_ignore_test.rb 
new/yast2-installation-3.1.172/test/cio_ignore_test.rb
--- old/yast2-installation-3.1.171/test/cio_ignore_test.rb      2016-02-29 
13:49:28.000000000 +0100
+++ new/yast2-installation-3.1.172/test/cio_ignore_test.rb      2016-03-09 
09:50:31.000000000 +0100
@@ -6,7 +6,6 @@
 
 describe ::Installation::CIOIgnore do
   describe "enable/disable" do
-
     it "take AutoYaST cio_ignore setting" do
       allow(Yast::Mode).to receive(:autoinst).and_return(true)
       allow(Yast::AutoinstConfig).to receive(:cio_ignore).and_return(false)
@@ -21,7 +20,6 @@
       ::Installation::CIOIgnore.instance.reset
       expect(::Installation::CIOIgnore.instance.enabled).to eq(true)
     end
-
   end
 end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-3.1.171/test/select_system_role_test.rb 
new/yast2-installation-3.1.172/test/select_system_role_test.rb
--- old/yast2-installation-3.1.171/test/select_system_role_test.rb      
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-installation-3.1.172/test/select_system_role_test.rb      
2016-03-09 09:50:31.000000000 +0100
@@ -0,0 +1,69 @@
+#! /usr/bin/env rspec
+
+require_relative "./test_helper"
+
+require "installation/select_system_role"
+Yast.import "ProductControl"
+
+describe ::Installation::SelectSystemRole do
+  subject { Installation::SelectSystemRole.new }
+
+  before do
+    allow(Yast::ProductControl).to receive(:GetTranslatedText) do |s|
+      "Lorem Ipsum #{s}"
+    end
+
+    allow(Yast::UI).to receive(:ChangeWidget)
+  end
+
+  describe "#run" do
+    context "when no roles are defined" do
+      before do
+        allow(Yast::ProductControl).to receive(:productControl)
+          .and_return("system_roles" => [])
+      end
+
+      it "does not display dialog, and returns :auto" do
+        expect(Yast::Wizard).to_not receive(:SetContents)
+        expect(subject.run).to eq(:auto)
+      end
+    end
+
+    context "when some roles are defined" do
+      let(:control_file_roles) do
+        [
+          { "id" => "foo", "partitioning" => { "format" => true } },
+          { "id" => "bar", "software" => { "desktop" => "knome" } }
+        ]
+      end
+
+      before do
+        allow(Yast::ProductControl).to receive(:productControl)
+          .and_return("system_roles" => control_file_roles)
+      end
+
+      it "displays dialog, and sets ProductFeatures on Next" do
+        allow(Yast::Wizard).to receive(:SetContents)
+        allow(Yast::UI).to receive(:UserInput)
+          .and_return(:next)
+        allow(Yast::UI).to receive(:QueryWidget)
+          .with(Id(:roles), :CurrentButton).and_return("foo")
+
+        expect(Yast::ProductFeatures).to receive(:ClearOverlay)
+        expect(Yast::ProductFeatures).to receive(:SetOverlay) # .with
+
+        expect(subject.run).to eq(:next)
+      end
+
+      it "displays dialog, and leaves ProductFeatures on Back" do
+        allow(Yast::Wizard).to receive(:SetContents)
+        allow(Yast::UI).to receive(:UserInput)
+          .and_return(:back)
+        expect(Yast::ProductFeatures).to receive(:ClearOverlay)
+        expect(Yast::ProductFeatures).to_not receive(:SetOverlay)
+
+        expect(subject.run).to eq(:back)
+      end
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-installation-3.1.171/test/test_helper.rb 
new/yast2-installation-3.1.172/test/test_helper.rb
--- old/yast2-installation-3.1.171/test/test_helper.rb  2016-02-29 
13:49:28.000000000 +0100
+++ new/yast2-installation-3.1.172/test/test_helper.rb  2016-03-09 
09:50:31.000000000 +0100
@@ -3,6 +3,7 @@
 ENV["Y2DIR"] = y2dirs.unshift(srcdir).join(":")
 
 require "yast"
+require "yast/rspec"
 
 # fake AutoinstConfigClass class which is not supported by Ubuntu
 module Yast


Reply via email to