Hello community,

here is the log from the commit of package yast2-country for openSUSE:Factory 
checked in at 2014-09-18 07:12:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-country (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-country.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-country"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-country/yast2-country.changes      
2014-09-07 11:09:46.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-country.new/yast2-country.changes 
2014-09-18 07:12:29.000000000 +0200
@@ -1,0 +2,7 @@
+Fri Sep 12 11:07:44 UTC 2014 - [email protected]
+
+- Added support for inferring the missing keyboard layout from the
+  language in autoyast profile (bnc#891808).
+- 3.1.13
+
+-------------------------------------------------------------------

Old:
----
  yast2-country-3.1.12.tar.bz2

New:
----
  yast2-country-3.1.13.tar.bz2

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

Other differences:
------------------
++++++ yast2-country.spec ++++++
--- /var/tmp/diff_new_pack.I0Tc30/_old  2014-09-18 07:12:30.000000000 +0200
+++ /var/tmp/diff_new_pack.I0Tc30/_new  2014-09-18 07:12:30.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-country
-Version:        3.1.12
+Version:        3.1.13
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build



++++++ yast2-country-3.1.12.tar.bz2 -> yast2-country-3.1.13.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-country-3.1.12/keyboard/src/modules/Keyboard.rb 
new/yast2-country-3.1.13/keyboard/src/modules/Keyboard.rb
--- old/yast2-country-3.1.12/keyboard/src/modules/Keyboard.rb   2014-09-04 
14:10:09.000000000 +0200
+++ new/yast2-country-3.1.13/keyboard/src/modules/Keyboard.rb   2014-09-15 
17:04:10.000000000 +0200
@@ -1365,15 +1365,29 @@
     end
 
     # AutoYaST interface function: Get the Keyboard configuration from a map.
-    # @param [Hash] settings imported map
+    #
+    # @param settings [Hash] imported map with the content of either the
+    #       'keyboard' or the 'language' section
+    # @param syntax [:keyboard, :language] format of settings: if :language, 
the
+    #       data for Language.Import
     # @return success
-    def Import(settings)
+    def Import(settings, syntax = :keyboard)
       settings = deep_copy(settings)
       # Read was not called -> do the init
       Read() if @expert_on_entry == {}
 
-      Set(Ops.get_string(settings, "keymap", @current_kbd))
-      SetExpertValues(Ops.get_map(settings, "keyboard_values", {}))
+      keyboard = @current_kbd
+      expert_values = {}
+
+      case syntax
+      when :keyboard
+        keyboard = settings["keymap"] if settings["keymap"]
+        expert_values = settings["keyboard_values"] if 
settings["keyboard_values"]
+      when :language
+        keyboard = GetKeyboardForLanguage(settings["language"], keyboard)
+      end
+      Set(keyboard)
+      SetExpertValues(expert_values)
       true
     end
 
@@ -1453,7 +1467,7 @@
     publish :function => :SetKeyboardForLang, :type => "void (string)"
     publish :function => :SetKeyboardDefault, :type => "void ()"
     publish :function => :CheckKeyboardDuringUpdate, :type => "void (string)"
-    publish :function => :Import, :type => "boolean (map)"
+    publish :function => :Import, :type => "boolean (map, ...)"
     publish :function => :Export, :type => "map ()"
     publish :function => :Summary, :type => "string ()"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-country-3.1.12/keyboard/test/keyboard_test.rb 
new/yast2-country-3.1.13/keyboard/test/keyboard_test.rb
--- old/yast2-country-3.1.12/keyboard/test/keyboard_test.rb     2014-09-04 
14:10:09.000000000 +0200
+++ new/yast2-country-3.1.13/keyboard/test/keyboard_test.rb     2014-09-15 
17:04:11.000000000 +0200
@@ -194,5 +194,71 @@
         end
       end
     end
+
+    describe "Import" do
+      let(:mode) { "autoinstallation" }
+      let(:stage) { "initial" }
+      let(:chroot) { "installing" }
+      let(:discaps) { Keyboard.GetExpertValues["discaps"] }
+      let(:default) { "english-us" }
+      let(:default_expert_values) {
+        {"rate" => "", "delay" => "", "numlock" => "", "discaps" => false}
+      }
+
+      before do
+        # Let's ensure the initial state
+        Keyboard.SetExpertValues(default_expert_values)
+        allow(AsciiFile).to receive(:AppendLine).once.with(anything, 
["Keytable:", "us.map.gz"])
+        Keyboard.Set(default)
+      end
+
+      context "from a <keyboard> section" do
+        let(:map) { {"keymap" => "spanish", "keyboard_values" => {"discaps" => 
true}} }
+
+        it "sets the layout and the expert values" do
+          expect(Keyboard).to receive(:Set).with("spanish")
+          Keyboard.Import(map, :keyboard)
+          expect(discaps).to eq(true)
+        end
+
+        it "ignores everything if the language section was expected" do
+          expect(Keyboard).to receive(:Set).with(default)
+          Keyboard.Import(map, :language)
+          expect(discaps).to eq(false)
+        end
+      end
+
+      context "from a <language> section" do
+        let(:map) { {"language" => "es_ES"} }
+
+        it "sets the layout and leaves expert values untouched" do
+          expect(Keyboard).to receive(:Set).with("spanish")
+          Keyboard.Import(map, :language)
+          expect(discaps).to eq(false)
+        end
+
+        it "ignores everything if the keyboard section was expected" do
+          expect(Keyboard).to receive(:Set).with(default)
+          Keyboard.Import(map, :keyboard)
+          expect(discaps).to eq(false)
+        end
+      end
+
+      context "from a malformed input mixing <language> and <keyboard>" do
+        let(:map) { {"language" => "es_ES", "keyboard_values" => {"discaps" => 
true}} }
+
+        it "sets only the corresponding settings if a keyboard section was 
expected" do
+          expect(Keyboard).to receive(:Set).with(default)
+          Keyboard.Import(map, :keyboard)
+          expect(discaps).to eq(true)
+        end
+
+        it "sets only the corresponding settings if a language section was 
expected" do
+          expect(Keyboard).to receive(:Set).with("spanish")
+          Keyboard.Import(map, :language)
+          expect(discaps).to eq(false)
+        end
+      end
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-country-3.1.12/package/yast2-country.changes 
new/yast2-country-3.1.13/package/yast2-country.changes
--- old/yast2-country-3.1.12/package/yast2-country.changes      2014-09-04 
14:10:09.000000000 +0200
+++ new/yast2-country-3.1.13/package/yast2-country.changes      2014-09-15 
17:04:11.000000000 +0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Fri Sep 12 11:07:44 UTC 2014 - [email protected]
+
+- Added support for inferring the missing keyboard layout from the
+  language in autoyast profile (bnc#891808).
+- 3.1.13
+
+-------------------------------------------------------------------
 Wed Sep  3 16:13:30 UTC 2014 - [email protected]
 
 - Added udev rules to handle layout of keyboards hot-plugged
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-country-3.1.12/package/yast2-country.spec 
new/yast2-country-3.1.13/package/yast2-country.spec
--- old/yast2-country-3.1.12/package/yast2-country.spec 2014-09-04 
14:10:09.000000000 +0200
+++ new/yast2-country-3.1.13/package/yast2-country.spec 2014-09-15 
17:04:11.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-country
-Version:        3.1.12
+Version:        3.1.13
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to