[yast-commit] r41680 - in /trunk/ntp-client: VERSION package/yast2-ntp-client.changes src/ntp-client_proposal.ycp
Author: kmachalkova Date: Wed Oct 31 13:56:58 2007 New Revision: 41680 URL: http://svn.opensuse.org/viewcvs/yast?rev=41680&view=rev Log: - Prompt for installing xntp package (CheckAndInstallPackages) on running system, do not scan repositories (Package::Available()) (#327336) Modified: trunk/ntp-client/VERSION trunk/ntp-client/package/yast2-ntp-client.changes trunk/ntp-client/src/ntp-client_proposal.ycp Modified: trunk/ntp-client/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/VERSION?rev=41680&r1=41679&r2=41680&view=diff ============================================================================== --- trunk/ntp-client/VERSION (original) +++ trunk/ntp-client/VERSION Wed Oct 31 13:56:58 2007 @@ -1 +1 @@ -2.16.0 +2.16.1 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=41680&r1=41679&r2=41680&view=diff ============================================================================== --- trunk/ntp-client/package/yast2-ntp-client.changes (original) +++ trunk/ntp-client/package/yast2-ntp-client.changes Wed Oct 31 13:56:58 2007 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Wed Oct 31 13:53:04 CET 2007 - kmachalkova@suse.cz + +- Prompt for installing xntp package (CheckAndInstallPackages) on + running system, do not scan repositories (Package::Available()) + (#327336) + - 2.16.1 + +------------------------------------------------------------------- Wed Oct 3 18:44:06 CEST 2007 - kmachalkova@suse.cz - Added visual progress feedback for running ntpdate in installation Modified: trunk/ntp-client/src/ntp-client_proposal.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/src/ntp-client_proposal.ycp?rev=41680&r1=41679&r2=41680&view=diff ============================================================================== --- trunk/ntp-client/src/ntp-client_proposal.ycp (original) +++ trunk/ntp-client/src/ntp-client_proposal.ycp Wed Oct 31 13:56:58 2007 @@ -16,8 +16,10 @@ import "Stage"; import "Package"; import "Packages"; +import "PackageSystem"; import "Pkg"; import "Popup"; +import "Report"; y2milestone("----------------------------------------"); y2milestone("Ntp client proposal started"); @@ -153,8 +155,29 @@ ret = `invalid_hostname; else { - Popup::ShowFeedback("", _("Synchronizing with NTP server...")); - y2milestone("Running ntpdate to sync with %1", ntp_server); + string required_package = "xntp"; + + //In 1st stage, schedule packages for installation + if (Stage::initial()) + { + if (Package::Available(required_package)) + { + Packages::addAdditionalPackage(required_package); + // bugzilla #327050 + // Agent for writing /etc/ntp.conf needs to be installed + // to write the settings at the end of the installation + Packages::addAdditionalPackage("yast2-ntp-client"); + } + } + //Otherwise, prompt user for confirming pkg installation + else + { + if (!PackageSystem::CheckAndInstallPackages([ required_package ])) + { + Report::Error(sformat( _("Synchronization with NTP server is not possible +without having package %1 installed"), required_package)); + } + } integer status = -1; string service_name = "ntp"; @@ -169,19 +192,11 @@ Service::Stop (service_name); } - //Schedule package for installation - if (Package::Available("xntp")) - // FIXME: later use - // if (Package::Available("xntp")) { Packages::addAdditionalPackage("xntp"); } - Packages::addAdditionalPackage("xntp"); - // bugzilla #327050 - // Agent for writing /etc/ntp.conf needs to be installed - // to write the settings at the end of the installation - Packages::addAdditionalPackage("yast2-ntp-client"); + Popup::ShowFeedback("", _("Synchronizing with NTP server...")); + y2milestone("Running ntpdate to sync with %1", ntp_server); integer r = (integer) SCR::Execute (.target.bash, sformat ("/usr/sbin/ntpdate '%1'", String::Quote(ntp_server))); y2milestone ("'ntpdate %1' returned %2", ntp_server, r); - Popup::ClearFeedback(); if( !Stage::initial()) { @@ -196,7 +211,9 @@ AddSingleServer(ntp_server); } else - ret = `ntpdate_failed; + ret = `ntpdate_failed; + + Popup::ClearFeedback(); } } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
kmachalkova@svn.opensuse.org