Hello community, here is the log from the commit of package yast2-country for openSUSE:Factory checked in at 2014-08-14 14:57:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-04-26 17:01:47.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-country.new/yast2-country.changes 2014-08-14 14:57:36.000000000 +0200 @@ -1,0 +2,7 @@ +Mon Aug 11 12:36:47 UTC 2014 - [email protected] + +- Regenerate initrd after configuring keyboard (bnc#888804) +- Updated dependency on yast2 >= 3.1.94 (new messages) +- 3.1.10 + +------------------------------------------------------------------- Old: ---- yast2-country-3.1.9.tar.bz2 New: ---- yast2-country-3.1.10.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-country.spec ++++++ --- /var/tmp/diff_new_pack.KzpNLJ/_old 2014-08-14 14:57:37.000000000 +0200 +++ /var/tmp/diff_new_pack.KzpNLJ/_new 2014-08-14 14:57:37.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-country -Version: 3.1.9 +Version: 3.1.10 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -37,8 +37,8 @@ Requires: yast2-perl-bindings Requires: yast2-trans-stats # XVersion.ycp -# Wizard::SetDesktopTitleAndIcon -Requires: yast2 >= 2.21.22 +# Message.updating_configuration, Message.takes_a_while +Requires: yast2 >= 3.1.94 # Pkg::SetPackageLocale, Pkg::GetTextLocale Requires: yast2-pkg-bindings >= 2.15.3 # IconPath support for MultiSelectionBox ++++++ yast2-country-3.1.9.tar.bz2 -> yast2-country-3.1.10.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-3.1.9/keyboard/src/clients/keyboard.rb new/yast2-country-3.1.10/keyboard/src/clients/keyboard.rb --- old/yast2-country-3.1.9/keyboard/src/clients/keyboard.rb 2014-04-23 09:30:42.000000000 +0200 +++ new/yast2-country-3.1.10/keyboard/src/clients/keyboard.rb 2014-08-12 13:35:11.000000000 +0200 @@ -44,6 +44,7 @@ Yast.import "Confirm" Yast.import "Keyboard" Yast.import "Popup" + Yast.import "Message" Yast.import "Service" Yast.import "Stage" Yast.import "Wizard" @@ -122,8 +123,12 @@ # write keyboard settings def KeyboardWrite + if Keyboard.needs_new_initrd? + Popup.ShowFeedback(Message.updating_configuration, Message.takes_a_while) + end Keyboard.Save Service.Restart("kbd") + Popup.ClearFeedback if Keyboard.needs_new_initrd? true end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-3.1.9/keyboard/src/modules/Keyboard.rb new/yast2-country-3.1.10/keyboard/src/modules/Keyboard.rb --- old/yast2-country-3.1.9/keyboard/src/modules/Keyboard.rb 2014-04-23 09:30:42.000000000 +0200 +++ new/yast2-country-3.1.10/keyboard/src/modules/Keyboard.rb 2014-08-12 13:35:11.000000000 +0200 @@ -93,6 +93,8 @@ module Yast class KeyboardClass < Module + include Yast::Logger + def main Yast.import "UI" textdomain "country" @@ -101,6 +103,7 @@ Yast.import "AsciiFile" Yast.import "Directory" Yast.import "FileUtils" + Yast.import "Initrd" Yast.import "Label" Yast.import "Language" Yast.import "Linuxrc" @@ -858,7 +861,7 @@ # SCR.Write( path(".sysconfig.keyboard.YAST_KEYBOARD"), - Ops.add(Ops.add(@current_kbd, ","), @kb_model) + "#{@current_kbd},#{@kb_model}" ) SCR.Write( path(".sysconfig.keyboard.YAST_KEYBOARD.comment"), @@ -905,49 +908,26 @@ SCR.Read(path(".probe.keyboard.manual")) ) - list_size = Builtins.size(@keyboardprobelist) - - if Ops.greater_than(list_size, 0) - i = 0 + log.info "No probed keyboards. Not unconfiguring any keyboards" if @keyboardprobelist.empty? - while Ops.less_than(i, list_size) - current_keyboard = Ops.get_map(@keyboardprobelist, i, {}) - current_key = Ops.get_string(current_keyboard, "unique_key", "") - - if current_key != "" - # OK, there is a key to mark... - # - if current_key != @unique_key - # OK, this key is _not_ the key of the keyboard to be configured. - # If the user selected a keyboard from the database Keyboard::unique_key - # has been set to "" there which also applies here. - # ==> Mark with "no". - # - SCR.Write(path(".probe.status.configured"), current_key, :no) - Builtins.y2milestone( - "Marked keyboard <%1> as configured = no", - current_key - ) - - SCR.Write(path(".probe.status.needed"), current_key, :no) - Builtins.y2milestone( - "Marked keyboard <%1> as needed = no", - current_key - ) - else - Builtins.y2milestone( - "Skipping active key <%1> --> to be configured", - current_key - ) - end - end - - i = Ops.add(i, 1) # next keyboard + @keyboardprobelist.each do |keyboard| + key = keyboard["unique_key"] || "" + next if key.empty? + # OK, there is a key to mark... + # + if key != @unique_key + # OK, this key is _not_ the key of the keyboard to be configured. + # If the user selected a keyboard from the database Keyboard::unique_key + # has been set to "" there which also applies here. + # ==> Mark with "no". + # + SCR.Write(path(".probe.status.configured"), key, :no) + log.info "Marked keyboard <#{key}> as configured = no" + SCR.Write(path(".probe.status.needed"), key, :no) + log.info "Marked keyboard <#{key}> as needed = no" + else + log.info "Skipping active key <#{key}> --> to be configured" end - else - Builtins.y2milestone( - "No probed keyboards. Not unconfiguring any keyboards" - ) end # Only if the keyboard has been probed in this run the unique_key @@ -958,23 +938,33 @@ # if @unique_key != "" SCR.Write(path(".probe.status.configured"), @unique_key, :yes) - Builtins.y2milestone("Marked keyboard <%1> as configured", @unique_key) + log.info "Marked keyboard <#{@unique_key}> as configured" if !Linuxrc.serial_console SCR.Write(path(".probe.status.needed"), @unique_key, :yes) - Builtins.y2milestone("Marked keyboard <%1> as needed", @unique_key) + log.info "Marked keyboard <#{@unique_key}> as needed" end else - Builtins.y2milestone( - "NOT marking keyboard as configured (no unique_key)" - ) + log.info "NOT marking keyboard as configured (no unique_key)" end - Builtins.y2milestone("Saved data for keyboard: <%1>", @current_kbd) + log.info "Saved data for keyboard: <#{@current_kbd}>" + + # Let's force the generation right away if needed + regenerate_initrd if needs_new_initrd? nil end # Save() + # Checks if initrd must be regenerated + # + # According to bnc#888804, initrd must be regenerated in order for any + # configuration change to survive to reboots. That means a regeneration is + # needed unless we are installing or updating (in those situations it will + # be a initrd generation at some point in the future for sure). + def needs_new_initrd? + Mode.normal + end # Name() # Just return the keyboard name, without setting anything. @@ -1441,6 +1431,17 @@ publish :function => :Import, :type => "boolean (map)" publish :function => :Export, :type => "map ()" publish :function => :Summary, :type => "string ()" + + private + + # Enforces the generation of initrd + def regenerate_initrd + log.info "Regenerating initrd to make the change persistent" + # The three steps are necessary with the current Initrd API + Initrd.Read + Initrd.Update + Initrd.Write + end end Keyboard = KeyboardClass.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-3.1.9/keyboard/test/SCRStub.rb new/yast2-country-3.1.10/keyboard/test/SCRStub.rb --- old/yast2-country-3.1.9/keyboard/test/SCRStub.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-3.1.10/keyboard/test/SCRStub.rb 2014-08-12 13:35:11.000000000 +0200 @@ -0,0 +1,98 @@ +# Helpers for stubbing several agent operations. +# +# Must be included in the configure section of RSpec. +# +# @example usage +# RSpec.configure do |c| +# c.include SCRStub +# end +# +# describe "Keyboard" do +# it "uses loadkeys" do +# expect_to_execute(/loadkeys/) +# Keyboard.Set +# end +# end +# +module SCRStub + YAST2_PATH = Yast::Path.new(".target.yast2") + YCP_PATH = Yast::Path.new(".target.ycp") + SIZE_PATH = Yast::Path.new(".target.size") + BASH_PATH = Yast::Path.new(".target.bash") + + # Ensures that non-stubbed SCR calls still works as expected after including + # the module in the testsuite + # different methods of the module + def self.included(testsuite) + testsuite.before(:each) do + allow(Yast::SCR).to receive(:Read).and_call_original + allow(Yast::SCR).to receive(:Write).and_call_original + allow(Yast::SCR).to receive(:Execute).and_call_original + end + end + + # Encapsulates subsequent SCR calls into a chroot. + # + # Raises an exception if something goes wrong. + # + # @param [#to_s] directory to use as '/' for SCR calls + def set_root_path(directory) + check_version = false + @scr_handle = Yast::WFM.SCROpen("chroot=#{directory}:scr", check_version) + raise "Error creating the chrooted scr instance" if @scr_handle < 0 + Yast::WFM.SCRSetDefault(@scr_handle) + # Temporary workaround for bug bnc#891053 in yast2-core + # Stubs all calls to target.yast2 until the bug is fixed + allow(Yast::SCR).to receive(:Read).with(YAST2_PATH, anything) do |*args| + Yast::SCR.Read(YCP_PATH, File.join("/data", args[1])) + end + end + + # Resets the SCR calls to default behaviour, closing the SCR instance open by + # #set_root_path. + # + # Raises an exception if #set_root_path has not been called before (or if the + # corresponding instance has already been closed) + # + # @see #set_root_path + def reset_root_path + default_handle = Yast::WFM.SCRGetDefault + if default_handle != @scr_handle + raise "Error closing the chrooted scr instance, it's not the current default one" + end + @scr_handle = nil + Yast::WFM.SCRClose(default_handle) + end + + # Stub calls to .target.size (used to check for the presence of a file) + # + # @param file to 'simulate' + def stub_presence_of(file) + # Returning any value > 0 will suffice + allow(Yast::SCR).to receive(:Read).with(SIZE_PATH, file).and_return(256) + end + + # Defines an expectation about executing commands using SCR.Execute and + # .target.bash + # + # @return [MessageExpectation] an expectation (that can be further customized + # with usual RSpec methods) + def expect_to_execute(command) + expect(Yast::SCR).to(receive(:Execute).with(BASH_PATH, command)) + end + + # Stub all calls to SCR.Write storing the value for future comparison + def stub_scr_write + @written_values = {} + allow(Yast::SCR).to receive(:Write) do |*args| + @written_values[args[0].to_s] = args[1] + end + end + + # Value written by a stubbed call to SCR.Read + # + # @param key used in the call to SCR.Write + def written_value_for(key) + @written_values[key] + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-3.1.9/keyboard/test/data/installing/etc/sysconfig/keyboard new/yast2-country-3.1.10/keyboard/test/data/installing/etc/sysconfig/keyboard --- old/yast2-country-3.1.9/keyboard/test/data/installing/etc/sysconfig/keyboard 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-3.1.10/keyboard/test/data/installing/etc/sysconfig/keyboard 2014-08-12 13:35:11.000000000 +0200 @@ -0,0 +1,93 @@ +## Path: Hardware/Keyboard +## Description: Keyboard settings +## Type: string +## Default: "" +## ServiceRestart: kbd +# +# Keyboard settings for the text console +# +# Keyboard mapping +# (/usr/share/kbd/keymaps/) +# e.g. KEYTABLE="de-latin1-nodeadkeys", "us" or empty for US settings +# +KEYTABLE="" + +## Type: integer +## Default: +# +# Keyboard delay time in ms (250, 500, 750, 1000) +KBD_DELAY="" + +## Type: string(2.0,2.1,2.3,2.5,2.7,3.0,3.3,3.7,4.0,4.3,4.6,5.0,5.5,6.0,6.7,7.5,8.0,8.6,9.2,10.0,10.9,12.0,13.3,15.0,16.0,17.1,18.5,20.0,21.8,24.0,26.7,30.0) +## Default: +# +# Keyboard repeat rate (2.0 - 30.0) +KBD_RATE="" + +## Type: list(bios,yes,no) +## Default: bios +# +# NumLock on? ("yes" or "no" or empty or "bios" for BIOS setting) +KBD_NUMLOCK="bios" + +## Type: yesno +## Default: no +# +# ScrollLock on? ("yes" or "no") +KBD_SCRLOCK="no" + +## Type: yesno +## Default: no +# +# CapsLock on? ("yes" or "no") +KBD_CAPSLOCK="no" + +## Type: yesno +## Default: no +# +# Disable CAPS LOCK and make it a normal Shift key? +# (Ctrl Caps Lock will still toggle Caps Lock functionality) +# Note that you need to tweak the xkb maps or use xmodmap +# if you want to do the same under X-Windows. In ~/.Xmodmap: +# keycode 0x42 = Shift_L Shift_L +# +KBD_DISABLE_CAPS_LOCK="no" + +## Type: string +## Default: +# +# ttys for the above settings +# Example: "tty1 tty2" +# "" for tty's 1-6 +# +KBD_TTY="" + +# +# Compose tables to be loaded. +# Compose tables are good for producing characters, which can not +# be directly input from your keyboard, such as characters with +# accents, currency signs, ... +# Please read /usr/share/doc/packages/kbd/README.SuSE for an +# explanation. +# You may leave this variable empty (default compose table from kernel +# or KEYTABLE will be used then -- most keyboard maps don't have a +# compose table, though) +# More than one compose table can be given. For a selection of possible +# tables see /usr/share/kbd/keymaps/include/compose.* +# You can give more than one compose table, but only the last one will +# determine the compose combinations. +# The word "clear" has a special meaning: +# Your compose table will be cleared, before more compose symbols are +# added. +# The files compose.winkeys and shiftctrl may be used to map the +# <compose> key to the W*n menu key and Shift-Ctrl, respectively, +# on a PC keyboard. +# A typical setting for Latin1 users (with a PC keyboard) may be +# COMPOSETABLE="clear winkeys shiftctrl latin1.add" +# For latin2, this would be +# COMPOSETABLE="clear winkeys shiftctrl latin2" +# A typical setting for sb. with a character set, where a matching +# compose table is missing (but with a PC keyboard), would be +# COMPOSETABLE="winkeys shiftctrl" +# +COMPOSETABLE="clear winkeys shiftctrl latin1.add" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-3.1.9/keyboard/test/data/installing/etc/sysconfig/language new/yast2-country-3.1.10/keyboard/test/data/installing/etc/sysconfig/language --- old/yast2-country-3.1.9/keyboard/test/data/installing/etc/sysconfig/language 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-3.1.10/keyboard/test/data/installing/etc/sysconfig/language 2014-08-12 13:35:11.000000000 +0200 @@ -0,0 +1,104 @@ +## Path: System/Environment/Language +## Description: +## Type: string(POSIX,ca_ES.ISO-8859-1,ca_ES.UTF-8,cs_CZ.ISO-8859-2,cs_CZ.UTF-8,da_DE@euro,da_DK.ISO-8859-1,da_DK.UTF-8,de_DE@euro,de_DE.ISO-8859-1,de_DE.UTF-8,el_GR.ISO-8859-7,el_GR.UTF-8,en_GB.ISO-8859-1,en_GB.UTF-8,en_IE@euro,en_IE.ISO-8859-1,en_US.ISO-8859-1,es_ES@euro,es_ES.ISO-8859-1,es_ES.UTF-8,fr_FR@euro,fr_FR.ISO-8859-1,fr_FR.UTF-8,gl_ES@euro,gl_ES.ISO-8859-1,gl_ES.utf-8,hr_HR.ISO-8859-2,hu_HU.ISO-8859-2,hu_HU.UTF-8,it_IT@euro,it_IT.ISO-8859-1,it_IT.UTF-8,ja_JP.eucJP,ja_JP.UTF-8,lt_LT.ISO-8859-13,lt_LT.UTF-8,nl_NL@euro,nl_NL.ISO-8859-1,nl_NL.UTF-8,ru_RU.ISO-8859-5,ru_RU.KOI8-R,ru_RU.UTF-8,sk_SK.ISO-8859-2,sk_SK.UTF-8,tr_TR.ISO-8859-9,tr_TR.UTF-8,ko_KR.eucKR,ko_KR.UTF-8,zh_TW.Big5,zh_TW.UTF-8,zh_CN.GB2312,zh_CN.UTF-8) +## Default: "" +## Config: OpenOffice.org,groff,ispell,kde,kdm,profiles,susehelp,susewm,tetex,wdm +# +# +# Local users will get RC_LANG as their default language, i.e. the +# environment variable $LANG . $LANG is the default of all $LC_*-variables, +# as long as $LC_ALL is not set, which overrides all $LC_-variables. +# Root uses this variable only if ROOT_USES_LANG is set to "yes". +# +RC_LANG="" + +## Type: string +## Default: "" +# +# This variable will override all LC-variables!! +# Again, ROOT_USES_LANG must be set to "yes", if an effect on the superuser +# account is desired. +# +RC_LC_ALL="" + +## Type: string +## Default: "" +# +# This defines the locale in which messages of programs and +# libraries with i18n-support should appear if a translated +# message catalog for the library or the program is installed. +# This also provides localized yes/no answers. +# +RC_LC_MESSAGES="" + +## Type: string +## Default: "" +# +# This defines the locale for character handling and classification. +# The libc uses this value in language dependent function calls, such +# as e.g. uppercase/lowercase mapping of foreign characters. +# +RC_LC_CTYPE="" + +## Type: string +## Default: "" +# +# This defines the locale for sorting strings and characters. +# It is used by the libc to obtain the alphabetical order of characters +# (e.g. for string comparisons). +# +RC_LC_COLLATE="" + +## Type: string +## Default: "" +# +# This defines the locale for date and time output formats. +# i.e.: 06/09/1999 vs. 09.06.1999 +# +RC_LC_TIME="" + +## Type: string +## Default: "" +# +# This defines the locale for formatting and reading numbers. +# i.e.: 1,234.56 vs. 1.234,56 +# +RC_LC_NUMERIC="" + +## Type: string +## Default: "" +# +# This defines the locale for formatting and reading money values. +# +RC_LC_MONETARY="" + +## Type: string +## Default: "" +# +# This defines the locale for format of paper. +# +RC_LC_PAPER="" + +## Type: string(ctype) +## Default: ctype +# +# This defines if the user "root" should use the locale settings +# which are defined here. +# Value "ctype" means that root uses just LC_CTYPE. +# +ROOT_USES_LANG="ctype" + +## Type: yesno +## Default: no +# +# Workaround for missing forward of LANG and LC variables +# of e.g. ssh login connections. +# +AUTO_DETECT_UTF8="no" + +## Type: string +## Default: "" +# +# List of installed language supports, use by YaST2 +# +INSTALLED_LANGUAGES="" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-3.1.9/keyboard/test/data/installing/etc/yast.inf new/yast2-country-3.1.10/keyboard/test/data/installing/etc/yast.inf --- old/yast2-country-3.1.9/keyboard/test/data/installing/etc/yast.inf 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-3.1.10/keyboard/test/data/installing/etc/yast.inf 2014-08-12 13:35:11.000000000 +0200 @@ -0,0 +1 @@ +Language: en_US diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-3.1.9/keyboard/test/data/spanish/etc/sysconfig/console new/yast2-country-3.1.10/keyboard/test/data/spanish/etc/sysconfig/console --- old/yast2-country-3.1.9/keyboard/test/data/spanish/etc/sysconfig/console 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-3.1.10/keyboard/test/data/spanish/etc/sysconfig/console 2014-08-12 13:35:11.000000000 +0200 @@ -0,0 +1,91 @@ +## Path: Hardware/Console +## Description: Text console settings (see also Hardware/Keyboard) +## Type: string +## Default: "" +## ServiceRestart: kbd +# +# Console settings. +# Note: The KBD_TTY setting from Hardware/Keyboard (sysconfig/keyboard) +# also applies for the settings here. +# +# Load this console font on bootup: +# (/usr/share/kbd/consolefonts/) +# +CONSOLE_FONT="lat9w-16.psfu" + +## Type: string +## Default: "" +# +# Some fonts come without a unicode map. +# (.psfu fonts supposedly have it, others often not.) +# You can then specify the unicode mapping of your font +# explicitly. (/usr/share/kbd/unimaps/) +# Normally not needed. +# +CONSOLE_UNICODEMAP="" + +## Type: string +## Default: "" +# +# Most programs output 8 bit characters, so you need a table to +# translate those characters into unicode. That one can be specified +# here. (/usr/share/kbd/consoletrans/) +# (Note: If your console is in utf-8 mode you don't need this.) +# If your code does not use a unicode mapping at all (because you +# e.g. explicitly specified UNICODEMAP="none") you may circumvent +# the translation via unicode, but load a map which directly maps +# 8 bit output of your program to a font position. +# +CONSOLE_SCREENMAP="trivial" + +## Type: string +## Default: "" +# +# for some fonts the console has to be initialized with CONSOLE_MAGIC. +# CONSOLE_MAGIC can be empty or have the values "(B", ")B", "(K" or ")K". +# Normally not needed (automatically handled by setfont). +# +CONSOLE_MAGIC="(K" +## Path: System/Console/Framebuffer +## Description: Framebuffer configuration +## Type: string +## Default: "" +# +# You may want to load a framebuffer display driver into your kernel +# in order to be able to change graphics modes etc. with fbset in +# console mode. +# +# Notes: Most people won't enter anything here, as: +# * it won't work if you have vesafb already active +# * its advantageous to have fb support compiled into your kernel +# * Some XFree86 drivers (especially in XFree86-4.x) don't work +# too well, if you enable framebuffer text mode. +# +# Example: +# FB_MODULES="matroxfb_base vesa=0x182 fv=85 matroxfb_maven matroxfb_crtc2" +# +FB_MODULES="" + +## Type: string +## Default: "" +# +# In case your kernel has framebuffer support (or you loaded the framebuffer +# support into your kernel as a module above), you may want to change the +# resolution or other parameters. This is done by secifying the parameters +# to fbset. Use a mode from /etc/fb-modes and additional parameters as +# -a, -depth <BPP>, -vyres <VYRES>, ... (See fbset manpage and/or fbset -h). +# +# Notes: +# * vesafb does not (currently) support changing the display mode +# * BEWARE! Don't set modes your monitor can't do. Watch out for the maximum +# horizontal frequency. Old monitors might even be damaged if you exceed +# their capabilities. +# +# Example: +# FBSET_PARAMS="-a -depth 16 768x576-90 -vyres 10240" +# +FBSET_PARAMS="" + +# Encoding used for output of non-ascii characters. +# +CONSOLE_ENCODING="UTF-8" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-3.1.9/keyboard/test/data/spanish/etc/sysconfig/keyboard new/yast2-country-3.1.10/keyboard/test/data/spanish/etc/sysconfig/keyboard --- old/yast2-country-3.1.9/keyboard/test/data/spanish/etc/sysconfig/keyboard 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-3.1.10/keyboard/test/data/spanish/etc/sysconfig/keyboard 2014-08-12 13:35:11.000000000 +0200 @@ -0,0 +1,97 @@ +## Path: Hardware/Keyboard +## Description: Keyboard settings +## Type: string +## Default: "" +## ServiceRestart: kbd +# +# Keyboard settings for the text console +# +# Keyboard mapping +# (/usr/share/kbd/keymaps/) +# e.g. KEYTABLE="de-latin1-nodeadkeys", "us" or empty for US settings +# +KEYTABLE="es.map.gz" + +## Type: integer +## Default: +# +# Keyboard delay time in ms (250, 500, 750, 1000) +KBD_DELAY="" + +## Type: string(2.0,2.1,2.3,2.5,2.7,3.0,3.3,3.7,4.0,4.3,4.6,5.0,5.5,6.0,6.7,7.5,8.0,8.6,9.2,10.0,10.9,12.0,13.3,15.0,16.0,17.1,18.5,20.0,21.8,24.0,26.7,30.0) +## Default: +# +# Keyboard repeat rate (2.0 - 30.0) +KBD_RATE="" + +## Type: list(bios,yes,no) +## Default: bios +# +# NumLock on? ("yes" or "no" or empty or "bios" for BIOS setting) +KBD_NUMLOCK="bios" + +## Type: yesno +## Default: no +# +# ScrollLock on? ("yes" or "no") +KBD_SCRLOCK="no" + +## Type: yesno +## Default: no +# +# CapsLock on? ("yes" or "no") +KBD_CAPSLOCK="no" + +## Type: yesno +## Default: no +# +# Disable CAPS LOCK and make it a normal Shift key? +# (Ctrl Caps Lock will still toggle Caps Lock functionality) +# Note that you need to tweak the xkb maps or use xmodmap +# if you want to do the same under X-Windows. In ~/.Xmodmap: +# keycode 0x42 = Shift_L Shift_L +# +KBD_DISABLE_CAPS_LOCK="no" + +## Type: string +## Default: +# +# ttys for the above settings +# Example: "tty1 tty2" +# "" for tty's 1-6 +# +KBD_TTY="" + +# +# Compose tables to be loaded. +# Compose tables are good for producing characters, which can not +# be directly input from your keyboard, such as characters with +# accents, currency signs, ... +# Please read /usr/share/doc/packages/kbd/README.SuSE for an +# explanation. +# You may leave this variable empty (default compose table from kernel +# or KEYTABLE will be used then -- most keyboard maps don't have a +# compose table, though) +# More than one compose table can be given. For a selection of possible +# tables see /usr/share/kbd/keymaps/include/compose.* +# You can give more than one compose table, but only the last one will +# determine the compose combinations. +# The word "clear" has a special meaning: +# Your compose table will be cleared, before more compose symbols are +# added. +# The files compose.winkeys and shiftctrl may be used to map the +# <compose> key to the W*n menu key and Shift-Ctrl, respectively, +# on a PC keyboard. +# A typical setting for Latin1 users (with a PC keyboard) may be +# COMPOSETABLE="clear winkeys shiftctrl latin1.add" +# For latin2, this would be +# COMPOSETABLE="clear winkeys shiftctrl latin2" +# A typical setting for sb. with a character set, where a matching +# compose table is missing (but with a PC keyboard), would be +# COMPOSETABLE="winkeys shiftctrl" +# +COMPOSETABLE="clear latin1.add" + +# The YaST-internal identifier of the attached keyboard. +# +YAST_KEYBOARD="spanish,pc104" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-3.1.9/keyboard/test/data/spanish/etc/sysconfig/language new/yast2-country-3.1.10/keyboard/test/data/spanish/etc/sysconfig/language --- old/yast2-country-3.1.9/keyboard/test/data/spanish/etc/sysconfig/language 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-3.1.10/keyboard/test/data/spanish/etc/sysconfig/language 2014-08-12 13:35:11.000000000 +0200 @@ -0,0 +1,120 @@ + +## Path: System/Environment/Language +## Type: string(ibus,fcitx,gcin,scim,scim-bridge,uim,kinput2,kinput2-canna,kinput2-wnn,nabi,wnn,atokx,xcin,none) +## Default: "" +# +# A default input method to be used in X11 can be selected here. +# If this variable is set and a script with the same name +# as the value of this variable exists in the directory /etc/X11/xim.d/ +# this script is sourced when X11 is started to start an input method. +# +# The special value "none" (/etc/X11/xim.d/none) means: +# Do not use any input method at all. +# +# For more details see the comments at the top of /etc/X11/xim. +# +INPUT_METHOD="" +## Path: System/Environment/Language +## Description: +## Type: string(POSIX,ca_ES.ISO-8859-1,ca_ES.UTF-8,cs_CZ.ISO-8859-2,cs_CZ.UTF-8,da_DE@euro,da_DK.ISO-8859-1,da_DK.UTF-8,de_DE@euro,de_DE.ISO-8859-1,de_DE.UTF-8,el_GR.ISO-8859-7,el_GR.UTF-8,en_GB.ISO-8859-1,en_GB.UTF-8,en_IE@euro,en_IE.ISO-8859-1,en_US.ISO-8859-1,es_ES@euro,es_ES.ISO-8859-1,es_ES.UTF-8,fr_FR@euro,fr_FR.ISO-8859-1,fr_FR.UTF-8,gl_ES@euro,gl_ES.ISO-8859-1,gl_ES.utf-8,hr_HR.ISO-8859-2,hu_HU.ISO-8859-2,hu_HU.UTF-8,it_IT@euro,it_IT.ISO-8859-1,it_IT.UTF-8,ja_JP.eucJP,ja_JP.UTF-8,lt_LT.ISO-8859-13,lt_LT.UTF-8,nl_NL@euro,nl_NL.ISO-8859-1,nl_NL.UTF-8,ru_RU.ISO-8859-5,ru_RU.KOI8-R,ru_RU.UTF-8,sk_SK.ISO-8859-2,sk_SK.UTF-8,tr_TR.ISO-8859-9,tr_TR.UTF-8,ko_KR.eucKR,ko_KR.UTF-8,zh_TW.Big5,zh_TW.UTF-8,zh_CN.GB2312,zh_CN.UTF-8) +## Default: "" +## Config: OpenOffice.org,groff,ispell,kde,kdm,profiles,susehelp,susewm,tetex,wdm +# +# +# Local users will get RC_LANG as their default language, i.e. the +# environment variable $LANG . $LANG is the default of all $LC_*-variables, +# as long as $LC_ALL is not set, which overrides all $LC_-variables. +# Root uses this variable only if ROOT_USES_LANG is set to "yes". +# +RC_LANG="en_US.UTF-8" + +## Type: string +## Default: "" +# +# This variable will override all LC-variables!! +# Again, ROOT_USES_LANG must be set to "yes", if an effect on the superuser +# account is desired. +# +RC_LC_ALL="" + +## Type: string +## Default: "" +# +# This defines the locale in which messages of programs and +# libraries with i18n-support should appear if a translated +# message catalog for the library or the program is installed. +# This also provides localized yes/no answers. +# +RC_LC_MESSAGES="" + +## Type: string +## Default: "" +# +# This defines the locale for character handling and classification. +# The libc uses this value in language dependent function calls, such +# as e.g. uppercase/lowercase mapping of foreign characters. +# +RC_LC_CTYPE="" + +## Type: string +## Default: "" +# +# This defines the locale for sorting strings and characters. +# It is used by the libc to obtain the alphabetical order of characters +# (e.g. for string comparisons). +# +RC_LC_COLLATE="" + +## Type: string +## Default: "" +# +# This defines the locale for date and time output formats. +# i.e.: 06/09/1999 vs. 09.06.1999 +# +RC_LC_TIME="" + +## Type: string +## Default: "" +# +# This defines the locale for formatting and reading numbers. +# i.e.: 1,234.56 vs. 1.234,56 +# +RC_LC_NUMERIC="" + +## Type: string +## Default: "" +# +# This defines the locale for formatting and reading money values. +# +RC_LC_MONETARY="" + +## Type: string +## Default: "" +# +# This defines the locale for format of paper. +# +RC_LC_PAPER="" + +## Type: string(ctype) +## Default: ctype +# +# This defines if the user "root" should use the locale settings +# which are defined here. +# Value "ctype" means that root uses just LC_CTYPE. +# +ROOT_USES_LANG="ctype" + +## Type: yesno +## Default: no +# +# Workaround for missing forward of LANG and LC variables +# of e.g. ssh login connections. +# +AUTO_DETECT_UTF8="no" + +## Type: string +## Default: "" +# +# List of installed language supports, use by YaST2 +# +INSTALLED_LANGUAGES="" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-3.1.9/keyboard/test/keyboard_test.rb new/yast2-country-3.1.10/keyboard/test/keyboard_test.rb --- old/yast2-country-3.1.9/keyboard/test/keyboard_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-3.1.10/keyboard/test/keyboard_test.rb 2014-08-12 13:35:11.000000000 +0200 @@ -0,0 +1,124 @@ +#!/usr/bin/env rspec + +require_relative 'test_helper' +require_relative 'SCRStub' + +module Yast + import "Stage" + import "Mode" + import "Linuxrc" + import "Path" + import "Encoding" + + RSpec.configure do |c| + c.include SCRStub + end + + describe "Keyboard" do + before(:each) do + allow(Stage).to receive(:stage).and_return stage + allow(Mode).to receive(:mode).and_return mode + allow(Linuxrc).to receive(:text).and_return false + + init_root_path(chroot) + end + + after(:each) do + cleanup_root_path(chroot) + end + + describe "#Save" do + before(:each) do + stub_scr_write + end + + context "during installation" do + let(:mode) { "installation" } + let(:stage) { "initial" } + let(:chroot) { "installing" } + + it "writes the configuration" do + Keyboard.Save + + expect(written_value_for(".sysconfig.keyboard.YAST_KEYBOARD")).to eq("english-us,pc104") + expect(written_value_for(".sysconfig.keyboard")).to be_nil + expect(written_value_for(".etc.vconsole_conf.KEYMAP")).to eq("us") + expect(written_value_for(".etc.vconsole_conf")).to be_nil + end + + it "doesn't regenerate initrd" do + stub_scr_write + + expect(Initrd).to_not receive(:Read) + expect(Initrd).to_not receive(:Update) + expect(Initrd).to_not receive(:Write) + + Keyboard.Save + end + end + + context "in an installed system" do + let(:mode) { "normal" } + let(:stage) { "normal" } + let(:chroot) { "spanish" } + + it "writes the configuration" do + expect_to_execute(/loadkeys ruwin_alt-UTF-8\.map\.gz/) + + Keyboard.Set("russian") + Keyboard.Save + + expect(written_value_for(".sysconfig.keyboard.YAST_KEYBOARD")).to eq("russian,pc104") + expect(written_value_for(".sysconfig.keyboard")).to be_nil + expect(written_value_for(".etc.vconsole_conf.KEYMAP")).to eq("ruwin_alt-UTF-8") + expect(written_value_for(".etc.vconsole_conf")).to be_nil + end + + it "does regenerate initrd" do + expect(Initrd).to receive(:Read) + expect(Initrd).to receive(:Update) + expect(Initrd).to receive(:Write) + + Keyboard.Save + end + end + end + + describe "#Set" do + let(:mode) { "normal" } + let(:stage) { "normal" } + let(:chroot) { "spanish" } + + it "correctly sets all layout variables" do + expect_to_execute(/loadkeys ruwin_alt-UTF-8\.map\.gz/) + + Keyboard.Set("russian") + expect(Keyboard.current_kbd).to eq("russian") + expect(Keyboard.kb_model).to eq("pc104") + expect(Keyboard.keymap).to eq("ruwin_alt-UTF-8.map.gz") + end + + it "calls setxkbmap if graphical system is installed" do + stub_presence_of "/usr/sbin/xkbctrl" + allow(XVersion).to receive(:binPath).and_return "/usr/bin" + + expect_to_execute(/loadkeys trq\.map\.gz/) + # Called twice, for SetConsole and SetX11 + expect_to_execute(/xkbctrl trq\.map\.gz/).twice do |p, cmd| + dump_xkbctrl(:turkish, cmd.split("> ")[1]) + end + expect_to_execute(/setxkbmap .*layout tr/) + + Keyboard.Set("turkish") + end + + it "does not call setxkbmap if graphical system is not installed" do + expect_to_execute(/loadkeys ruwin_alt-UTF-8\.map\.gz/) + expect_to_execute(/xkbctrl ruwin_alt-UTF-8.map.gz/).never + expect_to_execute(/setxkbmap/).never + + Keyboard.Set("russian") + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-3.1.9/keyboard/test/test_helper.rb new/yast2-country-3.1.10/keyboard/test/test_helper.rb --- old/yast2-country-3.1.9/keyboard/test/test_helper.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-3.1.10/keyboard/test/test_helper.rb 2014-08-12 13:35:11.000000000 +0200 @@ -0,0 +1,73 @@ +require 'rspec' +SRC_PATH = File.expand_path("../../src", __FILE__) +DATA_PATH = File.join(File.expand_path(File.dirname(__FILE__)), "data") +ENV["Y2DIR"] = SRC_PATH +require "yast" + +# Used to Emulate the behaviour of +# /usr/sbin/xkbctrl xx.map.gz > /tmp/yy/xkbctrl.out +# without relying on xkbctrl being present in the machine running the test +def dump_xkbctrl(lang, file) + case lang.to_s + when 'turkish' + content = <<END +$[ + "XkbLayout" : "tr", + "XkbModel" : "microsoftpro", + "XkbOptions" : "caps:shift", + "Apply" : "-layout tr -option caps:shift -model microsoftpro" +] +END + when 'spanish' + content = <<END +$[ + "XkbLayout" : "es", + "XkbModel" : "microsoftpro", + "Apply" : "-model microsoftpro -layout es" +] +END + when 'russian' + content = <<END +$[ + "XkbVariant" : ",winkeys", + "XkbLayout" : "us,ru", + "XkbModel" : "microsoftpro", + "XkbOptions" : "grp:ctrl_shift_toggle,grp_led:scroll", + "Apply" : "-variant ,winkeys -model microsoftpro -option grp:ctrl_shift_toggle,grp_led:scroll -layout us,ru" +] +END + end + Yast::SCR.Execute(Yast::Path.new(".target.mkdir"), File.dirname(file)) + Yast::SCR.Write(Yast::Path.new(".target.string"), file, content) +end + +# Closes the SCR instance open by set_root_path and cleans the chroot +def cleanup_root_path(directory) + reset_root_path + FileUtils.rmtree(File.join(DATA_PATH, directory, "tmp")) + FileUtils.rmtree(File.join(DATA_PATH, directory, "data")) +end + +# Sets and prepares the chroot for the whole testsuite and imports the +# keyboard module afterwards +def init_root_path(directory) + # Copy data files into the chroot + FileUtils.cp_r(File.join(SRC_PATH, "data"), File.join(DATA_PATH, directory)) + # chroot SCR + root = File.join(DATA_PATH, directory) + set_root_path(root) + # In its current implementation import cannot be safelly loaded + # without the previous mocking and chrooting + import_keyboard +end + +# Secure implementation of Yast.import "Keyboard" +# +# In most situations, Yast.import "Keyboard" will call Keyboard:Restore(), +# which calls xkbctrl and Encoding.Restore, so we need to catch both +def import_keyboard + allow(Yast::SCR).to receive(:Execute).with(SCRStub::BASH_PATH, /xkbctrl es\.map\.gz/) + # Just to prevent a not relevant call to 'locale -k" + allow(Yast::Encoding).to receive(:Restore) + Yast.import "Keyboard" +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-3.1.9/package/yast2-country.changes new/yast2-country-3.1.10/package/yast2-country.changes --- old/yast2-country-3.1.9/package/yast2-country.changes 2014-04-23 09:30:42.000000000 +0200 +++ new/yast2-country-3.1.10/package/yast2-country.changes 2014-08-12 13:35:11.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Aug 11 12:36:47 UTC 2014 - [email protected] + +- Regenerate initrd after configuring keyboard (bnc#888804) +- Updated dependency on yast2 >= 3.1.94 (new messages) +- 3.1.10 + +------------------------------------------------------------------- Wed Apr 23 08:59:09 CEST 2014 - [email protected] - do not try to save settings when user did not change them diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-3.1.9/package/yast2-country.spec new/yast2-country-3.1.10/package/yast2-country.spec --- old/yast2-country-3.1.9/package/yast2-country.spec 2014-04-23 09:30:42.000000000 +0200 +++ new/yast2-country-3.1.10/package/yast2-country.spec 2014-08-12 13:35:11.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-country -Version: 3.1.9 +Version: 3.1.10 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -33,8 +33,8 @@ BuildRequires: polkit-devel Requires: yast2-trans-stats yast2-perl-bindings timezone # XVersion.ycp -# Wizard::SetDesktopTitleAndIcon -Requires: yast2 >= 2.21.22 +# Message.updating_configuration, Message.takes_a_while +Requires: yast2 >= 3.1.94 # Pkg::SetPackageLocale, Pkg::GetTextLocale Requires: yast2-pkg-bindings >= 2.15.3 # IconPath support for MultiSelectionBox -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
