[yast-commit] r57201 - in /branches/SuSE-SLE-10-SP3-Branch/core: VERSION package/yast2-core.changes wfm/src/WFM.cc wfm/src/Y2WFMComponent.cc wfm/src/Y2WFMComponent.h
Author: juhliarik Date: Fri May 15 18:26:11 2009 New Revision: 57201 URL: http://svn.opensuse.org/viewcvs/yast?rev=57201&view=rev Log: added calling WFM::ClientExist -> necessary for reipl Modified: branches/SuSE-SLE-10-SP3-Branch/core/VERSION branches/SuSE-SLE-10-SP3-Branch/core/package/yast2-core.changes branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/WFM.cc branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/Y2WFMComponent.cc branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/Y2WFMComponent.h Modified: branches/SuSE-SLE-10-SP3-Branch/core/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/core/VERSION?rev=57201&r1=57200&r2=57201&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/core/VERSION (original) +++ branches/SuSE-SLE-10-SP3-Branch/core/VERSION Fri May 15 18:26:11 2009 @@ -1 +1 @@ -2.13.43 +2.13.44 Modified: branches/SuSE-SLE-10-SP3-Branch/core/package/yast2-core.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/core/package/yast2-core.changes?rev=57201&r1=57200&r2=57201&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/core/package/yast2-core.changes (original) +++ branches/SuSE-SLE-10-SP3-Branch/core/package/yast2-core.changes Fri May 15 18:26:11 2009 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Fri May 15 12:21:15 CEST 2009 - juhliarik@suse.cz + +- added WFM::ClientExists because it is required for reipl + (FATE#305938) +- 2.13.44 + +------------------------------------------------------------------- Fri Apr 17 13:51:36 CEST 2009 - juhliarik@suse.cz - added fix for problem with adding nil to list (bnc#216177) Modified: branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/WFM.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/WFM.cc?rev=57201&r1=57200&r2=57201&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/WFM.cc (original) +++ branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/WFM.cc Fri May 15 18:26:11 2009 @@ -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: branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/Y2WFMComponent.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/Y2WFMComponent.cc?rev=57201&r1=57200&r2=57201&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/Y2WFMComponent.cc (original) +++ branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/Y2WFMComponent.cc Fri May 15 18:26:11 2009 @@ -613,6 +613,43 @@ return local.agent ()->Execute (p, arg1); } +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: branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/Y2WFMComponent.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/Y2WFMComponent.h?rev=57201&r1=57200&r2=57201&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/Y2WFMComponent.h (original) +++ branches/SuSE-SLE-10-SP3-Branch/core/wfm/src/Y2WFMComponent.h Fri May 15 18:26:11 2009 @@ -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)
-
juhliarik@svn.opensuse.org