From: <he...@us...> - 2012-04-16 09:46:18
|
Revision: 306 http://simspark.svn.sourceforge.net/simspark/?rev=306&view=rev Author: hedayat Date: 2012-04-16 09:46:12 +0000 (Mon, 16 Apr 2012) Log Message: ----------- Prevents error messages about missing rb files when they are available in the default directory structure. Modified Paths: -------------- trunk/spark/ChangeLog trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp trunk/spark/spark/spark.cpp Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2012-04-16 09:41:37 UTC (rev 305) +++ trunk/spark/ChangeLog 2012-04-16 09:46:12 UTC (rev 306) @@ -1,3 +1,13 @@ +2012-04-12 Hedayat Vatankhah <hed...@gm...> + + * spark/spark.cpp (Spark::Init): + - set default relpath to empty string, since "../../" is not a usable + default value (doesn't work in the current project's directory structure) + and also to prevent "script not found" error messages + + * lib/zeitgeist/scriptserver/scriptserver.cpp (ScriptServer::RunInitScript): + - only check mRelPathPrefix if not empty + 2012-04-10 Hedayat Vatankhah <hed...@gm...> * lib/oxygen/simulationserver/agentcontrol.h: Modified: trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp =================================================================== --- trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp 2012-04-16 09:41:37 UTC (rev 305) +++ trunk/spark/lib/zeitgeist/scriptserver/scriptserver.cpp 2012-04-16 09:46:12 UTC (rev 306) @@ -615,22 +615,24 @@ ERunScriptErrorType result = eNotFound; // Trying directory given in mRelPathPrefix - result = RunInitScriptInternal(mRelPathPrefix, fileName, validDotDir, dotDir); - if (result == eOK) + if (!mRelPathPrefix.empty()) { - GetLog()->Debug() << "(ScriptServer) : Ran init script '" - << mRelPathPrefix << salt::RFile::Sep() << fileName << "'\n"; - return true; + result = RunInitScriptInternal(mRelPathPrefix, fileName, validDotDir, dotDir); + if (result == eOK) + { + GetLog()->Debug() << "(ScriptServer) : Ran init script '" + << mRelPathPrefix << salt::RFile::Sep() << fileName << "'\n"; + return true; + } + else if (result == eError) + { + GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" + << mRelPathPrefix << salt::RFile::Sep() << fileName << "'\n"; + return false; + } } - else if (result == eError) - { - GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" - << mRelPathPrefix << salt::RFile::Sep() << fileName << "'\n"; - return false; - } - if (validDotDir) { // Trying dot-dir in home directory Modified: trunk/spark/spark/spark.cpp =================================================================== --- trunk/spark/spark/spark.cpp 2012-04-16 09:41:37 UTC (rev 305) +++ trunk/spark/spark/spark.cpp 2012-04-16 09:46:12 UTC (rev 306) @@ -100,7 +100,7 @@ Spark::Init(int argc, char** argv) { // See if user gave path prefix for init scripts - string relPathPrefix = "../.."; + string relPathPrefix = ""; for (int i = 1; i < argc; ++i) { if (strcmp(argv[i], "--init-script-prefix") == 0) @@ -120,7 +120,7 @@ ( "spark.rb", "lib/spark", - ScriptServer::IS_COMMON + ScriptServer::IS_USERLOCAL ); UpdateCached(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |