Hello community,

here is the log from the commit of package yast2-country for openSUSE:Factory 
checked in at 2016-11-25 12:04:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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      
2016-11-23 13:36:12.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-country.new/yast2-country.changes 
2016-11-25 12:05:00.000000000 +0100
@@ -1,0 +2,9 @@
+Wed Nov 23 13:41:41 CET 2016 - [email protected]
+
+- Language has not been set. Taking language from zypp.
+  But libzypp can also returns languages which we do not support
+  (e.g. default "en"). So we are checking and changing it to
+  default if needed (without showing an error (bnc#1009508))
+- 3.2.2
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-country.spec ++++++
--- /var/tmp/diff_new_pack.PUnG1p/_old  2016-11-25 12:05:01.000000000 +0100
+++ /var/tmp/diff_new_pack.PUnG1p/_new  2016-11-25 12:05:01.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-country
-Version:        3.2.1
+Version:        3.2.2
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build



++++++ yast2-country-3.2.1.tar.bz2 -> yast2-country-3.2.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-country-3.2.1/language/src/modules/Language.rb 
new/yast2-country-3.2.2/language/src/modules/Language.rb
--- old/yast2-country-3.2.1/language/src/modules/Language.rb    2016-11-21 
17:48:22.000000000 +0100
+++ new/yast2-country-3.2.2/language/src/modules/Language.rb    2016-11-23 
16:02:52.000000000 +0100
@@ -68,7 +68,7 @@
       @language_on_entry = DEFAULT_FALLBACK_LANGUAGE
 
       # language preselected in /etc/install.inf
-      @preselected = "en_US"
+      @preselected = DEFAULT_FALLBACK_LANGUAGE
 
       # user readable description of language
       @name = "English (US)"
@@ -244,7 +244,7 @@
     # Return English translation of given language (Fate 301789)
     def EnglishName(code, backup)
       if Ops.get_string(@english_names, code, "") == ""
-        if @language == "en_US"
+        if @language == DEFAULT_FALLBACK_LANGUAGE
           Ops.set(@english_names, code, backup)
         else
           Builtins.y2warning("nothing in english_names...")
@@ -255,11 +255,11 @@
 
     # Fill the map with English names of languages
     def FillEnglishNames(lang)
-      return if lang == "en_US" # will be filled in on first start
+      return if lang == DEFAULT_FALLBACK_LANGUAGE # will be filled in on first 
start
       if @use_utf8
-        WFM.SetLanguage("en_US", "UTF-8")
+        WFM.SetLanguage(DEFAULT_FALLBACK_LANGUAGE, "UTF-8")
       else
-        WFM.SetLanguage("en_US")
+        WFM.SetLanguage(DEFAULT_FALLBACK_LANGUAGE)
       end
       Builtins.foreach(GetLanguagesMap(true)) do |code, info|
         Ops.set(@english_names, code, Ops.get_string(info, 4, ""))
@@ -394,9 +394,10 @@
     # Checks whether given language is supported by the installer
     # and changes it to the default language en_US if it isn't.
     #
-    # @param [String] reference to the new language
+    # @param language [String] reference to the new language
+    # @param error_report [Boolean] showing an error popup
     # @return [String] new (corrected) language
-    def correct_language(language)
+    def correct_language(language, error_report: true)
       # No correction needed, this is already a correct language definition
       return language if valid_language?(language)
 
@@ -410,7 +411,7 @@
           :directory => @languages_directory,
           :fallback => DEFAULT_FALLBACK_LANGUAGE
         }
-      )
+      ) if error_report
 
       return DEFAULT_FALLBACK_LANGUAGE
     end
@@ -609,15 +610,19 @@
         Builtins.y2milestone("install_inf Locale %1", @preselected)
         if @preselected != nil && @preselected != ""
           lang = @preselected
-          @linuxrc_language_set = true if lang != "en_US"
+          @linuxrc_language_set = true if lang != DEFAULT_FALLBACK_LANGUAGE
         else
-          @preselected = "en_US"
+          @preselected = DEFAULT_FALLBACK_LANGUAGE
         end
 
-        lang = "" if lang == nil
+        lang ||= ""
         Builtins.y2milestone("lang after checking /etc/install.inf: %1", lang)
         if lang == ""
-          lang = Pkg.GetTextLocale
+          # As language has not been set we are trying to ask libzypp.
+          # But libzypp can also returns languages which we do not support
+          # (e.g. default "en"). So we are checking and changing it to default
+          # if needed (without showing an error (bnc#1009508))
+          lang = correct_language(Pkg.GetTextLocale, error_report: false)
           Builtins.y2milestone("setting lang to default language: %1", lang)
         end
         # Ignore any previous settings and take language from control file.
@@ -802,7 +807,7 @@
       Builtins.foreach(Pkg.GetAdditionalLocales) do |additional|
         # add the language for both kind of values ("cs" vs. "pt_PT")
         if !Builtins.contains(langs, additional)
-          additional = "en_US" if additional == "en"
+          additional = DEFAULT_FALLBACK_LANGUAGE if additional == "en"
           additional = "pt_PT" if additional == "pt"
           if Builtins.haskey(@languages_map, additional)
             missing = Builtins.add(missing, additional)
@@ -1375,7 +1380,7 @@
             )
           )
         end
-        WfmSetGivenLanguage("en_US")
+        WfmSetGivenLanguage(DEFAULT_FALLBACK_LANGUAGE)
         return true
       end
       false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-country-3.2.1/language/test/Language_test.rb 
new/yast2-country-3.2.2/language/test/Language_test.rb
--- old/yast2-country-3.2.1/language/test/Language_test.rb      2016-11-21 
17:48:22.000000000 +0100
+++ new/yast2-country-3.2.2/language/test/Language_test.rb      2016-11-23 
16:02:52.000000000 +0100
@@ -89,6 +89,14 @@
         language = subject.correct_language("unknown_language")
         expect(language).to eq(Yast::LanguageClass::DEFAULT_FALLBACK_LANGUAGE)
       end
+
+      it "returns the default fallback language without reporting an error if 
it is disabled " do
+        allow(subject).to 
receive(:valid_language?).with("unknown_language").and_return(false)
+        expect(Yast::Report).to_not receive(:Error)
+
+        language = subject.correct_language("unknown_language", error_report: 
false)
+        expect(language).to eq(Yast::LanguageClass::DEFAULT_FALLBACK_LANGUAGE)
+      end
     end
   end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-country-3.2.1/package/yast2-country.changes 
new/yast2-country-3.2.2/package/yast2-country.changes
--- old/yast2-country-3.2.1/package/yast2-country.changes       2016-11-21 
17:48:22.000000000 +0100
+++ new/yast2-country-3.2.2/package/yast2-country.changes       2016-11-23 
16:02:52.000000000 +0100
@@ -1,4 +1,13 @@
 -------------------------------------------------------------------
+Wed Nov 23 13:41:41 CET 2016 - [email protected]
+
+- Language has not been set. Taking language from zypp.
+  But libzypp can also returns languages which we do not support
+  (e.g. default "en"). So we are checking and changing it to
+  default if needed (without showing an error (bnc#1009508))
+- 3.2.2
+
+-------------------------------------------------------------------
 Mon Nov 21 15:50:47 UTC 2016 - [email protected]
 
 - Set keyboard layout properly on installation system (bsc#1010938)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-country-3.2.1/package/yast2-country.spec 
new/yast2-country-3.2.2/package/yast2-country.spec
--- old/yast2-country-3.2.1/package/yast2-country.spec  2016-11-21 
17:48:22.000000000 +0100
+++ new/yast2-country-3.2.2/package/yast2-country.spec  2016-11-23 
16:02:52.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-country
-Version:        3.2.1
+Version:        3.2.2
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build


Reply via email to