Author: mvidner Date: Mon Jan 19 14:46:16 2009 New Revision: 54756 URL: http://svn.opensuse.org/viewcvs/yast?rev=54756&view=rev Log: Use the iburst option (Oct 28) also for the server added during the installation, to make the initial sync work even if the time slew is too big (bnc#450418). Added: trunk/ntp-client/testsuite/tests/selected_record.err trunk/ntp-client/testsuite/tests/selected_record.out trunk/ntp-client/testsuite/tests/selected_record.ycp (with props) Modified: trunk/ntp-client/VERSION trunk/ntp-client/package/yast2-ntp-client.changes trunk/ntp-client/src/NtpClient.ycp trunk/ntp-client/src/ntp-client_finish.ycp trunk/ntp-client/src/widgets.ycp Modified: trunk/ntp-client/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/VERSION?rev=54756&r1=54755&r2=54756&view=diff ============================================================================== --- trunk/ntp-client/VERSION (original) +++ trunk/ntp-client/VERSION Mon Jan 19 14:46:16 2009 @@ -1 +1 @@ -2.17.11 +2.17.12 Modified: trunk/ntp-client/package/yast2-ntp-client.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/package/yast2-ntp-client.changes?rev=54756&r1=54755&r2=54756&view=diff ============================================================================== --- trunk/ntp-client/package/yast2-ntp-client.changes (original) +++ trunk/ntp-client/package/yast2-ntp-client.changes Mon Jan 19 14:46:16 2009 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Mon Jan 19 14:45:26 CET 2009 - mvidner@suse.cz + +- Use the iburst option also for the server added during the + installation, to make the initial sync work even if the + time slew is too big (bnc#450418). +- 2.17.12 + +------------------------------------------------------------------- Fri Jan 9 14:10:47 CET 2009 - mvidner@suse.cz - Removed a server reported nonfunctional (bnc#458917). Modified: trunk/ntp-client/src/NtpClient.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/src/NtpClient.ycp?rev=54756&r1=54755&r2=54756&view=diff ============================================================================== --- trunk/ntp-client/src/NtpClient.ycp (original) +++ trunk/ntp-client/src/NtpClient.ycp Mon Jan 19 14:46:16 2009 @@ -1100,6 +1100,20 @@ } /** + * Ensure that selected_record["options"] contains the option. + * (A set operation in a string) + */ +global void enableOptionInSyncRecord (string option) { + // careful, "burst" != "iburst" + string old = selected_record["options"]:""; + list<string> old_l = splitstring (old, " \t"); + if (!contains (old_l, option)) { + old_l = add (old_l, option); + } + selected_record["options"] = mergestring (old_l, " "); +} + +/** * Return required packages for auto-installation * @return map of packages to be installed and to be removed */ Modified: trunk/ntp-client/src/ntp-client_finish.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/src/ntp-client_finish.ycp?rev=54756&r1=54755&r2=54756&view=diff ============================================================================== --- trunk/ntp-client/src/ntp-client_finish.ycp (original) +++ trunk/ntp-client/src/ntp-client_finish.ycp Mon Jan 19 14:46:16 2009 @@ -53,6 +53,8 @@ NtpClient::selectSyncRecord(idx); NtpClient::selected_record["address"] = server; NtpClient::selected_record["type"] = "server"; + // bnc#450418, add a recommended option + NtpClient::enableOptionInSyncRecord ("iburst"); NtpClient::storeSyncRecord(); }); Modified: trunk/ntp-client/src/widgets.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/src/widgets.ycp?rev=54756&r1=54755&r2=54756&view=diff ============================================================================== --- trunk/ntp-client/src/widgets.ycp (original) +++ trunk/ntp-client/src/widgets.ycp Mon Jan 19 14:46:16 2009 @@ -692,6 +692,7 @@ * @param id any widget id */ define void optionsInit (string id) ``{ + // bnc#438704, add a recommended option UI::ChangeWidget (`id ("options"), `Value, NtpClient::selected_record["options"]:"iburst"); } Added: trunk/ntp-client/testsuite/tests/selected_record.err URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/testsuite/tests/selected_record.err?rev=54756&view=auto ============================================================================== (empty) Added: trunk/ntp-client/testsuite/tests/selected_record.out URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/testsuite/tests/selected_record.out?rev=54756&view=auto ============================================================================== --- trunk/ntp-client/testsuite/tests/selected_record.out (added) +++ trunk/ntp-client/testsuite/tests/selected_record.out Mon Jan 19 14:46:16 2009 @@ -0,0 +1,4 @@ +Dump $["options":"whatever", "server":"tick.example.com", "type":"server"] +Dump $["options":"whatever iburst", "server":"tick.example.com", "type":"server"] +Dump $["options":"whatever iburst burst", "server":"tick.example.com", "type":"server"] +Dump $["options":"alone"] Added: trunk/ntp-client/testsuite/tests/selected_record.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/testsuite/tests/selected_record.ycp?rev=54756&view=auto ============================================================================== --- trunk/ntp-client/testsuite/tests/selected_record.ycp (added) +++ trunk/ntp-client/testsuite/tests/selected_record.ycp Mon Jan 19 14:46:16 2009 @@ -0,0 +1,35 @@ +// +{ + include "testsuite.ycp"; + // [COBE] why is all this necessary just to test a standalone function! + // testedfiles: NtpClient.ycp + map READ = $[ + "target" : $[ + "tmpdir": "/tmp", + "size": 0, + ], + ]; + map EXECUTE = $[ + "target": $[ + "bash_output": $[], + ], + ]; + TESTSUITE_INIT ([READ, $[], EXECUTE], nil); + + import "NtpClient"; + + NtpClient::selected_record = $["type": "server", + "server": "tick.example.com", + "options": "whatever"]; + DUMP (NtpClient::selected_record); + + NtpClient::enableOptionInSyncRecord ("iburst"); + DUMP (NtpClient::selected_record); + + NtpClient::enableOptionInSyncRecord ("burst"); + DUMP (NtpClient::selected_record); + + NtpClient::selected_record = $[]; + NtpClient::enableOptionInSyncRecord ("alone"); + DUMP (NtpClient::selected_record); +} -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org