Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2-country for openSUSE:Factory checked in at 2022-01-25 17:35:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-country (Old) and /work/SRC/openSUSE:Factory/.yast2-country.new.1938 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-country" Tue Jan 25 17:35:47 2022 rev:228 rq:947722 version:4.4.8 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-country/yast2-country.changes 2021-10-25 15:17:50.069690679 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-country.new.1938/yast2-country.changes 2022-01-25 17:36:38.714096680 +0100 @@ -1,0 +2,9 @@ +Wed Jan 19 09:27:28 UTC 2022 - Martin Vidner <mvid...@suse.com> + +- Switch console keyboard layouts to match the X11 ones + (xkb, from xkeyboard-config.rpm), to prepare for + kbd-legacy.rpm going away (jsc#SLE-21107). +- Add programmer Dvorak keyboard layout. +- 4.4.8 + +------------------------------------------------------------------- Old: ---- yast2-country-4.4.7.tar.bz2 New: ---- yast2-country-4.4.8.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-country.spec ++++++ --- /var/tmp/diff_new_pack.dQ1zaq/_old 2022-01-25 17:36:39.186093430 +0100 +++ /var/tmp/diff_new_pack.dQ1zaq/_new 2022-01-25 17:36:39.190093402 +0100 @@ -1,7 +1,7 @@ # # spec file for package yast2-country # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: yast2-country -Version: 4.4.7 +Version: 4.4.8 Release: 0 Summary: YaST2 - Country Settings (Language, Keyboard, and Timezone) License: GPL-2.0-only ++++++ yast2-country-4.4.7.tar.bz2 -> yast2-country-4.4.8.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.4.7/.github/workflows/ci.yml new/yast2-country-4.4.8/.github/workflows/ci.yml --- old/yast2-country-4.4.7/.github/workflows/ci.yml 2021-10-21 12:09:06.000000000 +0200 +++ new/yast2-country-4.4.8/.github/workflows/ci.yml 2022-01-20 17:09:30.000000000 +0100 @@ -8,9 +8,14 @@ jobs: Tests: runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + distro: [ "tumbleweed", "leap_latest" ] + container: - image: registry.opensuse.org/yast/head/containers/yast-ruby:latest - options: --privileged + image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby steps: @@ -29,6 +34,8 @@ # send the coverage report to coveralls.io - name: Coveralls Report + # send it only from the TW build to avoid duplicate submits + if: ${{ matrix.distro == 'tumbleweed' }} uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} @@ -48,9 +55,14 @@ Package: runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + distro: [ "tumbleweed", "leap_latest" ] + container: - image: registry.opensuse.org/yast/head/containers/yast-ruby:latest - options: --privileged + image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby steps: @@ -62,9 +74,14 @@ Yardoc: runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + distro: [ "leap_latest" ] + container: - image: registry.opensuse.org/yast/head/containers/yast-ruby:latest - options: --privileged + image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby steps: @@ -79,9 +96,14 @@ # checks into one job avoids that overhead Checks: runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + distro: [ "leap_latest" ] + container: - image: registry.opensuse.org/yast/head/containers/yast-ruby:latest - options: --privileged + image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby steps: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.4.7/dropping_kbd_legacy.md new/yast2-country-4.4.8/dropping_kbd_legacy.md --- old/yast2-country-4.4.7/dropping_kbd_legacy.md 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-country-4.4.8/dropping_kbd_legacy.md 2022-01-20 17:09:30.000000000 +0100 @@ -0,0 +1,84 @@ +Dropping kbd-legacy.rpm +======================= + + +kbd.rpm is a package including keyboard maps for the text console (not the +graphical envirnoment like X or Wayland) + +Since 2015 these console keyboard maps have been generated from the X keyboard +maps packaged in xkeyboard-config.rpm. We have also included the original +console maps in the kbd-legacy subpackage. + +Since January 2022 (SLE15-SP4) we have switched the console keymaps from the +legacy ones to the ones generated from xkb. + +| Dropped keyboard map | Selected replacement | Other options | Note | +| -------------------- | -------------------- | ------------- | --------- | +| be-latin1 | be | | | +| br-abnt2 | br | br-nativo | | +| cf | ca-fr-legacy | | | +| cn-latin1 | ca-multi | | | +| croat | hr | | | +| cz-lat2-us | cz-qwerty | | | +| cz-us-qwertz | cz | | | +| de-latin1 | de | | | +| de-latin1-nodeadkeys | de-nodeadkeys | | | +| dk-latin1 | dk | | | +| dvorak | us-dvorak | | | +| es-cp850 | -- (DROPPED) | | Covered by `es` well enough | +| et | ee | | | +| fi | fi-kotoistus | | | +| fr-latin1 | fr | | | +| fr_CH-latin1 | ch-fr | | | +| hu | hu | hu-standard | | +| is-latin1 | is | | | +| jp106 | jp | | | +| la-latin1 | latam | | | +| lt.baltic | lt | | | +| nl | nl | nl-std | | +| no-latin1 | no | | | +| Pl02 | pl | | | +| pt-latin1 | pt | | | +| sg-latin1 | ch | | | +| sk-qwerty | sk-qwerty | | | +| sk-qwertz | sk | | | +| slovene | si | | | +| sr-cy | rs-latin | | Serbian, Latin only | +| sv-latin1 | se | | | +| trq | tr | | | +| uk | gb | | | +| us-acentos | br-nativo-us | | Brazilian | +| us-acentos | us-intl | | US International | + + +## Legacy being better + +Some languages have a need to switch between their native non-Latin script and +the Latin script, and have legacy keymaps which combine these two scripts in a +single keymap. + +At the same time, their xkb layout contains no Latin letters, relying on being +able to switch to another Latin layout. Their xkb layouts are not converted +for console. + +We're using `localectl set-keymap` to set both the console and X11 keymaps at +once, so removing kbd-legacy would break these languages als in X11. + +| Legacy keyboard map | Selected replacement | Other options | Note | +| -------------------- | -------------------- | ------------- | --------- | +| gr | ? | | Greek | +| ruwin_alt-UTF-8 | ? | | Russian | +| tj_alt-UTF8 | ? | | Tajik | +| ua-utf | ? | | Ukrainian | + +## Fallback to the US layout + +Some languages have never had a native console layout. Their console keymaps +are simply a symlink to the `us` keymap: + +- arabic +- ir (Iran, Persian/Farsi) +- khmer + +These layouts are moving from kbd-legacy.rpm to kbd.rpm; +[bsc#1194609](https://bugzilla.suse.com/show_bug.cgi?id=1194609). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.4.7/keyboard/src/lib/y2keyboard/keyboard_layout.rb new/yast2-country-4.4.8/keyboard/src/lib/y2keyboard/keyboard_layout.rb --- old/yast2-country-4.4.7/keyboard/src/lib/y2keyboard/keyboard_layout.rb 2021-10-21 12:09:06.000000000 +0200 +++ new/yast2-country-4.4.8/keyboard/src/lib/y2keyboard/keyboard_layout.rb 2022-01-20 17:09:30.000000000 +0100 @@ -48,7 +48,7 @@ def self.current_layout layout_definition = @@layout_definitions.detect { |x| x["code"] == @@strategy.current_layout } || - @@layout_definitions.detect { |x| x["code"] == "uk" } # default + @@layout_definitions.detect { |x| x["code"] == "us" } # default KeyboardLayout.new(layout_definition["code"], layout_definition["description"]) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.4.7/keyboard/src/lib/y2keyboard/keyboards.rb new/yast2-country-4.4.8/keyboard/src/lib/y2keyboard/keyboards.rb --- old/yast2-country-4.4.7/keyboard/src/lib/y2keyboard/keyboards.rb 2021-10-21 12:09:06.000000000 +0200 +++ new/yast2-country-4.4.8/keyboard/src/lib/y2keyboard/keyboards.rb 2022-01-20 17:09:30.000000000 +0100 @@ -34,6 +34,10 @@ # - code [String] keyboard name used by kbd, and # present in /usr/share/systemd/kbd-model-map # (test/data/keyboard_test.rb checks this) + # - legacy_code [String] old keyboard name used by kbd-legacy, + # present here so it can be automatically replaced if found + # in existing configurations (upgrade and AutoYaST profiles); + # see also legacy_replacement() # - suggested_for_lang [Array<String>] optional, language codes # to suggest this layout for def self.all_keyboards @@ -42,226 +46,286 @@ # @see all_keyboards def self.always_present_keyboards + # Now (2021-12-07) using keymaps from the new kbd package + # from /usr/share/kbd/keymaps/xkb, no longer kbd-legacy + # from /usr/share/kbd/keymaps/{amiga,atari,i386,include,mac,sun} + # + # "not_in_xkb": the xkb layout has no Latin letters and is therefore + # excluded from the console conversion. Dropping kbd-legacy would break + # these languages. + # + # "us_symlink": it has always been just a symlink to the us layout. + # bsc#1194609 moves the symlinks to kbd.rpm + # + # See also man xkeyboard-config [ { "description" => _("English (US)"), "alias" => "english-us", "code" => "us", + # No different legacy_code "suggested_for_lang" => ["ar_eg", "en", "nl_BE"] }, { "description" => _("English (UK)"), "alias" => "english-uk", - "code" => "uk" + "code" => "gb", + "legacy_code" => "uk" }, { "description" => _("German"), "alias" => "german", - "code" => "de-latin1-nodeadkeys", + "code" => "de-nodeadkeys", + "legacy_code" => "de-latin1-nodeadkeys", "suggested_for_lang" => ["de"] }, { "description" => _("German (with deadkeys)"), "alias" => "german-deadkey", - "code" => "de-latin1" + "code" => "de", + "legacy_code" => "de-latin1" }, { "description" => _("German (Switzerland)"), "alias" => "german-ch", - "code" => "sg-latin1", + "code" => "ch", + "legacy_code" => "sg-latin1", "suggested_for_lang" => ["de_CH"] }, { "description" => _("French"), "alias" => "french", - "code" => "fr-latin1", + "code" => "fr", + "legacy_code" => "fr-latin1", "suggested_for_lang" => ["br_FR", "fr", "fr_BE"] }, { "description" => _("French (Switzerland)"), "alias" => "french-ch", - "code" => "fr_CH-latin1", + "code" => "ch-fr", + "legacy_code" => "fr_CH-latin1", "suggested_for_lang" => ["fr_CH"] }, { "description" => _("French (Canada)"), "alias" => "french-ca", - "code" => "cf" + "code" => "ca-fr-legacy", # TO DO: Or just ca? Check! + "legacy_code" => "cf" }, { "description" => _("Canadian (Multilingual)"), "alias" => "cn-latin1", - "code" => "cn-latin1", + "code" => "ca-multi", + "legacy_code" => "cn-latin1", "suggested_for_lang" => ["fr_CA"] }, { "description" => _("Spanish"), "alias" => "spanish", "code" => "es", + # No different legacy_code "suggested_for_lang" => ["es"] }, { "description" => _("Spanish (Latin America)"), "alias" => "spanish-lat", - "code" => "la-latin1" - }, - { "description" => _("Spanish (CP 850)"), - "alias" => "spanish-lat-cp850", - "code" => "es-cp850" + "code" => "latam", + "legacy_code" => "la-latin1" }, { "description" => _("Spanish (Asturian variant)"), "alias" => "spanish-ast", "code" => "es-ast" + # No different legacy_code }, { "description" => _("Italian"), "alias" => "italian", "code" => "it", + # No different legacy_code "suggested_for_lang" => ["it"] }, { "description" => _("Persian"), "alias" => "persian", - "code" => "ir", + "code" => "ir", # us_symlink "suggested_for_lang" => ["fa_IR"] }, { "description" => _("Portuguese"), "alias" => "portugese", - "code" => "pt-latin1" + "code" => "pt", + "legacy_code" => "pt-latin1" }, { "description" => _("Portuguese (Brazil)"), "alias" => "portugese-br", - "code" => "br-abnt2" + "code" => "br", + "legacy_code" => "br-abnt2" }, - { "description" => _("Portuguese (Brazil-- US accents)"), + { "description" => _("Portuguese (Brazil -- US accents)"), "alias" => "portugese-br-usa", - "code" => "us-acentos" + "code" => "br-nativo-us", + "legacy_code" => "us-acentos" }, { "description" => _("Greek"), "alias" => "greek", # Left-shift+Alt switches layouts # Windows (Super) is a Greek-shift - "code" => "gr" + "code" => "gr" # not_in_xkb + # No different legacy_code }, { "description" => _("Dutch"), "alias" => "dutch", "code" => "nl" + # No different legacy_code }, { "description" => _("Danish"), "alias" => "danish", - "code" => "dk-latin1" + "code" => "dk", + "legacy_code" => "dk-latin1" }, { "description" => _("Norwegian"), "alias" => "norwegian", - "code" => "no-latin1", + "code" => "no", + "legacy_code" => "no-latin1", "suggested_for_lang" => ["no_NO", "nn_NO"] }, { "description" => _("Swedish"), "alias" => "swedish", - "code" => "sv-latin1" + "code" => "se", + "legacy_code" => "sv-latin1" }, { "description" => _("Finnish"), "alias" => "finnish", - "code" => "fi" + "code" => "fi-kotoistus", + "legacy_code" => "fi" }, { "description" => _("Czech"), "alias" => "czech", - "code" => "cz-us-qwertz" + "code" => "cz", + "legacy_code" => "cz-us-qwertz" }, { "description" => _("Czech (qwerty)"), "alias" => "czech-qwerty", - "code" => "cz-lat2-us" + "code" => "cz-qwerty", + "legacy_code" => "cz-lat2-us" }, { "description" => _("Slovak"), "alias" => "slovak", - "code" => "sk-qwertz" + "code" => "sk", + "legacy_code" => "sk-qwertz" }, { "description" => _("Slovak (qwerty)"), "alias" => "slovak-qwerty", "code" => "sk-qwerty" + # No different legacy_code }, { "description" => _("Slovene"), "alias" => "slovene", - "code" => "slovene" + "code" => "si", + "legacy_code" => "slovene" }, { "description" => _("Hungarian"), "alias" => "hungarian", "code" => "hu" + # No different legacy_code }, { "description" => _("Polish"), "alias" => "polish", - "code" => "Pl02" + "code" => "pl", + "legacy_code" => "Pl02" }, { "description" => _("Russian"), "alias" => "russian", - "code" => "ruwin_alt-UTF-8", + "code" => "ruwin_alt-UTF-8", # not_in_xkb "suggested_for_lang" => ["ru", "ru_RU.KOI8-R"] }, { "description" => _("Serbian"), "alias" => "serbian", - "code" => "sr-cy", + # this is almost a case of not_in_xkb: sr-cy has a primary Latin + # layout and a secondary Cyrillic one. Fortunately, unlike the other + # Cyrillic languages, there is xkb/rs-latin + "code" => "rs-latin", + "legacy_code" => "sr-cy", "suggested_for_lang" => ["sr_YU"] }, { "description" => _("Estonian"), "alias" => "estonian", - "code" => "et" + "code" => "ee", + "legacy_code" => "et" }, { "description" => _("Lithuanian"), "alias" => "lithuanian", - "code" => "lt.baltic" + "code" => "lt", + "legacy_code" => "lt.baltic" }, { "description" => _("Turkish"), "alias" => "turkish", - "code" => "trq" + "code" => "tr", + "legacy_code" => "trq" }, { "description" => _("Croatian"), "alias" => "croatian", - "code" => "croat" + "code" => "hr", + "legacy_code" => "croat" }, { "description" => _("Japanese"), "alias" => "japanese", - "code" => "jp106" + "code" => "jp", + "legacy_code" => "jp106" }, { "description" => _("Belgian"), "alias" => "belgian", - "code" => "be-latin1", + "code" => "be", + "legacy_code" => "be-latin1", "suggested_for_lang" => ["be_BY"] }, { "description" => _("Dvorak"), "alias" => "dvorak", # Beware, Dvorak is completely different from QWERTY; # see also https://en.wikipedia.org/wiki/Dvorak_keyboard_layout - "code" => "dvorak" + "code" => "us-dvorak", + "legacy_code" => "dvorak" + }, + { "description" => _("Dvorak (programmer)"), + "alias" => "dvp", + # Beware, Dvorak is completely different from QWERTY; + # see also https://en.wikipedia.org/wiki/Dvorak_keyboard_layout + "code" => "us-dvp" }, { "description" => _("Icelandic"), "alias" => "icelandic", - "code" => "is-latin1", + "code" => "is", + "legacy_code" => "is-latin1", "suggested_for_lang" => ["is_IS"] }, { "description" => _("Ukrainian"), "alias" => "ukrainian", # AltGr or Right-Ctrl switch layouts - "code" => "ua-utf" + "code" => "ua-utf" # not_in_xkb }, { "description" => _("Khmer"), "alias" => "khmer", - "code" => "khmer" + "code" => "khmer" # us_symlink }, { "description" => _("Korean"), "alias" => "korean", - "code" => "korean" + "code" => "kr", # xkb/kr includes a us layout + "legacy_code" => "korean" }, { "description" => _("Arabic"), "alias" => "arabic", - "code" => "arabic" + "code" => "arabic" # us_symlink }, { "description" => _("Tajik"), "alias" => "tajik", # AltGr switches layouts - "code" => "tj_alt-UTF8" + "code" => "tj_alt-UTF8" # not_in_xkb }, { "description" => _("Traditional Chinese"), "alias" => "taiwanese", - "code" => "tw" + "code" => "tw" # us-based + # No different legacy_code }, { "description" => _("Simplified Chinese"), "alias" => "chinese", - "code" => "cn" + "code" => "cn" # us-based + # No different legacy_code }, { "description" => _("Romanian"), "alias" => "romanian", "code" => "ro" + # No different legacy_code }, { "description" => _("US International"), "alias" => "us-int", - "code" => "us-acentos" + "code" => "us-intl", + "legacy_code" => "us-acentos" } ] end @@ -284,6 +348,7 @@ "description" => _("French (AFNOR)"), "alias" => "french-afnor", "code" => "fr-afnor", + # No different legacy_code "suggested_for_lang" => ["br_FR", "fr", "fr_BE"] } @optional_keyboards.push(afnor) if afnor_test.call @@ -327,7 +392,7 @@ keyboard ? keyboard["description"] : nil end - # Evaluate kemap for an given alias name + # Evaluate keymap for an given alias name # # @param [String] alias e.g. "english-us" # @@ -337,4 +402,27 @@ keyboard = all_keyboards.detect {|kb| kb["alias"] == key_alias } keyboard ? keyboard["code"] : nil end + + # Check if a keymap code is a legacy code. + # + # @param [String] code, e.g. "de-latin1" + # + # @return true if it is in "legacy_code" of any keymap hash, false if not + # + def self.legacy_code?(code) + return false if code.nil? + + all_keyboards.any?{ |kb| kb["legacy_code"] == code } + end + + # Return the new keymap code for a legacy code. + # + # @param [String] code, e.g. "de-latin1" + # + # @return [String] replacement, e.g. "de", or the original if not found. + # + def self.legacy_replacement(legacy_code) + keyboard = all_keyboards.detect { |kb| kb["legacy_code"] == legacy_code } + keyboard ? keyboard["code"] : legacy_code + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.4.7/keyboard/src/modules/Keyboard.rb new/yast2-country-4.4.8/keyboard/src/modules/Keyboard.rb --- old/yast2-country-4.4.7/keyboard/src/modules/Keyboard.rb 2021-10-21 12:09:06.000000000 +0200 +++ new/yast2-country-4.4.8/keyboard/src/modules/Keyboard.rb 2022-01-20 17:09:30.000000000 +0100 @@ -95,9 +95,9 @@ # Read installed keyboard settings. def Read - # If not in initial mode if !Stage.initial || Mode.live_installation - @curr_kbd = Keyboards.alias(@systemd_strategy.current_layout()) + curr_code = ConvertLegacyKeymapCode(@systemd_strategy.current_layout()) + @curr_kbd = Keyboards.alias(curr_code) if @curr_kbd.nil? log.warn "Unsupported keymap #{@systemd_strategy.current_layout()}." @curr_kbd = "" @@ -121,6 +121,22 @@ @modified = true end + # Convert a legacy keymap code to the corresponding new one. Leave it + # unchanged if it's not a known legacy keymap. + # + # @param [String] kb_code keymap code to check and/or change + # + # @return [String] changed keymap code + # + def ConvertLegacyKeymapCode(kb_code) + return kb_code unless Keyboards.legacy_code?(kb_code) + + new_kb_code = Keyboards.legacy_replacement(kb_code) + log.info("Changing obsolete legacy keymap code '#{kb_code}' to '#{new_kb_code}'") + Keyboard.SetModified + new_kb_code + end + # Set current data into the installed system. def Save if Mode.update @@ -248,12 +264,12 @@ end - # Set the keayboard layout according to given language + # Set the keyboard layout according to given language # @param [String] language e.g. "en" def SetKeyboardForLanguage(lang) - lkbd = GetKeyboardForLanguage(lang, "english-us") - log.info("language #{lang} proposed keyboard #{lkbd}") - Set(lkbd) if lkbd != "" + lang_kbd = GetKeyboardForLanguage(lang, "english-us") + log.info("language #{lang} proposed keyboard #{lang_kbd}") + Set(lang_kbd) if lang_kbd != "" end # Set the current keyboard as default @@ -283,6 +299,8 @@ keyboard = GetKeyboardForLanguage(settings["language"], keyboard) end + keyboard = ConvertLegacyKeymapCode(keyboard) + # Checking if the keymap exists. Either it is the real keymap name # or an alias. if !Keyboards.code(keyboard) @@ -290,7 +308,7 @@ checked_keyboard = keyboard keyboard = Keyboards.alias(checked_keyboard) if !keyboard - # TRANSLATORS: the "%s" is the kaymap name + # TRANSLATORS: "%s" is the keymap name Report.Warning(_("Cannot find keymap: %s. Taking default one.") % checked_keyboard) return false end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.4.7/keyboard/test/keyboard_layout_spec.rb new/yast2-country-4.4.8/keyboard/test/keyboard_layout_spec.rb --- old/yast2-country-4.4.7/keyboard/test/keyboard_layout_spec.rb 2021-10-21 12:09:06.000000000 +0200 +++ new/yast2-country-4.4.8/keyboard/test/keyboard_layout_spec.rb 2022-01-20 17:09:30.000000000 +0100 @@ -28,7 +28,7 @@ subject(:all_layouts) { keyboard_layout.all } it "returns a lists of keyboard layouts" do - layout_codes = ["es", "fr-latin1", "us", "uk"] + layout_codes = ["es", "fr-latin1", "us", "gb"] set_up_keyboard_layout_with(layout_codes, layout_definitions) expect(all_layouts).to be_an(Array) @@ -52,7 +52,7 @@ end it "use layout definitions to create keyboard layout with description" do - available_layout_codes = ["es", "fr-latin1", "us", "uk"] + available_layout_codes = ["es", "fr-latin1", "us", "gb"] set_up_keyboard_layout_with(available_layout_codes, layout_definitions) layout_definitions.each do |definition| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.4.7/keyboard/test/keyboard_spec.rb new/yast2-country-4.4.8/keyboard/test/keyboard_spec.rb --- old/yast2-country-4.4.7/keyboard/test/keyboard_spec.rb 2021-10-21 12:09:06.000000000 +0200 +++ new/yast2-country-4.4.8/keyboard/test/keyboard_spec.rb 2022-01-20 17:09:30.000000000 +0100 @@ -37,21 +37,31 @@ end describe "#Read" do - it "sets the current keyboard" do + before do allow(Yast::Stage).to receive(:initial).and_return false + end + + it "sets the current keyboard" do allow_any_instance_of(Y2Keyboard::Strategies::SystemdStrategy). - to receive(:current_layout).and_return("uk") + to receive(:current_layout).and_return("gb") subject.Read expect(subject.current_kbd).to eq("english-uk") end it "sets empty current keyboard for unsupported keyboard (bsc#1159286)" do - allow(Yast::Stage).to receive(:initial).and_return false + # something usable for localectl but not in our data allow_any_instance_of(Y2Keyboard::Strategies::SystemdStrategy). - to receive(:current_layout).and_return("lt") + to receive(:current_layout).and_return("lt-lekpa") subject.Read expect(subject.current_kbd).to eq("") end + + it "converts a legacy keymap code to a current one" do + allow_any_instance_of(Y2Keyboard::Strategies::SystemdStrategy). + to receive(:current_layout).and_return("fr-latin1") + subject.Read + expect(subject.current_kbd).to eq("french") + end end describe "#Save" do @@ -74,8 +84,8 @@ it "saves settings to current system" do expect_any_instance_of(Y2Keyboard::Strategies::SystemdStrategy). - to receive(:apply_layout).with("de-latin1-nodeadkeys") - subject.Set("german") + to receive(:apply_layout).with("de") + subject.Set("german-deadkey") subject.Save end end @@ -101,9 +111,9 @@ it "sets keyboard" do expect_any_instance_of(Y2Keyboard::Strategies::KbStrategy). - to receive(:set_layout).with("de-latin1-nodeadkeys") - subject.Set("german") - expect(subject.current_kbd).to eq("german") + to receive(:set_layout).with("de") + subject.Set("german-deadkey") + expect(subject.current_kbd).to eq("german-deadkey") end end end @@ -187,7 +197,7 @@ describe "#SetKeyboardDefault" do before do allow_any_instance_of(Y2Keyboard::Strategies::SystemdStrategy). - to receive(:current_layout).and_return("uk") + to receive(:current_layout).and_return("gb") end it "sets keyboard default to current keyboard" do @@ -230,7 +240,7 @@ describe "#Import" do before do allow_any_instance_of(Y2Keyboard::Strategies::SystemdStrategy). - to receive(:current_layout).and_return("uk") + to receive(:current_layout).and_return("dk") end context "data comes from language settings" do @@ -254,6 +264,18 @@ end end + context "keymap value is a legacy keymap" do + before do + allow_any_instance_of(Y2Keyboard::Strategies::SystemdStrategy). + to receive(:current_layout).and_return("no") + end + + it "converts the legacy keymap code to a current one" do + expect(subject).to receive(:Set).with("french") + subject.Import({"keymap" => "fr-latin1"}, :keyboard) + end + end + context "keymap is unknown" do it "reports a warning" do expect(subject).not_to receive(:Set) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.4.7/keyboard/test/keyboard_spec_helper.rb new/yast2-country-4.4.8/keyboard/test/keyboard_spec_helper.rb --- old/yast2-country-4.4.7/keyboard/test/keyboard_spec_helper.rb 2021-10-21 12:09:06.000000000 +0200 +++ new/yast2-country-4.4.8/keyboard/test/keyboard_spec_helper.rb 2022-01-20 17:09:30.000000000 +0100 @@ -48,7 +48,7 @@ def layout_definitions [ { "description" => "English (US)", "code" => "us" }, - { "description" => "English (UK)", "code" => "uk" }, + { "description" => "English (UK)", "code" => "gb" }, { "description" => "French", "code" => "fr-latin1" }, { "description" => "Spanish", "code" => "es" } ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.4.7/keyboard/test/keyboards_spec.rb new/yast2-country-4.4.8/keyboard/test/keyboards_spec.rb --- old/yast2-country-4.4.7/keyboard/test/keyboards_spec.rb 2021-10-21 12:09:06.000000000 +0200 +++ new/yast2-country-4.4.8/keyboard/test/keyboards_spec.rb 2022-01-20 17:09:30.000000000 +0100 @@ -8,7 +8,7 @@ subject { Keyboards } describe ".all_keyboards" do - it "returns map of all available keyboard descriptions" do + it "returns a map of all available keyboard descriptions" do ret = subject.all_keyboards expect(ret.first.key?("description")).to eq(true) expect(ret.first.key?("alias")).to eq(true) @@ -18,7 +18,7 @@ end end - it "returns list with all valid models from systemd" do + it "returns a list with all valid models from systemd" do # read valid codes from systemd as xkbctrl read it from there valid_codes = File.readlines("/usr/share/systemd/kbd-model-map") valid_codes.map! { |l| l.strip.sub(/^(\S+)\s+.*$/, "\\1") } @@ -40,13 +40,13 @@ it "returns nil" do expect(subject.suggested_keyboard("wrong_language")).to eq(nil) end - end + end end describe ".alias" do context "given keymap found" do it "evaluates alias name for a given keymap" do - expect(subject.alias("de-latin1-nodeadkeys")).to eq("german") + expect(subject.alias("de")).to eq("german-deadkey") end end @@ -85,4 +85,58 @@ end end + describe ".legacy_code?" do + it "detects known legacy_codes" do + expect(subject.legacy_code?("de-latin1")).to eq(true) + expect(subject.legacy_code?("sg-latin1")).to eq(true) + end + + it "rejects known current keymap codes" do + expect(subject.legacy_code?("de")).to eq(false) + expect(subject.legacy_code?("ch")).to eq(false) + end + + it "survives nil" do + expect(subject.legacy_code?(nil)).to eq(false) + end + end + + describe ".legacy_replacement" do + it "translates legacy keymap codes correctly" do + expect(subject.legacy_replacement("de-latin1")).to eq("de") + expect(subject.legacy_replacement("sg-latin1")).to eq("ch") + end + + it "returns the original keymap code if it is not found as a legacy_code" do + expect(subject.legacy_replacement("de")).to eq("de") + expect(subject.legacy_replacement("fr")).to eq("fr") + end + + it "survives nil" do + expect(subject.legacy_replacement(nil)).to eq("us") + end + end + + describe "keyboard table consistency:" do + it "has all required hash keys" do + subject.all_keyboards.each do |kb| + expect(kb.keys).to include("description", "alias", "code") + end + end + + it "does not have unexpected hash keys" do + subject.all_keyboards.each do |kb| + unknown_keys = kb.keys - ["description", "alias", "code", "legacy_code","suggested_for_lang"] + expect(unknown_keys).to be_empty, "unknown #{unknown_keys} in #{kb}" + end + end + + it "no legacy_code is also a current code" do + current_codes = subject.all_keyboards.map { |kb| kb["code"] } + legacy_codes = subject.all_keyboards.map { |kb| kb["legacy_code"] }.compact + ambiguous = current_codes & legacy_codes + expect(ambiguous).to be_empty, "legacy_code cannot be a current code: #{ambiguous}" + end + end + end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.4.7/keyboard/test/systemd_strategy_spec.rb new/yast2-country-4.4.8/keyboard/test/systemd_strategy_spec.rb --- old/yast2-country-4.4.7/keyboard/test/systemd_strategy_spec.rb 2021-10-21 12:09:06.000000000 +0200 +++ new/yast2-country-4.4.8/keyboard/test/systemd_strategy_spec.rb 2022-01-20 17:09:30.000000000 +0100 @@ -63,7 +63,7 @@ describe "#current_layout" do it "returns the current used keyboard layout code" do - current_selected_layout_code = "uk" + current_selected_layout_code = "gb" given_layouts(["es", current_selected_layout_code, "us"]) given_a_current_layout(current_selected_layout_code) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.4.7/package/yast2-country.changes new/yast2-country-4.4.8/package/yast2-country.changes --- old/yast2-country-4.4.7/package/yast2-country.changes 2021-10-21 12:09:06.000000000 +0200 +++ new/yast2-country-4.4.8/package/yast2-country.changes 2022-01-20 17:09:30.000000000 +0100 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Wed Jan 19 09:27:28 UTC 2022 - Martin Vidner <mvid...@suse.com> + +- Switch console keyboard layouts to match the X11 ones + (xkb, from xkeyboard-config.rpm), to prepare for + kbd-legacy.rpm going away (jsc#SLE-21107). +- Add programmer Dvorak keyboard layout. +- 4.4.8 + +------------------------------------------------------------------- Thu Oct 21 08:45:47 UTC 2021 - Stefan Hundhammer <shundham...@suse.com> - Use official China timezone Asia/Shanghai (bsc#1187857) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.4.7/package/yast2-country.spec new/yast2-country-4.4.8/package/yast2-country.spec --- old/yast2-country-4.4.7/package/yast2-country.spec 2021-10-21 12:09:06.000000000 +0200 +++ new/yast2-country-4.4.8/package/yast2-country.spec 2022-01-20 17:09:30.000000000 +0100 @@ -16,7 +16,7 @@ # Name: yast2-country -Version: 4.4.7 +Version: 4.4.8 Release: 0 Summary: YaST2 - Country Settings (Language, Keyboard, and Timezone) License: GPL-2.0-only