Thread: [Compbench-devel] CompBenchmarks++/libcompbenchmarks/Benchmark Benchmark-Autotools.cpp, 1.1, 1.2 Pa
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-01-25 15:39:19
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8185 Modified Files: Benchmark-Autotools.cpp Package.cpp Log Message: CBM::Config used to handle package related data. Index: Package.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Package.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Package.cpp 22 Jan 2007 18:21:47 -0000 1.1 --- Package.cpp 25 Jan 2007 15:39:15 -0000 1.2 *************** *** 3,6 **** --- 3,7 ---- #include <Benchmark/Benchmark-DLLoader.h> + #include <Base/Config.h> #include <System/System.h> *************** *** 85,124 **** int Package::readStatus(void) { ! char s; ! std::string r; ! std::string id; ! ! id="bm-status-"; ! id+=Name(); ! ! ! r=system->read((char*) id.c_str()); ! ! if (r!="") { ! s=r.c_str()[0]; ! status=(Status) ((int) s - (int) '0'); ! return(1); ! } else { ! /* !!! */ ! return(0); ! } } int Package::resetContext(void) { ! std::string contextFile; ! ! contextFile=system->temporaryDirectory(System::Status); ! contextFile+="/"; ! ! contextFile+="bm-context-"; ! contextFile+=Name(); ! ! return(system->unlink(contextFile)); } std::string Package::localAbsoluteName(void) { ! std::string localFile = system->temporaryDirectory(System::Download); localFile+="/"; --- 86,101 ---- int Package::readStatus(void) { ! return(System()->Config()->getStatus(Name())); } int Package::resetContext(void) { ! System()->Config()->contextReset(Name()); ! return(1); } std::string Package::localAbsoluteName(void) { ! std::string localFile = system->Directory(System::Download); localFile+="/"; *************** *** 132,136 **** std::string cmd; ! cmd+=system->temporaryDirectory(System::Extract); cmd+="/"; cmd+=extractDirectory(); --- 109,113 ---- std::string cmd; ! cmd+=system->Directory(System::Extract); cmd+="/"; cmd+=extractDirectory(); *************** *** 182,200 **** int Package::storeStatus(Status _status) { ! int r; ! char c[16] = { 0 }; ! std::string tmp; ! std::string id; ! ! id="bm-status-"; ! id+=Name(); ! ! sprintf(c, "%d", (int) _status); ! tmp=c; ! r=system->store((char*) id.c_str(), ! tmp); ! ! status=_status; ! return(r); } --- 159,165 ---- int Package::storeStatus(Status _status) { ! System()->Config()->setStatus(Name(), ! _status); ! return(1); } *************** *** 211,226 **** CBM::CompilerOptions *_currentOptions) { ! std::string context = contextID(_currentCompiler, _currentOptions); ! std::string id; ! int r; ! ! id="bm-context-"; ! id+=Name(); ! ! r=system->store((char*) id.c_str(), ! context); ! ! return(r); } --- 176,183 ---- CBM::CompilerOptions *_currentOptions) { ! System()->Config()->setContext(Name(), ! _currentCompiler, _currentOptions); ! return(1); } *************** *** 228,249 **** CBM::CompilerOptions *_currentOptions) { ! std::string previousContext; ! std::string context; ! std::string id; ! ! id="bm-context-"; ! id+=Name(); ! ! previousContext=system->read((char*) id.c_str()); ! context=contextID(_currentCompiler, ! _currentOptions); ! ! if (context==previousContext) { ! currentCompiler=_currentCompiler; ! currentOptions=_currentOptions; ! return(1); ! } else { ! return(0); ! } } --- 185,191 ---- CBM::CompilerOptions *_currentOptions) { ! return(System()->Config()->contextMatches(Name(), ! _currentCompiler, ! _currentOptions)); } *************** *** 330,334 **** info+=localAbsoluteName(); info+=" into "; ! info+=system->temporaryDirectory(System::Extract); cbmUI->Fatal(info); } --- 272,276 ---- info+=localAbsoluteName(); info+=" into "; ! info+=system->Directory(System::Extract); cbmUI->Fatal(info); } *************** *** 627,631 **** int Package::Uninstall(void) { - std::string statusFile; int r; --- 569,572 ---- *************** *** 633,645 **** Name()); - statusFile=system->temporaryDirectory(System::Status); - statusFile+="/"; - statusFile+="bm-status-"; - statusFile+=Name(); - - if (getStatus()!=Unknown) { system->unlink(localAbsoluteName().c_str()); - system->unlink(statusFile.c_str()); resetContext(); r=uninstall(); --- 574,579 ---- Index: Benchmark-Autotools.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Benchmark-Autotools.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Benchmark-Autotools.cpp 22 Jan 2007 18:21:46 -0000 1.1 --- Benchmark-Autotools.cpp 25 Jan 2007 15:39:15 -0000 1.2 *************** *** 20,24 **** cmd+="cd "; ! cmd+=system->temporaryDirectory(CBM::System::Extract); cmd+=" && "; cmd+=CBM_PROG_ZCAT; --- 20,24 ---- cmd+="cd "; ! cmd+=system->Directory(CBM::System::Extract); cmd+=" && "; cmd+=CBM_PROG_ZCAT; |