Hello community,
here is the log from the commit of package autoyast2 for openSUSE:Factory checked in at 2015-07-19 11:44:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/autoyast2 (Old)
and /work/SRC/openSUSE:Factory/.autoyast2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "autoyast2"
Changes:
--------
--- /work/SRC/openSUSE:Factory/autoyast2/autoyast2.changes 2015-07-05 17:52:21.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.autoyast2.new/autoyast2.changes 2015-07-19 11:44:58.000000000 +0200
@@ -1,0 +2,11 @@
+Fri Jul 10 14:51:44 CEST 2015 - schubi@suse.de
+
+- Syncing hardware time before starting installation via ntp.
+ This is configurable via the flag
+ <general><mode> with which
+ the name of the ntp server will be defined. If it is not set
+ no synchronisation will be done. So it is backward compatible.
+ (bnc#935066)
+- 3.1.85
+
+-------------------------------------------------------------------
Old:
----
autoyast2-3.1.84.tar.bz2
New:
----
autoyast2-3.1.85.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ autoyast2.spec ++++++
--- /var/tmp/diff_new_pack.Zfek2c/_old 2015-07-19 11:44:59.000000000 +0200
+++ /var/tmp/diff_new_pack.Zfek2c/_new 2015-07-19 11:44:59.000000000 +0200
@@ -17,7 +17,7 @@
Name: autoyast2
-Version: 3.1.84
+Version: 3.1.85
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ autoyast2-3.1.84.tar.bz2 -> autoyast2-3.1.85.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.84/package/autoyast2.changes new/autoyast2-3.1.85/package/autoyast2.changes
--- old/autoyast2-3.1.84/package/autoyast2.changes 2015-07-01 15:19:37.000000000 +0200
+++ new/autoyast2-3.1.85/package/autoyast2.changes 2015-07-10 15:24:44.000000000 +0200
@@ -1,4 +1,15 @@
-------------------------------------------------------------------
+Fri Jul 10 14:51:44 CEST 2015 - schubi@suse.de
+
+- Syncing hardware time before starting installation via ntp.
+ This is configurable via the flag
+ <general><mode> with which
+ the name of the ntp server will be defined. If it is not set
+ no synchronisation will be done. So it is backward compatible.
+ (bnc#935066)
+- 3.1.85
+
+-------------------------------------------------------------------
Wed Jul 1 14:54:51 CEST 2015 - schubi@suse.de
- Added "upgrade" section to generic list. (bnc#935915)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.84/package/autoyast2.spec new/autoyast2-3.1.85/package/autoyast2.spec
--- old/autoyast2-3.1.84/package/autoyast2.spec 2015-07-01 15:19:37.000000000 +0200
+++ new/autoyast2-3.1.85/package/autoyast2.spec 2015-07-10 15:24:44.000000000 +0200
@@ -17,7 +17,7 @@
Name: autoyast2
-Version: 3.1.84
+Version: 3.1.85
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.84/src/autoyast-rnc/general.rnc new/autoyast2-3.1.85/src/autoyast-rnc/general.rnc
--- old/autoyast2-3.1.84/src/autoyast-rnc/general.rnc 2015-07-01 15:19:37.000000000 +0200
+++ new/autoyast2-3.1.85/src/autoyast-rnc/general.rnc 2015-07-10 15:24:44.000000000 +0200
@@ -10,6 +10,7 @@
element final_halt { BOOLEAN }? &
element final_reboot { BOOLEAN }? &
element forceboot { BOOLEAN }? &
+ element ntp_sync_time_before_installation { text }? &
element max_systemd_wait { INTEGER }?
}? &
mouse? &
@@ -110,6 +111,8 @@
element final_reboot { BOOLEAN }
forceboot =
element forceboot { BOOLEAN }
+ntp_sync_time_before_installation =
+ ntp_sync_time_before_installation {text}
halt =
element halt { BOOLEAN }
second_stage =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.84/src/modules/AutoinstGeneral.rb new/autoyast2-3.1.85/src/modules/AutoinstGeneral.rb
--- old/autoyast2-3.1.84/src/modules/AutoinstGeneral.rb 2015-07-01 15:19:37.000000000 +0200
+++ new/autoyast2-3.1.85/src/modules/AutoinstGeneral.rb 2015-07-10 15:24:44.000000000 +0200
@@ -26,6 +26,7 @@
Yast.import "ProductFeatures"
Yast.import "Storage"
Yast.import "SignatureCheckCallbacks"
+ Yast.import "Report"
# All shared data are in yast2.rpm to break cyclic dependencies
Yast.import "AutoinstData"
@@ -383,6 +384,29 @@
Storage.SetMultipathStartup(val)
end
+ # NTP syncing
+ def NtpSync
+ ntp_server = @mode["ntp_sync_time_before_installation"]
+ if ntp_server
+ Builtins.y2milestone("NTP syncing with #{ntp_server}")
+ Popup.ShowFeedback(
+ _("Syncing time..."),
+ # TRANSLATORS: %s is the name of the ntp server
+ _("Syncing time with %s.") % ntp_server
+ )
+ ret = SCR.Execute(path(".target.bash"), "/usr/sbin/sntp -t 2 -s #{ntp_server}")
+ if ret > 0
+ Report.Error(_("Time syncing failed."))
+ else
+ ret = SCR.Execute(path(".target.bash"), "/sbin/hwclock --systohc")
+ if ret > 0
+ Report.Error(_("Cannot update system time."))
+ end
+ end
+ Popup.ClearFeedback
+ end
+ end
+
# Write General Configuration
# @return [Boolean] true on success
def Write
@@ -412,6 +436,8 @@
SetSignatureHandling()
+ NtpSync()
+
nil
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.84/test/AutoinstGeneral_test.rb new/autoyast2-3.1.85/test/AutoinstGeneral_test.rb
--- old/autoyast2-3.1.84/test/AutoinstGeneral_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/autoyast2-3.1.85/test/AutoinstGeneral_test.rb 2015-07-10 15:24:44.000000000 +0200
@@ -0,0 +1,40 @@
+#!/usr/bin/env rspec
+
+require_relative "test_helper"
+
+Yast.import "AutoinstGeneral"
+Yast.import "Profile"
+
+describe Yast::AutoinstGeneral do
+ FIXTURES_PATH = File.join(File.dirname(__FILE__), 'fixtures')
+
+ describe "#ntp syncing in Write call" do
+ let(:profile_sync) { File.join(FIXTURES_PATH, 'profiles', 'general_with_time_sync.xml') }
+ let(:profile_no_sync) { File.join(FIXTURES_PATH, 'profiles', 'general_without_time_sync.xml') }
+
+ it "syncing hardware time if ntp server is set" do
+ Yast::Profile.ReadXML(profile_sync)
+ Yast::AutoinstGeneral.Import(Yast::Profile.current["general"])
+
+ expect(Yast::SCR).to receive(:Execute).with(
+ path(".target.bash"),
+ "/usr/sbin/sntp -t 2 -s #{Yast::AutoinstGeneral.mode["ntp_sync_time_before_installation"]}").and_return(0)
+ expect(Yast::SCR).to receive(:Execute).with(
+ path(".target.bash"),"/sbin/hwclock --systohc").and_return(0)
+
+ Yast::AutoinstGeneral.Write()
+ end
+
+ it "not syncing hardware time if no ntp server is set" do
+ Yast::Profile.ReadXML(profile_no_sync)
+ Yast::AutoinstGeneral.Import(Yast::Profile.current["general"])
+
+ expect(Yast::SCR).not_to receive(:Execute).with(
+ path(".target.bash"),"/sbin/hwclock --systohc")
+
+ Yast::AutoinstGeneral.Write()
+ end
+
+ end
+
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.84/test/fixtures/profiles/general_with_time_sync.xml new/autoyast2-3.1.85/test/fixtures/profiles/general_with_time_sync.xml
--- old/autoyast2-3.1.84/test/fixtures/profiles/general_with_time_sync.xml 1970-01-01 01:00:00.000000000 +0100
+++ new/autoyast2-3.1.85/test/fixtures/profiles/general_with_time_sync.xml 2015-07-10 15:24:44.000000000 +0200
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE profile>
+<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
+ <general>
+ <ask-list config:type="list" />
+ <mode>
+ <confirm config:type="boolean">true</confirm>
+ ntp.suse.de
+ </mode>
+ <mouse>
+ <id>none</id>
+ </mouse>
+ <signature-handling>
+ true
+ true
+ true
+ true
+ false
+ true
+ </signature-handling>
+ </general>
+</profile>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.84/test/fixtures/profiles/general_without_time_sync.xml new/autoyast2-3.1.85/test/fixtures/profiles/general_without_time_sync.xml
--- old/autoyast2-3.1.84/test/fixtures/profiles/general_without_time_sync.xml 1970-01-01 01:00:00.000000000 +0100
+++ new/autoyast2-3.1.85/test/fixtures/profiles/general_without_time_sync.xml 2015-07-10 15:24:44.000000000 +0200
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<!DOCTYPE profile>
+<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
+ <general>
+ <ask-list config:type="list" />
+ <mode>
+ <confirm config:type="boolean">true</confirm>
+ </mode>
+ <mouse>
+ <id>none</id>
+ </mouse>
+ <signature-handling>
+ true
+ true
+ true
+ true
+ false
+ true
+ </signature-handling>
+ </general>
+</profile>