Skip to content

Commit

Permalink
merged with SLES12-SP3
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Dec 13, 2017
2 parents 2d51678 + 138dc18 commit 8cef310
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
4 changes: 2 additions & 2 deletions keyboard/src/modules/Keyboard.rb
Expand Up @@ -837,7 +837,7 @@ def Modified
# Save the current data into a file to be read after a reboot.
#
def Save
if Mode.update
if Mode.update && !Mode.autoupgrade
kbd = Misc.SysconfigRead(path(".sysconfig.keyboard.YAST_KEYBOARD"), "")
if kbd.empty?
kmap = Misc.SysconfigRead(path(".etc.vconsole_conf.KEYMAP"), "")
Expand Down Expand Up @@ -1131,7 +1131,7 @@ def MakeProposal(force_reset, language_changed)
# Only follow the language if the user has never actively chosen
# a keyboard. The indicator for this is user_decision which is
# set from outside the module.
if @user_decision || Mode.update && !Stage.initial || Mode.autoinst ||
if @user_decision || Mode.update && !Stage.initial || Mode.auto ||
Mode.live_installation ||
ProductFeatures.GetStringFeature("globals", "keyboard") != ""
if language_changed
Expand Down
32 changes: 32 additions & 0 deletions keyboard/test/keyboard_test.rb
Expand Up @@ -16,6 +16,8 @@ module Yast
import "XVersion"
import "Report"
import "OSRelease"
import "Keyboard"
import "Mode"

::RSpec.configure do |c|
c.include SCRStub
Expand Down Expand Up @@ -121,6 +123,28 @@ module Yast
Keyboard.Save
end
end

context "during autoupgrade with german keyboard" do
let(:mode) { "autoupgrade" }
let(:stage) { "initial" }
let(:chroot) { "installing" }
let(:new_lang) { "german" }

it "writes the configuration" do
expect(SCR).to execute_bash(/loadkeys/)
expect(SCR).to execute_bash(/xkbctrl/)
expect(AsciiFile).to receive(:AppendLine).with(anything,
["Keytable:", "de-nodeadkeys.map.gz"])

Keyboard.Set("german")
Keyboard.Save

expect(written_value_for(".sysconfig.keyboard.YAST_KEYBOARD")).to eq("german,pc104")
expect(written_value_for(".sysconfig.keyboard")).to be_nil
expect(written_value_for(".etc.vconsole_conf.KEYMAP")).to eq("de-nodeadkeys")
expect(written_value_for(".etc.vconsole_conf")).to be_nil
end
end
end

describe "#Set" do
Expand Down Expand Up @@ -462,6 +486,14 @@ module Yast
end
end
end

context "AutoYaST upgrade mode" do
it "does not make a new proposal" do
expect(Mode).to receive(:autoupgrade).and_return true
expect(Keyboard).to_not receive(:Set)
Keyboard.MakeProposal(false, false)
end
end
end

describe "#Probe" do
Expand Down
7 changes: 7 additions & 0 deletions package/yast2-country.changes
@@ -1,3 +1,10 @@
----------------------------------------------------------------
Wed Dec 13 13:48:06 CET 2017 - schubi@suse.de

- AutoYaST upgrade fix: Writing keyboard settings defined in the
AutoYaST configuration file (bnc1070305).
- 4.0.13

-------------------------------------------------------------------
Tue Dec 12 10:04:09 UTC 2017 - jreidinger@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-country.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-country
Version: 4.0.12
Version: 4.0.13
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down

0 comments on commit 8cef310

Please sign in to comment.