Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r54499 - in /branches/SuSE-Code-11-Branch/ntp-client: package/yast2-ntp-client.changes src/NtpClient.ycp
  • From: mvidner@xxxxxxxxxxxxxxxx
  • Date: Fri, 09 Jan 2009 13:09:52 -0000
  • Message-id: <E1LLH7Y-0000fy-5u@xxxxxxxxxxxxxxxx>
Author: mvidner
Date: Fri Jan 9 14:09:51 2009
New Revision: 54499

URL: http://svn.opensuse.org/viewcvs/yast?rev=54499&view=rev
Log:
Offer CC.pool.ntp.org for countries that do not have any other
server (bnc#458917 c4).

Modified:
branches/SuSE-Code-11-Branch/ntp-client/package/yast2-ntp-client.changes
branches/SuSE-Code-11-Branch/ntp-client/src/NtpClient.ycp

Modified:
branches/SuSE-Code-11-Branch/ntp-client/package/yast2-ntp-client.changes
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/ntp-client/package/yast2-ntp-client.changes?rev=54499&r1=54498&r2=54499&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/ntp-client/package/yast2-ntp-client.changes
(original)
+++ branches/SuSE-Code-11-Branch/ntp-client/package/yast2-ntp-client.changes
Fri Jan 9 14:09:51 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Jan 9 14:09:44 CET 2009 - mvidner@xxxxxxx
+
+- Offer CC.pool.ntp.org for countries that do not have any other
+ server (bnc#458917 c4).
+
+-------------------------------------------------------------------
Fri Dec 12 16:00:50 CET 2008 - mvidner@xxxxxxx

- Due to yesterday's change, the Configure button at install time

Modified: branches/SuSE-Code-11-Branch/ntp-client/src/NtpClient.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/ntp-client/src/NtpClient.ycp?rev=54499&r1=54498&r2=54499&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/ntp-client/src/NtpClient.ycp (original)
+++ branches/SuSE-Code-11-Branch/ntp-client/src/NtpClient.ycp Fri Jan 9
14:09:51 2009
@@ -116,7 +116,11 @@

/**
* List of known NTP servers
- * server -> information
+ * server address -> information
+ * address: the key repeated
+ * country: CC (uppercase)
+ * location: for displaying
+ * ...: (others are unused)
*/
map<string,map<string,string> > ntp_servers = nil;

@@ -196,6 +200,14 @@
return Language::GetGivenLanguageCountry( lang );
}

+map<string, string> MakePoolRecord (string CC, string location) {
+ return $[
+ "address" : tolower(CC) + ".pool.ntp.org",
+ "country" : CC,
+ "location": location,
+ ];
+}
+
/**
* Get the list of known NTP servers
* @return a list of known NTP servers
@@ -218,13 +230,10 @@
return $[ server : s ];
});
}
-
foreach (string short_country, string country_name,
GetAllKnownCountries(), {
- ntp_servers[tolower(short_country) + ".pool.ntp.org"] = $[
- "address" : tolower(short_country) + ".pool.ntp.org",
- "country" : short_country,
- "location": country_name,
- ];
+ // just refactored existing code
+ map<string, string> p = MakePoolRecord(short_country, country_name);
+ ntp_servers[p["address"]:""] = p;
});
}

@@ -263,6 +272,9 @@
servers = filter (string s, map<string,string> o, servers, {
return o["country"]:"" == country;
});
+ // bnc#458917 add country, in case data/country.ycp does not have it
+ map<string,string> p = MakePoolRecord (country, "");
+ servers[p["address"]:""] = p;
}
else
{

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages