Hello community,

here is the log from the commit of package yast2-country for openSUSE:Factory 
checked in at 2018-11-01 19:07:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-country (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-country.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-country"

Thu Nov  1 19:07:06 2018 rev:194 rq:645202 version:4.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-country/yast2-country.changes      
2018-07-03 23:31:26.732659327 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-country.new/yast2-country.changes 
2018-11-01 19:07:09.918025205 +0100
@@ -1,0 +2,19 @@
+Fri Oct 26 13:21:47 UTC 2018 - [email protected]
+
+- Console: Use empty string instead of none for FONTMAP
+  (bsc#1013573)
+- 4.1.0
+
+-------------------------------------------------------------------
+Thu Sep 27 10:37:48 UTC 2018 - Stefan Hundhammer <[email protected]>
+
+- Set only system time if no hardware clock available (bsc#1103744)
+- 4.0.24
+
+-------------------------------------------------------------------
+Mon Aug 20 10:11:59 CEST 2018 - [email protected]
+
+- Changed dir of COPYING file.
+- Switched license in spec file from SPDX2 to SPDX3 format.
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-country.spec ++++++
--- /var/tmp/diff_new_pack.SuwTvA/_old  2018-11-01 19:07:11.086025275 +0100
+++ /var/tmp/diff_new_pack.SuwTvA/_new  2018-11-01 19:07:11.086025275 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-country
-Version:        4.0.23
+Version:        4.1.0
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -63,7 +63,7 @@
 Requires:       rubygem(%{rb_default_ruby_abi}:ruby-dbus)
 
 Summary:        YaST2 - Country Settings (Language, Keyboard, and Timezone)
-License:        GPL-2.0
+License:        GPL-2.0-only
 Group:          System/YaST
 
 %description
@@ -92,7 +92,7 @@
 %files
 %defattr(-,root,root)
 %doc %{yast_docdir}
-%doc COPYING
+%license COPYING
 %{yast_moduledir}/Console.rb
 %{yast_moduledir}/Keyboard.rb
 %{yast_moduledir}/Timezone.rb
@@ -103,6 +103,7 @@
 %dir %{yast_libdir}/y2country
 %{yast_libdir}/y2country/widgets
 %{yast_ydatadir}/*.ycp
+%{yast_ydatadir}/*.json
 %{yast_yncludedir}/keyboard/
 %{yast_yncludedir}/timezone/
 %{yast_scrconfdir}/*.scr

++++++ yast2-country-4.0.23.tar.bz2 -> yast2-country-4.1.0.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-country-4.0.23/console/src/Makefile.am 
new/yast2-country-4.1.0/console/src/Makefile.am
--- old/yast2-country-4.0.23/console/src/Makefile.am    2018-07-02 
16:18:18.000000000 +0200
+++ new/yast2-country-4.1.0/console/src/Makefile.am     2018-10-29 
10:49:02.000000000 +0100
@@ -7,7 +7,7 @@
   scrconf/sysconfig_console.scr
 
 ydata_DATA = \
-  data/consolefonts.ycp
+  data/consolefonts.json
 
 EXTRA_DIST = $(module_DATA) $(scrconf_DATA) $(ydata_DATA)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-country-4.0.23/console/src/data/consolefonts.json 
new/yast2-country-4.1.0/console/src/data/consolefonts.json
--- old/yast2-country-4.0.23/console/src/data/consolefonts.json 1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-country-4.1.0/console/src/data/consolefonts.json  2018-10-29 
10:49:02.000000000 +0100
@@ -0,0 +1,200 @@
+{
+  "bg": {
+    "font": "UniCyr_8x16.psf",
+    "unicodeMap": "",
+    "screenMap": "trivial",
+    "magic": "(K"
+  },
+  "bg_BG": {
+    "font": "UniCyr_8x16.psf",
+    "unicodeMap": "",
+    "screenMap": "trivial",
+    "magic": "(K"
+  },
+  "bg_BG.UTF-8": {
+    "font": "UniCyr_8x16.psf",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": "(K"
+  },
+  "br": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "ca": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "cs": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "de": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "el": {
+    "font": "iso07u-16.psfu",
+    "unicodeMap": "",
+    "screenMap": "trivial",
+    "magic": "(K"
+  },
+  "el_GR": {
+    "font": "iso07u-16.psfu",
+    "unicodeMap": "",
+    "screenMap": "trivial",
+    "magic": "(K"
+  },
+  "el_GR.UTF-8": {
+    "font": "iso07u-16.psfu",
+    "unicodeMap": "",
+    "screenMap": "trivial",
+    "magic": "(K"
+  },
+  "en": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "es": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "fr": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "gl": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "hu": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "it": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "ja": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "lt": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "nl": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "pl": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "pt": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "ru": {
+    "font": "UniCyr_8x16.psf",
+    "unicodeMap": "",
+    "screenMap": "koi2alt",
+    "magic": "(K"
+  },
+  "ru_RU.KOI8-R": {
+    "font": "UniCyr_8x16.psf",
+    "unicodeMap": "",
+    "screenMap": "koi2alt",
+    "magic": "(K"
+  },
+  "ru_RU.UTF-8": {
+    "font": "UniCyr_8x16.psf",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": "(K"
+  },
+  "sk": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "sr": {
+    "font": "UniCyr_8x16.psf",
+    "unicodeMap": "",
+    "screenMap": "trivial",
+    "magic": "(K"
+  },
+  "sr_RS.UTF-8": {
+    "font": "UniCyr_8x16.psf",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": "(K"
+  },
+  "sr_RS@latin": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "trivial",
+    "magic": ""
+  },
+  "tg": {
+    "font": "UniCyr_8x16.psf",
+    "unicodeMap": "",
+    "screenMap": "trivial",
+    "magic": "(K"
+  },
+  "tg_TJ.UTF-8": {
+    "font": "UniCyr_8x16.psf",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": "(K"
+  },
+  "tr": {
+    "font": "eurlatgr.psfu",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": ""
+  },
+  "uk": {
+    "font": "UniCyr_8x16.psf",
+    "unicodeMap": "",
+    "screenMap": "trivial",
+    "magic": "(K"
+  },
+  "uk_UA.UTF-8": {
+    "font": "UniCyr_8x16.psf",
+    "unicodeMap": "",
+    "screenMap": "",
+    "magic": "(K"
+  }
+}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-country-4.0.23/console/src/data/consolefonts.ycp 
new/yast2-country-4.1.0/console/src/data/consolefonts.ycp
--- old/yast2-country-4.0.23/console/src/data/consolefonts.ycp  2018-07-02 
16:18:18.000000000 +0200
+++ new/yast2-country-4.1.0/console/src/data/consolefonts.ycp   1970-01-01 
01:00:00.000000000 +0100
@@ -1,68 +0,0 @@
-/* 
------------------------------------------------------------------------------
- * Copyright (c) 2016 SUSE LLC
- *
- * This program is free software; you can redistribute it and/or modify it 
under
- * the terms of version 2 of the GNU General Public License as published by the
- * Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 
details.
- * 
------------------------------------------------------------------------------
- */
-
-/*
- * Maintainer:  Thomas Fehr <[email protected]>
- *
- * consolefonts map
- */
-
-$[
-      // LANG          font                unicode map screen map,     console 
magic
-      "en"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-// The two-letters language is used as a fallback, so additional entries like
-// the ones displayed below are not needed as long as they use the same values.
-//      "en_GB@euro"   : [ "eurlatgr.psfu",    "",     "none", "" ],
-//      "en_GB"                : [ "eurlatgr.psfu",    "",     "none", "" ],
-//      "en_US"                : [ "eurlatgr.psfu",    "",     "none", "" ],
-//      "en_US.UTF-8"   : [ "eurlatgr.psfu",   "",     "none", "" ],
-//      "en_GB.UTF-8"   : [ "eurlatgr.psfu",   "",     "none", "" ],
-      "de"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "fr"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "it"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "es"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "nl"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "pt"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "ca"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "gl"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "br"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "pl"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "cs"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "sk"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "hu"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "lt"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "ja"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-      "tr"             : [ "eurlatgr.psfu",    "",     "none", "" ],
-
-      "el_GR"          : [ "iso07u-16.psfu",   "",     "trivial",      "(K" ],
-      "el"             : [ "iso07u-16.psfu",   "",     "trivial",      "(K" ],
-      "el_GR.UTF-8"    : [ "iso07u-16.psfu",   "",     "trivial",      "(K" ],
-
-      "ru_RU.KOI8-R"   : [ "UniCyr_8x16.psf",  "",     "koi2alt",      "(K" ],
-      "ru"             : [ "UniCyr_8x16.psf",  "",     "koi2alt",      "(K" ],
-      "ru_RU.UTF-8"     : [ "UniCyr_8x16.psf", "",     "none",         "(K" ],
-
-      "sr_RS@latin"    : [ "eurlatgr.psfu",    "",     "trivial",      "" ],
-      "sr"             : [ "UniCyr_8x16.psf",  "",     "trivial",      "(K" ],
-      "sr_RS.UTF-8"     : [ "UniCyr_8x16.psf", "",     "none",         "(K" ],
-
-      "uk"             : [ "UniCyr_8x16.psf",  "",     "trivial",      "(K" ],
-      "uk_UA.UTF-8"     : [ "UniCyr_8x16.psf", "",     "none",         "(K" ],
-
-      "tg"             : [ "UniCyr_8x16.psf",  "",     "trivial",      "(K" ],
-      "tg_TJ.UTF-8"     : [ "UniCyr_8x16.psf", "",     "none",         "(K" ],
-
-      "bg_BG"          : [ "UniCyr_8x16.psf",  "",     "trivial",      "(K" ],
-      "bg"             : [ "UniCyr_8x16.psf",  "",     "trivial",      "(K" ],
-      "bg_BG.UTF-8"     : [ "UniCyr_8x16.psf", "",     "none",         "(K" ]
-  ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-country-4.0.23/console/src/modules/Console.rb 
new/yast2-country-4.1.0/console/src/modules/Console.rb
--- old/yast2-country-4.0.23/console/src/modules/Console.rb     2018-07-02 
16:18:18.000000000 +0200
+++ new/yast2-country-4.1.0/console/src/modules/Console.rb      2018-10-29 
10:49:02.000000000 +0100
@@ -46,6 +46,8 @@
 #      Klaus Kaempf <[email protected]>
 #
 require "yast"
+require "json"
+Yast.import "Directory"
 
 module Yast
   class ConsoleClass < Module
@@ -65,7 +67,7 @@
 
       @font = "lat1-16.psfu"
       @unicodeMap = ""
-      @screenMap = "none"
+      @screenMap = ""
       @magic = "(B"
 
       # non-empty if serial console (written /etc/inittab)
@@ -96,10 +98,10 @@
       if !consolefont.empty?
         @language = lang
 
-        @font = consolefont[0] || ""
-        @unicodeMap = consolefont[1] || ""
-        @screenMap = consolefont[2] || ""
-        @magic = consolefont[3] || ""
+        @font = consolefont["font"]
+        @unicodeMap = consolefont["unicodeMap"]
+        @screenMap = consolefont["screenMap"]
+        @magic = consolefont["magic"]
 
         currentLanguage = WFM.GetLanguage
 
@@ -250,32 +252,30 @@
 
     # Console fonts map
     #
-    # The map can be read from two different files:
-    #
-    # * `consolefonts_ID.ycp` where ID is the distribution identifier (as
-    #   specified in /etc/os-release). For example, 
`consolefonts_opensuse.ycp`.
-    # * `consolefonts.ycp` as a fallback.
-    #
     # Associates languages with the following set of properties: font, unicode 
map,
     # screen map and magic initialization.
     #
     # @example Console fonts format
-    #   consolefonts #=>
-    #     "bg"=>["UniCyr_8x16.psf", "", "trivial", "(K"],
-    #     "bg_BG"=>["UniCyr_8x16.psf", "", "trivial", "(K"],
-    #     "bg_BG.UTF-8"=>["UniCyr_8x16.psf", "", "none", "(K"],
-    #     "br"=>["lat1-16.psfu", "", "none", "(B"],
-    #     ...
+    #   {
+    #     "bg" => {
+    #       "font"=>"UniCyr_8x16.psf",
+    #       "unicodeMap"=>"",
+    #       "screenMap"=>"trivial",
+    #       "magic"=>"(K"
+    #     },
+    #     "bg_BG" => {
+    #       "font"=>"UniCyr_8x16.psf",
+    #       "unicodeMap"=>"",
+    #       "screenMap"=>"trivial",
+    #       "magic"=>"(K"
+    #     }
+    #   }
     #
     # @return [Hash] Console fonts map. See the example for content details.
     def consolefonts
       return @consolefonts if @consolefonts
 
-      # Read the file for this product
-      @consolefonts = WFM.Read(path(".local.yast2"), 
"consolefonts_#{OSRelease.id}.ycp")
-
-      # Fallback
-      @consolefonts ||= WFM.Read(path(".local.yast2"), "consolefonts.ycp")
+      @consolefonts = 
JSON.load(File.read(Directory.find_data_file("consolefonts.json")))
     end
   end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-country-4.0.23/console/test/console_test.rb 
new/yast2-country-4.1.0/console/test/console_test.rb
--- old/yast2-country-4.0.23/console/test/console_test.rb       2018-07-02 
16:18:18.000000000 +0200
+++ new/yast2-country-4.1.0/console/test/console_test.rb        2018-10-29 
10:49:02.000000000 +0100
@@ -26,7 +26,7 @@
 
     it "sets console fonts for the given language" do
       expect(Yast::UI).to receive(:SetConsoleFont)
-        .with("", "eurlatgr.psfu", "none", "", "es_ES")
+        .with("", "eurlatgr.psfu", "", "", "es_ES")
       Yast::Console.SelectFont(language)
     end
 
@@ -50,7 +50,7 @@
 
       it "sets console fonts for the given language" do
         expect(Yast::UI).to receive(:SetConsoleFont)
-          .with("", "eurlatgr.psfu", "none", "", "es_ES")
+          .with("", "eurlatgr.psfu", "", "", "es_ES")
         Yast::Console.SelectFont(language)
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-country-4.0.23/package/yast2-country.changes 
new/yast2-country-4.1.0/package/yast2-country.changes
--- old/yast2-country-4.0.23/package/yast2-country.changes      2018-07-02 
16:18:18.000000000 +0200
+++ new/yast2-country-4.1.0/package/yast2-country.changes       2018-10-29 
10:49:02.000000000 +0100
@@ -1,4 +1,23 @@
 -------------------------------------------------------------------
+Fri Oct 26 13:21:47 UTC 2018 - [email protected]
+
+- Console: Use empty string instead of none for FONTMAP
+  (bsc#1013573)
+- 4.1.0
+
+-------------------------------------------------------------------
+Thu Sep 27 10:37:48 UTC 2018 - Stefan Hundhammer <[email protected]>
+
+- Set only system time if no hardware clock available (bsc#1103744)
+- 4.0.24
+
+-------------------------------------------------------------------
+Mon Aug 20 10:11:59 CEST 2018 - [email protected]
+
+- Changed dir of COPYING file.
+- Switched license in spec file from SPDX2 to SPDX3 format.
+
+-------------------------------------------------------------------
 Wed Jun 27 15:16:47 CEST 2018 - [email protected]
 
 - Added additional searchkeys to desktop file (fate#321043).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-country-4.0.23/package/yast2-country.spec 
new/yast2-country-4.1.0/package/yast2-country.spec
--- old/yast2-country-4.0.23/package/yast2-country.spec 2018-07-02 
16:18:18.000000000 +0200
+++ new/yast2-country-4.1.0/package/yast2-country.spec  2018-10-29 
10:49:02.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-country
-Version:        4.0.23
+Version:        4.1.0
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -63,7 +63,7 @@
 Requires:       rubygem(%{rb_default_ruby_abi}:ruby-dbus)
 
 Summary:        YaST2 - Country Settings (Language, Keyboard, and Timezone)
-License:        GPL-2.0
+License:        GPL-2.0-only
 Group:          System/YaST
 
 %description
@@ -92,7 +92,7 @@
 %files
 %defattr(-,root,root)
 %doc %{yast_docdir}
-%doc COPYING
+%license COPYING
 %{yast_moduledir}/Console.rb
 %{yast_moduledir}/Keyboard.rb
 %{yast_moduledir}/Timezone.rb
@@ -103,6 +103,7 @@
 %dir %{yast_libdir}/y2country
 %{yast_libdir}/y2country/widgets
 %{yast_ydatadir}/*.ycp
+%{yast_ydatadir}/*.json
 %{yast_yncludedir}/keyboard/
 %{yast_yncludedir}/timezone/
 %{yast_scrconfdir}/*.scr
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-country-4.0.23/timezone/src/modules/Timezone.rb 
new/yast2-country-4.1.0/timezone/src/modules/Timezone.rb
--- old/yast2-country-4.0.23/timezone/src/modules/Timezone.rb   2018-07-02 
16:18:18.000000000 +0200
+++ new/yast2-country-4.1.0/timezone/src/modules/Timezone.rb    2018-10-29 
10:49:02.000000000 +0100
@@ -474,53 +474,72 @@
 
     # Set the new time and date given by user
     def SetTime(year, month, day, hour, minute, second)
-      if !Arch.s390
-        date = Builtins.sformat(
-          " --date=\"%1/%2/%3 %4:%5:%6\" ",
-          month,
-          day,
-          year,
-          hour,
-          minute,
-          second
-        )
-        cmd = ""
-        if Ops.greater_than(Builtins.size(@timezone), 0) &&
-            @hwclock != "--localtime"
-          cmd = Ops.add(Ops.add("TZ=", @timezone), " ")
-        end
-        cmd = Ops.add(
-          Ops.add(Ops.add(cmd, "/sbin/hwclock --set "), @hwclock),
-          date
-        )
-        Builtins.y2milestone("SetTime cmd %1", cmd)
-        SCR.Execute(path(".target.bash"), cmd)
-        cmd = Ops.add("/sbin/hwclock --hctosys ", @hwclock)
-        Builtins.y2milestone("SetTime cmd %1", cmd)
-        SCR.Execute(path(".target.bash"), cmd)
-        # actually, it was probably not called, but do not let it change the 
time again after manual change
-        @systz_called = true
-      end
+      return nil if Arch.s390
+
+      timedate = "#{month}/#{day}/#{year} #{hour}:#{minute}:#{second}"
 
+      if set_hwclock(timedate)
+        sync_hwclock_to_system_time
+      else
+        # No hardware clock available (bsc#1103744)
+        log.info("Fallback: Leaving HW clock untouched, setting only system 
time")
+        set_system_time(timedate)
+      end
       nil
     end
 
     # Set the Hardware Clock to the current System Time.
     def SystemTime2HWClock
-      if !Arch.s390
-        cmd = ""
-        if Ops.greater_than(Builtins.size(@timezone), 0) &&
-            @hwclock != "--localtime"
-          cmd = Ops.add(Ops.add("TZ=", @timezone), " ")
-        end
-        cmd = Ops.add("/sbin/hwclock --systohc ", @hwclock)
-        Builtins.y2milestone("cmd %1", cmd)
-        SCR.Execute(path(".target.bash"), cmd)
-      end
+      return nil if Arch.s390
 
+      cmd = tz_prefix + "/sbin/hwclock --systohc #{@hwclock}"
+      log.info("cmd #{cmd}")
+      SCR.Execute(path(".target.bash"), cmd)
       nil
     end
 
+    # Set the hardware clock with the given date.
+    # @param timedate [String]
+    # @return [Bool] true if success, false if error
+    #
+    def set_hwclock(date)
+      cmd = tz_prefix + "/sbin/hwclock --set #{@hwclock} --date=\"#{date}\""
+      log.info("set_hwclock: #{cmd}")
+      SCR.Execute(path(".target.bash"), cmd) == 0
+    end
+
+    # Synchronize the hardware clock to the system time
+    #
+    def sync_hwclock_to_system_time
+      cmd = "/sbin/hwclock --hctosys #{@hwclock}"
+      log.info("sync_hwclock_to_system_time: #{cmd}")
+      SCR.Execute(path(".target.bash"), cmd)
+      @systz_called = true
+    end
+
+    # Set only the system time (leaving the hardware clock untouched)
+    # @param timedate [String]
+    #
+    def set_system_time(timedate)
+      cmd = tz_prefix + "/usr/bin/date --set=\"#{timedate}\""
+      log.info("set_system_time: #{cmd}")
+      SCR.Execute(path(".target.bash"), cmd)
+    end
+
+    # Return a "TZ=... " prefix for commands such as "hwclock" or "date" to set
+    # the time zone environment variable temporarily for the duration of one
+    # command.
+    #
+    # If nonempty, this will append a blank as a separator.
+    #
+    # @return [String]
+    #
+    def tz_prefix
+      return "" if @hwclock == "--localtime"
+      return "" if @timezone.empty?
+      "TZ=#{@timezone} "
+    end
+
 
     # GetTimezoneForLanguage()
     #
@@ -615,11 +634,7 @@
         "+%c" :
         "+%Y-%m-%d - %H:%M:%S"
 
-      Builtins.y2milestone(
-        "GetDateTime hwclock %1 real:%2",
-        @hwclock,
-        real_time
-      )
+      log.info("GetDateTime hwclock: #{@hwclock} real: #{real_time}")
       if !real_time && !Mode.config
         ds = 0
         if @diff != 0
@@ -627,7 +642,7 @@
             SCR.Execute(path(".target.bash_output"), "date +%z")
           )
           tzd = Ops.get_string(out2, "stdout", "")
-          Builtins.y2milestone("GetDateTime tcd=%1", tzd)
+          log.info("GetDateTime tzd: #{tzd}")
           t = Builtins.tointeger(String.CutZeros(Builtins.substring(tzd, 1, 
2)))
           if t != nil
             ds = Ops.add(ds, Ops.multiply(t, 3600))
@@ -636,27 +651,23 @@
             )
             ds = Ops.add(ds, Ops.multiply(t, 60))
             ds = Ops.unary_minus(ds) if Builtins.substring(tzd, 0, 1) == "-"
-            Builtins.y2milestone("GetDateTime ds %1 diff %2", ds, @diff)
+            log.info("GetDateTime ds: #{ds} diff: #{@diff}")
           end
         end
-        cmd = ""
-        cmd = Builtins.sformat("TZ=%1 ", @timezone) if @hwclock != 
"--localtime"
-        cmd = Ops.add(
-          cmd,
+        cmd = tz_prefix +
           Builtins.sformat(
             "/bin/date \"%1\" \"--date=now %2sec\"",
             date_format,
             Ops.multiply(ds, @diff)
           )
-        )
       else
         cmd = Builtins.sformat("/bin/date \"%1\"", date_format)
       end
-      Builtins.y2milestone("GetDateTime cmd=%1", cmd)
+      log.info("GetDateTime cmd: #{cmd}")
       out = Convert.to_map(SCR.Execute(path(".target.bash_output"), cmd))
       local_date = Builtins.deletechars(Ops.get_string(out, "stdout", ""), 
"\n")
 
-      Builtins.y2milestone("GetDateTime local_date='%1'", local_date)
+      log.info("GetDateTime local_date: '#{local_date}'")
 
       local_date
     end


Reply via email to