Hello community, here is the log from the commit of package yast2-country for openSUSE:Factory checked in at 2018-11-18 23:00:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-country (Old) and /work/SRC/openSUSE:Factory/.yast2-country.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-country" Sun Nov 18 23:00:04 2018 rev:196 rq:649540 version:4.1.4 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-country/yast2-country.changes 2018-11-12 09:36:08.441644823 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-country.new/yast2-country.changes 2018-11-18 23:01:02.971610294 +0100 @@ -1,0 +2,24 @@ +Thu Nov 15 11:28:03 UTC 2018 - igonzalezs...@suse.com + +- Fallback to English when using fbiterm on those languages + which are not properly supported (fate#325746). +- 4.1.4 + +------------------------------------------------------------------- +Mon Nov 12 14:32:16 UTC 2018 - knut.anders...@suse.com + +- Timezone: When ntp is configured to be used by default, offer + also ntp servers proposed by DHCP but do not choose them if the + user does not select one explicitly (fate#323454) +- 4.1.3 + +------------------------------------------------------------------- +Sat Nov 10 08:31:44 UTC 2018 - knut.anders...@suse.com + +- Timezone: Since ntp-client does not write the config anymore when + called for syncing only, we need to remove the 'ntpdate_only' + parameter in order to continue proposing a default when it is + enabled in the control file (bsc#1108497). +- 4.1.2 + +------------------------------------------------------------------- Old: ---- yast2-country-4.1.1.tar.bz2 New: ---- yast2-country-4.1.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-country.spec ++++++ --- /var/tmp/diff_new_pack.9RCdL4/_old 2018-11-18 23:01:04.743608312 +0100 +++ /var/tmp/diff_new_pack.9RCdL4/_new 2018-11-18 23:01:04.747608307 +0100 @@ -17,7 +17,7 @@ Name: yast2-country -Version: 4.1.1 +Version: 4.1.4 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -51,8 +51,8 @@ Requires: yast2-pkg-bindings >= 2.15.3 # IconPath support for MultiSelectionBox Requires: yast2-core >= 2.16.28 -# new API of ntp-client_proposal.ycp -Conflicts: yast2-ntp-client < 2.18.0 +# new API of ntp-client_proposal.rb +Conflicts: yast2-ntp-client < 4.1.5 Requires: yast2-packager >= 2.23.3 # VMware detection (.probe.is_vmware) ++++++ yast2-country-4.1.1.tar.bz2 -> yast2-country-4.1.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.1.1/language/src/modules/Language.rb new/yast2-country-4.1.4/language/src/modules/Language.rb --- old/yast2-country-4.1.1/language/src/modules/Language.rb 2018-11-09 09:24:51.000000000 +0100 +++ new/yast2-country-4.1.4/language/src/modules/Language.rb 2018-11-16 12:00:22.000000000 +0100 @@ -256,8 +256,8 @@ end # Fill the map with English names of languages - def FillEnglishNames(lang) - return if lang == DEFAULT_FALLBACK_LANGUAGE # will be filled in on first start + def FillEnglishNames + old_lang = WFM.GetLanguage() if @use_utf8 WFM.SetLanguage(DEFAULT_FALLBACK_LANGUAGE, "UTF-8") else @@ -267,9 +267,9 @@ Ops.set(@english_names, code, Ops.get_string(info, 4, "")) end if @use_utf8 - WFM.SetLanguage(lang, "UTF-8") + WFM.SetLanguage(old_lang, "UTF-8") else - WFM.SetLanguage(lang) + WFM.SetLanguage(old_lang) end nil @@ -630,7 +630,7 @@ lang ) end - FillEnglishNames(lang) + FillEnglishNames() Set(lang) # coming from /etc/install.inf SetDefault() # also default else @@ -638,7 +638,7 @@ QuickSet(local_lang) SetDefault() # also default if Mode.live_installation || Stage.firstboot - FillEnglishNames(local_lang) + FillEnglishNames() end end if Ops.greater_than( @@ -1332,39 +1332,36 @@ end # Set current YaST language to English if method for showing text in - # current language is not supported (usually for CJK languages) - # See http://bugzilla.novell.com/show_bug.cgi?id=479529 for discussion + # current language is not supported: + # + # * CJK languages when not using fbiterm + # * other unsupported languages when not running on fbiterm + # + # See http://bugzilla.suse.com/show_bug.cgi?id=479529 for discussion # @boolean show_popup if information popup about the change should be shown # @return true if UI language was changed def SwitchToEnglishIfNeeded(show_popup) - if Stage.normal - Builtins.y2milestone("no language switching in normal stage") - return false - end - if GetTextMode() && - # current language is CJK - CJKLanguage(@language) && - # fbiterm is not running - Builtins.getenv("TERM") != "iterm" - if show_popup - # popup message (user selected CJK language in text mode) - Popup.Message( - _( - "The selected language cannot be used in text mode. English is used for\ninstallation, but the selected language will be used for the new system." - ) - ) - end - WfmSetGivenLanguage(DEFAULT_FALLBACK_LANGUAGE) - return true - end - false + return false if Stage.normal || supported_language?(@language) + + show_popup_early = supported_language?(WFM.GetLanguage()) + show_fallback_to_english_warning if show_popup && show_popup_early + WfmSetGivenLanguage(DEFAULT_FALLBACK_LANGUAGE) + show_fallback_to_english_warning if show_popup && !show_popup_early + true + end + + # Determines whether the language is supported or not + # + # @note To be used in instsys + def supported_language?(lang) + return true unless GetTextMode() + (fbiterm? && supported_by_fbiterm?(lang)) || !(fbiterm? || CJKLanguage(lang)) end def GetCurrentLocaleString GetLocaleString @language end - publish :variable => :language, :type => "string" publish :variable => :language_on_entry, :type => "string" publish :variable => :preselected, :type => "string" @@ -1413,6 +1410,34 @@ publish :function => :GetLanguageItems, :type => "list <term> (symbol)" publish :function => :CheckLanguagesSupport, :type => "void (string)" publish :function => :SwitchToEnglishIfNeeded, :type => "boolean (boolean)" + + private + + # @return [Array<String>] List of languages which are not supported by fbiterm + UNSUPPORTED_FBITERM_LANGS = ["ar", "bn", "gu", "hi", "km", "mr", "pa", "ta", "th"].freeze + + # Determines whether the language is supported by fbiterm + # @param lang [String] Language code + # @return [Boolean] + def supported_by_fbiterm?(lang) + code, _ = lang.split("_") + UNSUPPORTED_FBITERM_LANGS.none?(code) + end + + # Determines whether the installer is running on fbiterm + # + # @return [Boolean] + def fbiterm? + Builtins.getenv("TERM") == "iterm" + end + + def show_fallback_to_english_warning + Report.Message( + _( + "The selected language cannot be used in text mode. English is used for\ninstallation, but the selected language will be used for the new system." + ) + ) + end end Language = LanguageClass.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.1.1/language/test/Language_test.rb new/yast2-country-4.1.4/language/test/Language_test.rb --- old/yast2-country-4.1.1/language/test/Language_test.rb 2018-11-09 09:24:51.000000000 +0100 +++ new/yast2-country-4.1.4/language/test/Language_test.rb 2018-11-16 12:00:22.000000000 +0100 @@ -4,7 +4,6 @@ require_relative "test_helper" require "y2country/language_dbus" - describe "Language" do subject { Yast::Language } @@ -202,4 +201,130 @@ subject.ResetRecommendedPackages end end + + describe "#SwitchToEnglishIfNeeded" do + let(:normal?) { false } + let(:textmode?) { true } + let(:term) { "xterm" } + let(:lang) { "de_DE" } + + before do + allow(Yast::Stage).to receive(:normal).and_return(normal?) + allow(subject).to receive(:GetTextMode).and_return(textmode?) + allow(Yast::Builtins).to receive(:getenv).with("TERM").and_return(term) + end + + around do |example| + old_lang = Yast::Language.language + Yast::Language.language = lang + example.call + Yast::Language.language = old_lang + end + + context "when running on normal stage" do + let(:normal?) { true} + + it "does not change the language" do + expect(subject).to_not receive(:WfmSetGivenLanguage) + subject.SwitchToEnglishIfNeeded(true) + end + + it "returns false" do + expect(subject.SwitchToEnglishIfNeeded(true)).to eq(false) + end + end + + context "when not running on textmode" do + it "does not change the language" do + expect(subject).to_not receive(:WfmSetGivenLanguage) + subject.SwitchToEnglishIfNeeded(true) + end + end + + context "when running on fbiterm" do + let(:term) { "iterm" } + + context "and it is using a supported language" do + it "does not change the language" do + expect(subject).to_not receive(:WfmSetGivenLanguage) + subject.SwitchToEnglishIfNeeded(true) + end + + it "returns false" do + expect(subject.SwitchToEnglishIfNeeded(true)).to eq(false) + end + end + + context "and it is using a non supported language" do + let(:lang) { "ar_EG" } + + it "changes the language to English" do + expect(subject).to receive(:WfmSetGivenLanguage).with("en_US") + subject.SwitchToEnglishIfNeeded(true) + end + + it "displays an error message if asked to do so" do + allow(Yast::Report).to receive(:Message).with(/selected language cannot be used/) + subject.SwitchToEnglishIfNeeded(true) + end + + it "does not display any error message if not asked to do so" do + expect(Yast::Report).to_not receive(:Message) + subject.SwitchToEnglishIfNeeded(false) + end + + it "returns true" do + expect(subject.SwitchToEnglishIfNeeded(true)).to eq(true) + end + end + end + + context "when not running on fbiterm" do + context "and it is not using a CJK language" do + it "does not change the language" do + expect(subject).to_not receive(:WfmSetGivenLanguage) + subject.SwitchToEnglishIfNeeded(true) + end + + it "returns false" do + expect(subject.SwitchToEnglishIfNeeded(true)).to eq(false) + end + end + + context "and it is using a CJK language" do + let(:lang) { "ja_JP" } + + it "changes the language to English" do + expect(subject).to receive(:WfmSetGivenLanguage).with("en_US") + subject.SwitchToEnglishIfNeeded(true) + end + + it "displays an error message if asked to do so" do + expect(Yast::Report).to receive(:Message).with(/selected language cannot be used/) + subject.SwitchToEnglishIfNeeded(true) + end + + it "does not display any error message if not asked to do so" do + expect(Yast::Report).to_not receive(:Message) + subject.SwitchToEnglishIfNeeded(false) + end + + it "returns true" do + expect(subject.SwitchToEnglishIfNeeded(true)).to eq(true) + end + end + end + end + + describe "#FillEnglishNames" do + before do + subject.main + end + + it "does not modify the WFM language" do + expect(subject.EnglishName("de_DE", "missing")).to eq("missing") + subject.FillEnglishNames() + expect(subject.EnglishName("de_DE", "missing")).to eq("German") + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.1.1/package/yast2-country.changes new/yast2-country-4.1.4/package/yast2-country.changes --- old/yast2-country-4.1.1/package/yast2-country.changes 2018-11-09 09:24:51.000000000 +0100 +++ new/yast2-country-4.1.4/package/yast2-country.changes 2018-11-16 12:00:22.000000000 +0100 @@ -1,4 +1,28 @@ ------------------------------------------------------------------- +Thu Nov 15 11:28:03 UTC 2018 - igonzalezs...@suse.com + +- Fallback to English when using fbiterm on those languages + which are not properly supported (fate#325746). +- 4.1.4 + +------------------------------------------------------------------- +Mon Nov 12 14:32:16 UTC 2018 - knut.anders...@suse.com + +- Timezone: When ntp is configured to be used by default, offer + also ntp servers proposed by DHCP but do not choose them if the + user does not select one explicitly (fate#323454) +- 4.1.3 + +------------------------------------------------------------------- +Sat Nov 10 08:31:44 UTC 2018 - knut.anders...@suse.com + +- Timezone: Since ntp-client does not write the config anymore when + called for syncing only, we need to remove the 'ntpdate_only' + parameter in order to continue proposing a default when it is + enabled in the control file (bsc#1108497). +- 4.1.2 + +------------------------------------------------------------------- Fri Nov 9 07:52:29 UTC 2018 - jsr...@suse.cz - provide better API for getting keyboard map info (fate#325748) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.1.1/package/yast2-country.spec new/yast2-country-4.1.4/package/yast2-country.spec --- old/yast2-country-4.1.1/package/yast2-country.spec 2018-11-09 09:24:51.000000000 +0100 +++ new/yast2-country-4.1.4/package/yast2-country.spec 2018-11-16 12:00:22.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-country -Version: 4.1.1 +Version: 4.1.4 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -51,8 +51,8 @@ Requires: yast2-pkg-bindings >= 2.15.3 # IconPath support for MultiSelectionBox Requires: yast2-core >= 2.16.28 -# new API of ntp-client_proposal.ycp -Conflicts: yast2-ntp-client < 2.18.0 +# new API of ntp-client_proposal.rb +Conflicts: yast2-ntp-client < 4.1.5 Requires: yast2-packager >= 2.23.3 # VMware detection (.probe.is_vmware) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.1.1/timezone/src/include/timezone/dialogs.rb new/yast2-country-4.1.4/timezone/src/include/timezone/dialogs.rb --- old/yast2-country-4.1.1/timezone/src/include/timezone/dialogs.rb 2018-11-09 09:24:51.000000000 +0100 +++ new/yast2-country-4.1.4/timezone/src/include/timezone/dialogs.rb 2018-11-16 12:00:22.000000000 +0100 @@ -581,11 +581,13 @@ servers = (0..3).map { |i| "#{i}.novell.pool.ntp.org" } end @ntp_server = servers.sample + # Dot not select a dhcp ntp server by default but add it to the offered + # list (fate#323454) + servers = ntp_call("dhcp_ntp_servers", {}).concat(servers).uniq argmap = { "server" => @ntp_server, # FIXME ntp-client_proposal doesn't understand 'servers' yet - "servers" => servers, - "ntpdate_only" => true + "servers" => servers } rv = Convert.to_symbol(ntp_call("Write", argmap))