From: Oliver O. <fr...@us...> - 2007-06-17 13:38:48
|
Update of /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21072/zeitgeist/scriptserver Modified Files: .cvsignore scriptserver.cpp scriptserver.h Log Message: merge from projectx branch Index: .cvsignore =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 5 Dec 2005 21:50:02 -0000 1.1 --- .cvsignore 17 Jun 2007 13:38:39 -0000 1.2 *************** *** 2,5 **** --- 2,6 ---- *.lo .deps + .dirstamp .libs Makefile Index: scriptserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/scriptserver.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** scriptserver.cpp 31 Mar 2007 14:20:12 -0000 1.5 --- scriptserver.cpp 17 Jun 2007 13:38:39 -0000 1.6 *************** *** 32,52 **** #include <sys/stat.h> - #undef PREFIX - #undef PACKAGE_NAME - #ifdef HAVE_CONFIG_H ! /* The include search path includes config.h of ruby as well. My system shows a strange behavior ! when resolving the search paths: ! using - include <config.h> - *before* the rubywrapper includes the correct file (our config.h) ! using - include <config.h> - *after* the rubywrapper includes the ruby - config.h ! using the same line before *and* after the rubywrapper includes the correct file before the rubywrapper, ! and the wrong one after.... :-( ! */ ! #ifdef WIN32 ! #include "../../win32/config.h" ! #else ! #include "../config.h" ! #endif ! #endif --- 32,37 ---- #include <sys/stat.h> #ifdef HAVE_CONFIG_H ! #include <sparkconfig.h> #endif *************** *** 264,268 **** rb_define_global_function("dirs", RUBY_METHOD_FUNC(dirs), 0); ! mRelPathPrefix = string("..") + salt::PathSeparator + ".." + salt::PathSeparator; } --- 249,253 ---- rb_define_global_function("dirs", RUBY_METHOD_FUNC(dirs), 0); ! mRelPathPrefix = string("..") + salt::RFile::Sep() + ".." + salt::RFile::Sep(); } *************** *** 285,289 **** return false; } - std::cerr << "Running the script\n"; boost::scoped_array<char> buffer(new char[file->Size() + 1]); file->Read(buffer.get(), file->Size()); --- 270,273 ---- *************** *** 495,499 **** { // run the init script in the sourceDir ! string sourcePath = sourceDir + salt::PathSeparator + name; GetLog()->Debug() << "(ScriptServer) Running " << sourcePath << "... "; std::cerr << "(ScriptServer) Running " << sourcePath << "... "; --- 479,483 ---- { // run the init script in the sourceDir ! string sourcePath = sourceDir + salt::RFile::Sep() + name; GetLog()->Debug() << "(ScriptServer) Running " << sourcePath << "... "; std::cerr << "(ScriptServer) Running " << sourcePath << "... "; *************** *** 508,512 **** { GetLog()->Debug() << "failed (error in script)" << endl; - std::cerr << "failed (error in script)" << endl; return eError; } else --- 492,495 ---- *************** *** 521,525 **** } ! string destPath = destDir + salt::PathSeparator + name; GetLog()->Normal() << "Copying " << sourcePath --- 504,508 ---- } ! string destPath = destDir + salt::RFile::Sep() + name; GetLog()->Normal() << "Copying " << sourcePath *************** *** 556,560 **** } ! dotDir = string(home) + salt::PathSeparator + mDotName; return true; } --- 539,543 ---- } ! dotDir = string(home) + salt::RFile::Sep() + mDotName; return true; } *************** *** 614,629 **** CreateDotDir(dotDir); ! #ifdef WIN32 ! string pkgdatadir = ".\\"; ! #else ! // some macro magic (not at all) ! string pkgdatadir = PREFIX "/share/" PACKAGE_NAME; ! ! std::cerr << "dotDir = " << dotDir << "::"; ! std::cerr << "pkgdatadir = " << pkgdatadir << "::"; ! std::cerr << "filename = " << fileName << '\n'; #endif ! ERunScriptErrorType result = eUninit; if (validDotDir) --- 597,607 ---- CreateDotDir(dotDir); ! // get the (OS specific) path to the script directory ! string pkgdatadir = salt::RFile::BundlePath(); ! #if __APPLE__ ! pkgdatadir += "Contents/Resources/"; #endif ! ERunScriptErrorType result = eNotFound; if (validDotDir) *************** *** 635,640 **** { GetLog()->Debug() << "(ScriptServer) : Ran init script '" ! << dotDir << salt::PathSeparator << fileName << "'\n"; ! std::cerr << "leaving runinitscript (OK)\n"; return true; } --- 613,617 ---- { GetLog()->Debug() << "(ScriptServer) : Ran init script '" ! << dotDir << salt::RFile::Sep() << fileName << "'\n"; return true; } *************** *** 642,655 **** if (result == eNotFound) { - std::cerr << "init script not found " << dotDir << salt::PathSeparator << fileName << "\n"; GetLog()->Debug() << "(ScriptServer) : Did not find init script '" ! << dotDir << salt::PathSeparator << fileName << "'\n"; } else if (result == eError) { - std::cerr << "error in init script\n"; GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" ! << dotDir << salt::PathSeparator << fileName << "'\n"; ! std::cerr << "leaving runinitscript (ERROR 1)\n"; return false; } --- 619,629 ---- if (result == eNotFound) { GetLog()->Debug() << "(ScriptServer) : Did not find init script '" ! << dotDir << salt::RFile::Sep() << fileName << "'\n"; } else if (result == eError) { GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" ! << dotDir << salt::RFile::Sep() << fileName << "'\n"; return false; } *************** *** 657,692 **** // - std::cerr << "RunInitScriptInternal(" << pkgdatadir << ", " << fileName << ", " - << validDotDir << ", " << dotDir << ") (1)\n"; result = RunInitScriptInternal(pkgdatadir, fileName, validDotDir, dotDir); if (result == eOK) { - std::cerr << "Ran init script from pkgdatadir: " << pkgdatadir << salt::PathSeparator << fileName << "\n"; GetLog()->Debug() << "(ScriptServer) : Ran init script '" ! << pkgdatadir << salt::PathSeparator << fileName << "'\n"; ! std::cerr << "leaving runinitscript (OK 2)\n"; return true; } ! if (result == eNotFound) { GetLog()->Debug() << "(ScriptServer) : Did not find init script '" ! << pkgdatadir << salt::PathSeparator << fileName << "'\n"; } else if (result == eError) { GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" ! << pkgdatadir << salt::PathSeparator << fileName << "'\n"; } - std::cerr << "RunInitScriptInternal(" << mRelPathPrefix+relPath << ", " << fileName << ", " - << validDotDir << ", " << dotDir << ") (2)\n"; - result = RunInitScriptInternal(mRelPathPrefix+relPath, fileName, validDotDir, dotDir); ! if (result == eOK) ! std::cerr << "Ran init script OK from : " << mRelPathPrefix+relPath << "\n"; ! else if (result == eNotFound) { std::cerr << "init script not found at " << mRelPathPrefix+relPath << "\n"; --- 631,657 ---- // result = RunInitScriptInternal(pkgdatadir, fileName, validDotDir, dotDir); if (result == eOK) { GetLog()->Debug() << "(ScriptServer) : Ran init script '" ! << pkgdatadir << salt::RFile::Sep() << fileName << "'\n"; return true; } ! if (result == eNotFound) { GetLog()->Debug() << "(ScriptServer) : Did not find init script '" ! << pkgdatadir << salt::RFile::Sep() << fileName << "'\n"; } else if (result == eError) { GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" ! << pkgdatadir << salt::RFile::Sep() << fileName << "'\n"; } result = RunInitScriptInternal(mRelPathPrefix+relPath, fileName, validDotDir, dotDir); ! if (result == eNotFound) { std::cerr << "init script not found at " << mRelPathPrefix+relPath << "\n"; *************** *** 698,705 **** std::cerr << "error in init script found at " << mRelPathPrefix+relPath << "\n"; GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" ! << mRelPathPrefix+relPath << salt::PathSeparator << fileName << "'\n"; } ! std::cerr << "leaving runinitscript (FINAL)\n"; return (result == eOK); } - --- 663,669 ---- std::cerr << "error in init script found at " << mRelPathPrefix+relPath << "\n"; GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" ! << mRelPathPrefix+relPath << salt::RFile::Sep() << fileName << "'\n"; } ! return (result == eOK); } |