diff --git a/getcountrydata.rb b/getcountrydata.rb index ee630fa..2780292 100644 --- a/getcountrydata.rb +++ b/getcountrydata.rb @@ -1,5 +1,7 @@ # encoding: utf-8 +require "json" + module Yast class GetcountrydataClient < Client def main @@ -9,9 +11,17 @@ module Yast Yast.import "OSRelease" langs = Language.GetLanguagesMap(true) + + consolefonts = nil + datafilepath = Directory.find_data_file("consolefonts.json") + + if datafilepath.nil? + consolefonts = SCR.Read(path(".target.yast2"), "consolefonts_#{OSRelease.id}.ycp") + consolefonts ||= SCR.Read(path(".target.yast2"), "consolefonts.ycp") + else + consolefonts = JSON.load(File.read(datafilepath)) + end - consolefonts = SCR.Read(path(".target.yast2"), "consolefonts_#{OSRelease.id}.ycp") - consolefonts ||= SCR.Read(path(".target.yast2"), "consolefonts.ycp") timezonemap = Language.GetLang2TimezoneMap(true) dir = ENV["OUTPUTDIR"] @@ -31,10 +41,17 @@ module Yast consolefont = consolefonts[lang[0,2]] end consolefont ||= [] - font = consolefont[0] || "" - unicodeMap = consolefont[1] || "" - screenMap = consolefont[2] || "" - magic = consolefont[3] || "" + if consolefont.is_a?(Hash) + font = consolefont["font"] || "" + unicodeMap = consolefont["unicodeMap"] || "" + screenMap = consolefont["screenMap"] || "" + magic = consolefont["magic"] || "" + else + font = consolefont[0] || "" + unicodeMap = consolefont[1] || "" + screenMap = consolefont[2] || "" + magic = consolefont[3] || "" + end timezone = timezonemap[lang] || "" contents = "RC_LANG='#{fqlanguage}'\n" + diff --git a/live-langset-data.changes b/live-langset-data.changes index 82fbeee..e582887 100644 --- a/live-langset-data.changes +++ b/live-langset-data.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Oct 31 09:19:22 UTC 2018 - Fabian Vogt + +- Support the conversion to json in yast2-country done for bsc#1013573 + ------------------------------------------------------------------- Tue Jun 12 07:52:34 UTC 2018 - fvogt@suse.com diff --git a/live-langset-data.spec b/live-langset-data.spec index c339e23..251cfe6 100644 --- a/live-langset-data.spec +++ b/live-langset-data.spec @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ #