[yast-commit] r50735 - in /trunk/core: VERSION package/yast2-core.changes wfm/src/WFM.cc wfm/src/Y2WFMComponent.cc wfm/src/Y2WFMComponent.h
Author: locilka Date: Fri Sep 5 14:00:14 2008 New Revision: 50735 URL: http://svn.opensuse.org/viewcvs/yast?rev=50735&view=rev Log: - Added WFM::ClientExists function (needed for installation). - 2.17.10 Modified: trunk/core/VERSION trunk/core/package/yast2-core.changes trunk/core/wfm/src/WFM.cc trunk/core/wfm/src/Y2WFMComponent.cc trunk/core/wfm/src/Y2WFMComponent.h Modified: trunk/core/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/VERSION?rev=50735&r1=50734&r2=50735&view=diff ============================================================================== --- trunk/core/VERSION (original) +++ trunk/core/VERSION Fri Sep 5 14:00:14 2008 @@ -1 +1 @@ -2.17.9 +2.17.10 Modified: trunk/core/package/yast2-core.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/package/yast2-core.changes?rev=50735&r1=50734&r2=50735&view=diff ============================================================================== --- trunk/core/package/yast2-core.changes (original) +++ trunk/core/package/yast2-core.changes Fri Sep 5 14:00:14 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Sep 5 13:59:32 CEST 2008 - locilka@suse.cz + +- Added WFM::ClientExists function (needed for installation). +- 2.17.10 + +------------------------------------------------------------------- Wed Aug 27 12:13:27 CEST 2008 - locilka@suse.cz - Enabled getenv builtin. Modified: trunk/core/wfm/src/WFM.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/wfm/src/WFM.cc?rev=50735&r1=50734&r2=50735&view=diff ============================================================================== --- trunk/core/wfm/src/WFM.cc (original) +++ trunk/core/wfm/src/WFM.cc Fri Sep 5 14:00:14 2008 @@ -74,6 +74,12 @@ return Y2WFMComponent::instance ()->CallFunction (name); } +static YCPBoolean +WFMClientExists (const YCPString& name) +{ + return Y2WFMComponent::instance ()->ClientExists (name); +} + static YCPValue WFMCallFunction1 (const YCPString& name, const YCPList& args) { @@ -185,6 +191,7 @@ { "Write", "boolean (path, any, any)", (void*)WFMWrite3}, { "Write", "boolean (path, any)", (void*)WFMWrite2}, { "Execute", "any (path, any)", (void*)WFMExecute}, + { "ClientExists", "boolean (string)", (void*)WFMClientExists}, { 0 } }; Modified: trunk/core/wfm/src/Y2WFMComponent.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/wfm/src/Y2WFMComponent.cc?rev=50735&r1=50734&r2=50735&view=diff ============================================================================== --- trunk/core/wfm/src/Y2WFMComponent.cc (original) +++ trunk/core/wfm/src/Y2WFMComponent.cc Fri Sep 5 14:00:14 2008 @@ -627,6 +627,44 @@ } +YCPBoolean +Y2WFMComponent::ClientExists (const YCPString& client) +{ + /** + * @builtin ClientExists + * @short Checks whether a YCP client exists + * @param string name client name + * + * @description + * This is similar to 'call' or 'CallFunction' but client is only + * checked for existence and not executed. If client exists + * 'true' is returned, otherwise 'false'. + * + * @usage ClientExists ("inst_mouse") -> true + * @usage ClientExists ("missing_client") -> false + * @return boolean whether client exists + */ + + string new_modulename = client->value (); + + if (client.isNull() || new_modulename == "") + { + y2error ("Client name not defined %s", new_modulename.c_str()); + return YCPBoolean (false); + } + + // try loading a client via Y2ComponentBroker + Y2Component* client_comp = Y2ComponentBroker::createClient (new_modulename.c_str ()); + if (client_comp) + { + return YCPBoolean (true); + } + else + { + return YCPBoolean (false); + } +} + YCPValue Y2WFMComponent::CallFunction (const YCPString& client, const YCPList& args) { Modified: trunk/core/wfm/src/Y2WFMComponent.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/wfm/src/Y2WFMComponent.h?rev=50735&r1=50734&r2=50735&view=diff ============================================================================== --- trunk/core/wfm/src/Y2WFMComponent.h (original) +++ trunk/core/wfm/src/Y2WFMComponent.h Fri Sep 5 14:00:14 2008 @@ -72,6 +72,7 @@ YCPValue Execute (const YCPPath &path, const YCPValue& arg1); YCPValue CallFunction (const YCPString& client, const YCPList& args = YCPList ()); YCPString GetEnvironmentEncoding (); + YCPBoolean ClientExists (const YCPString& client); virtual Y2Namespace* import (const char* name_space); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
locilka@svn.opensuse.org