From: Oliver O. <fr...@us...> - 2007-03-15 06:06:59
|
Update of /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv10448 Modified Files: Tag: WIN32 scriptserver.cpp Log Message: *** empty log message *** Index: scriptserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/scriptserver.cpp,v retrieving revision 1.2.2.4 retrieving revision 1.2.2.5 diff -C2 -d -r1.2.2.4 -r1.2.2.5 *** scriptserver.cpp 27 Feb 2007 07:08:06 -0000 1.2.2.4 --- scriptserver.cpp 15 Mar 2007 06:06:56 -0000 1.2.2.5 *************** *** 32,37 **** #include <sys/stat.h> #ifdef HAVE_CONFIG_H ! #include <config.h> #endif --- 32,47 ---- #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.... :-( ! */ ! #include "../config.h" #endif *************** *** 270,280 **** return false; } ! boost::scoped_array<char> buffer(new char[file->Size() + 1]); file->Read(buffer.get(), file->Size()); buffer[file->Size()] = 0; bool ok = Eval(buffer.get()); UpdateCachedAllNodes(); return ok; } --- 280,293 ---- return false; } ! std::cerr << "Running the script\n"; boost::scoped_array<char> buffer(new char[file->Size() + 1]); file->Read(buffer.get(), file->Size()); buffer[file->Size()] = 0; + std::cerr << "Created buffer\n"; bool ok = Eval(buffer.get()); + std::cerr << "Eval'd buffer\n"; UpdateCachedAllNodes(); + std::cerr << "Updated cached nodes\n"; return ok; } *************** *** 479,482 **** --- 492,496 ---- string sourcePath = sourceDir + salt::PathSeparator + name; GetLog()->Debug() << "(ScriptServer) Running " << sourcePath << "... "; + std::cerr << "(ScriptServer) Running " << sourcePath << "... "; shared_ptr<salt::StdFile> file(new(salt::StdFile)); *************** *** 484,491 **** { GetLog()->Debug() << "failed (script not found)" << endl; return eNotFound; } else if (! Run(file)) { ! GetLog()->Debug() << "failed (error in script" << endl; return eError; } else --- 498,507 ---- { GetLog()->Debug() << "failed (script not found)" << endl; + std::cerr << "failed (script not found)" << endl; return eNotFound; } else if (! Run(file)) { ! GetLog()->Debug() << "failed (error in script)" << endl; ! std::cerr << "failed (error in script)" << endl; return eError; } else *************** *** 599,605 **** string pkgdatadir = PREFIX "/share/" PACKAGE_NAME; ! //std::cout << "dotDir = " << dotDir << std::endl; ! //std::cout << "pkgdatadir = " << pkgdatadir << std::endl; ! //std::cout << "filename = " << fileName << std::endl; #endif --- 615,621 ---- string pkgdatadir = PREFIX "/share/" PACKAGE_NAME; ! std::cerr << "dotDir = " << dotDir << "::"; ! std::cerr << "pkgdatadir = " << pkgdatadir << "::"; ! std::cerr << "filename = " << fileName << '\n'; #endif *************** *** 615,618 **** --- 631,635 ---- GetLog()->Debug() << "(ScriptServer) : Ran init script '" << dotDir << salt::PathSeparator << fileName << "'\n"; + std::cerr << "leaving runinitscript (OK)\n"; return true; } *************** *** 620,623 **** --- 637,641 ---- 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"; *************** *** 625,630 **** --- 643,650 ---- 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; } *************** *** 632,644 **** // result = RunInitScriptInternal(pkgdatadir, fileName, validDotDir, dotDir); if (result == eOK) { GetLog()->Debug() << "(ScriptServer) : Ran init script '" << pkgdatadir << salt::PathSeparator << fileName << "'\n"; return true; } ! if (result == eNotFound) { --- 652,668 ---- // + 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) { *************** *** 653,660 **** ! result = RunInitScriptInternal(mRelPathPrefix+relPath, fileName, validDotDir, dotDir); ! if (result == eNotFound) { GetLog()->Error() << "(ScriptServer) ERROR: Cannot locate init script '" << fileName << "'\n"; --- 677,689 ---- ! 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"; GetLog()->Error() << "(ScriptServer) ERROR: Cannot locate init script '" << fileName << "'\n"; *************** *** 662,669 **** else if (result == eError) { GetLog()->Error() << "(ScriptServer) ERROR: Found error in init script '" << mRelPathPrefix+relPath << salt::PathSeparator << fileName << "'\n"; } ! return (result == eOK); } --- 691,699 ---- else if (result == eError) { + 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); } |