Author: aschnell Date: Mon Aug 11 12:31:50 2008 New Revision: 49922 URL: http://svn.opensuse.org/viewcvs/yast?rev=49922&view=rev Log: - better imbue all streams with classic Modified: trunk/storage/libstorage/src/AsciiFile.cc trunk/storage/libstorage/src/Container.cc trunk/storage/libstorage/src/Dasd.cc trunk/storage/libstorage/src/Disk.cc trunk/storage/libstorage/src/Dm.cc trunk/storage/libstorage/src/EtcFstab.cc trunk/storage/libstorage/src/Md.cc trunk/storage/libstorage/src/MdCo.cc trunk/storage/libstorage/src/Partition.cc trunk/storage/libstorage/src/ProcMounts.cc trunk/storage/libstorage/src/Storage.cc trunk/storage/libstorage/src/StorageTmpl.h trunk/storage/libstorage/src/Volume.cc Modified: trunk/storage/libstorage/src/AsciiFile.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/AsciiFile.cc?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- trunk/storage/libstorage/src/AsciiFile.cc (original) +++ trunk/storage/libstorage/src/AsciiFile.cc Mon Aug 11 12:31:50 2008 @@ -75,6 +75,7 @@ bool AsciiFile::appendFile( const string& Name_Cv, vector<string>& Lines_Cr ) { ifstream File_Ci( Name_Cv.c_str() ); + classic(File_Ci); string Line_Ci; bool Ret_bi = File_Ci.good(); @@ -103,6 +104,7 @@ bool AsciiFile::insertFile( const string& Name_Cv, unsigned int BeforeLine_iv ) { ifstream File_Ci( Name_Cv.c_str() ); + classic(File_Ci); string Line_Ci; vector<string> New_Ci; @@ -178,6 +180,7 @@ BackupCreated_b = true; } ofstream File_Ci( Name_C.c_str() ); + classic(File_Ci); unsigned int Idx_ii = 0; DBG( App_pC->Dbg() << "Writing File:\"" << Name_C << "\"\n"; ) @@ -207,6 +210,7 @@ bool AsciiFile::saveToFile( const string& Name_Cv ) { ofstream File_Ci( Name_Cv.c_str() ); + classic(File_Ci); unsigned int Idx_ii = 0; DBG( App_pC->Dbg() << "SaveToFile File:\"" << Name_Cv << "\"\n"; ) Modified: trunk/storage/libstorage/src/Container.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Container.cc?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- trunk/storage/libstorage/src/Container.cc (original) +++ trunk/storage/libstorage/src/Container.cc Mon Aug 11 12:31:50 2008 @@ -361,6 +361,7 @@ if( uby!=c.uby ) { std::ostringstream b; + classic(b); b << uby << "-->" << string(c.uby); ret += b.str(); } Modified: trunk/storage/libstorage/src/Dasd.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Dasd.cc?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- trunk/storage/libstorage/src/Dasd.cc (original) +++ trunk/storage/libstorage/src/Dasd.cc Mon Aug 11 12:31:50 2008 @@ -131,6 +131,7 @@ y2debug( "Line: %s", Line.c_str() ); std::istringstream Data( Line ); + classic(Data); nr=0; StartM = EndM = 0; @@ -368,6 +369,7 @@ } string inpname = getStorage()->tmpDir()+"/fdasd_inp"; ofstream inpfile( inpname.c_str() ); + classic(inpfile); PartPair p = partPair( notDeleted ); PartIter i = p.begin(); while( i!=p.end() ) Modified: trunk/storage/libstorage/src/Disk.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Disk.cc?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- trunk/storage/libstorage/src/Disk.cc (original) +++ trunk/storage/libstorage/src/Disk.cc Mon Aug 11 12:31:50 2008 @@ -300,6 +300,7 @@ if( access( SysfsFile.c_str(), R_OK )==0 ) { ifstream File( SysfsFile.c_str() ); + classic(File); File >> range; if( range<=1 ) ret = false; } @@ -311,6 +312,7 @@ if( access( SysfsFile.c_str(), R_OK )==0 ) { ifstream File( SysfsFile.c_str() ); + classic(File); char c; File >> mjr; File >> c; @@ -467,6 +469,7 @@ { string fname( Dir + "/disk_" + logfile_name + ".tmp" ); ofstream file( fname.c_str() ); + classic(file); file << "Device: " << dev << endl; if( !udev_path.empty() ) file << "UdevPath: " << udev_path << endl; @@ -1867,6 +1870,7 @@ removePresentPartitions(); system_stderr.erase(); std::ostringstream cmd_line; + classic(cmd_line); cmd_line << PARTEDCMD << quote(device()) << " mklabel " << label; if( execCheckFailed( cmd_line.str() ) ) { @@ -1962,6 +1966,7 @@ } system_stderr.erase(); std::ostringstream cmd_line; + classic(cmd_line); cmd_line << PARTEDCMD << quote(device()) << " set " << p->nr() << " "; string start_cmd = cmd_line.str(); if( ret==0 ) @@ -2043,6 +2048,7 @@ { ProcPart ppart; std::ostringstream cmd_line; + classic(cmd_line); cmd_line << PARTEDCMD << quote(device()) << " unit cyl print | grep -w \"^[ \t]*\"" << p->nr(); SystemCmd cmd( cmd_line.str() ); unsigned nr, id; @@ -2090,12 +2096,14 @@ else { std::ostringstream cmd_line; + classic(cmd_line); cmd_line << PARTEDCMD << quote(device()) << " unit s print | grep -w \"^[ \t]*\"" << p->nr(); SystemCmd cmd( cmd_line.str() ); if( cmd.numLines()>0 ) { string dummy, s1, s2; std::istringstream data( *cmd.getLine(0) ); + classic(data); data >> dummy >> s1 >> s2; y2milestone( "dummy:\"%s\" s1:\"%s\" s2:\"%s\"", dummy.c_str(), s1.c_str(), s2.c_str() ); @@ -2156,6 +2164,7 @@ enlargeGpt(); } std::ostringstream cmd_line; + classic(cmd_line); if( ret==0 ) { cmd_line << PARTEDCMD << quote(device()) << " unit cyl mkpart "; @@ -2341,6 +2350,7 @@ if( ret==0 && !p->created() ) { std::ostringstream cmd_line; + classic(cmd_line); cmd_line << PARTEDCMD << quote(device()) << " rm " << p->OrigNr(); if( execCheckFailed( cmd_line.str() ) ) { @@ -2493,6 +2503,7 @@ y2milestone( "doResize container %s name %s", name().c_str(), p->name().c_str() ); std::ostringstream cmd_line; + classic(cmd_line); unsigned long long start_sect, end_sect; getPartedSectors( p, start_sect, end_sect ); end_sect = start_sect + p->sizeK()*2 - 1; Modified: trunk/storage/libstorage/src/Dm.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Dm.cc?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- trunk/storage/libstorage/src/Dm.cc (original) +++ trunk/storage/libstorage/src/Dm.cc Mon Aug 11 12:31:50 2008 @@ -189,6 +189,7 @@ if( pos != string::npos ) pair[pos] = ' '; istringstream i( pair ); + classic(i); i >> mj >> mi; list<string> ls = splitString(pair); if( cont->majorNr()>0 && mj==cont->majorNr() && mi==cont->minorNr()) @@ -587,6 +588,7 @@ if( pe_map!=rhs.pe_map ) { std::ostringstream b; + classic(b); b << " pe_map:" << pe_map << "-->" << rhs.pe_map; ret += b.str(); } Modified: trunk/storage/libstorage/src/EtcFstab.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/EtcFstab.cc?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- trunk/storage/libstorage/src/EtcFstab.cc (original) +++ trunk/storage/libstorage/src/EtcFstab.cc Mon Aug 11 12:31:50 2008 @@ -30,6 +30,7 @@ { string file = prefix+"/fstab"; ifstream mounts( file.c_str() ); + classic(mounts); string line; unsigned lineno = 0; getline( mounts, line ); @@ -654,6 +655,7 @@ { y2mil( "name:" << fname ); ifstream file( fname.c_str() ); + classic(file); string line; int count = 1; getline( file, line ); Modified: trunk/storage/libstorage/src/Md.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Md.cc?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- trunk/storage/libstorage/src/Md.cc (original) +++ trunk/storage/libstorage/src/Md.cc Mon Aug 11 12:31:50 2008 @@ -641,12 +641,14 @@ if( devs!=rhs.devs ) { std::ostringstream b; + classic(b); b << " Devices:" << devs << "-->" << rhs.devs; log += b.str(); } if( spare!=rhs.spare ) { std::ostringstream b; + classic(b); b << " Spares:" << spare << "-->" << rhs.spare; log += b.str(); } Modified: trunk/storage/libstorage/src/MdCo.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/MdCo.cc?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- trunk/storage/libstorage/src/MdCo.cc (original) +++ trunk/storage/libstorage/src/MdCo.cc Mon Aug 11 12:31:50 2008 @@ -87,6 +87,7 @@ y2milestone( "begin" ); string line; std::ifstream file( "/proc/mdstat" ); + classic(file); unsigned dummy; getline( file, line ); while( file.good() ) @@ -158,6 +159,7 @@ y2milestone( "num:%u", num ); string line; std::ifstream file( "/proc/mdstat" ); + classic(file); string md = "md" + decString(num); getline( file, line ); while( file.good() ) Modified: trunk/storage/libstorage/src/Partition.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Partition.cc?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- trunk/storage/libstorage/src/Partition.cc (original) +++ trunk/storage/libstorage/src/Partition.cc Mon Aug 11 12:31:50 2008 @@ -41,6 +41,7 @@ { string ts, rs; istringstream i( Data ); + classic(i); i >> num >> dev >> size_k >> mjr >> mnr >> reg >> hex >> idt >> dec >> ts >> rs; orig_size_k = size_k; Modified: trunk/storage/libstorage/src/ProcMounts.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/ProcMounts.cc?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- trunk/storage/libstorage/src/ProcMounts.cc (original) +++ trunk/storage/libstorage/src/ProcMounts.cc Mon Aug 11 12:31:50 2008 @@ -22,6 +22,7 @@ getFindRevMap( "/dev/disk/by-label", by_label ); getFindRevMap( "/dev/disk/by-uuid", by_uuid ); ifstream mounts( "/proc/mounts" ); + classic(mounts); string line; getline( mounts, line ); SystemCmd mt(MOUNTBIN); Modified: trunk/storage/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.cc?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- trunk/storage/libstorage/src/Storage.cc (original) +++ trunk/storage/libstorage/src/Storage.cc Mon Aug 11 12:31:50 2008 @@ -103,6 +103,7 @@ defaultMountBy = MOUNTBY_ID; detectMounted = true; ifstream File( "/proc/version" ); + classic(File); string line; getline( File, line ); File.close(); @@ -213,6 +214,7 @@ void Storage::dumpObjectList() { ostringstream buf; + classic(buf); printInfo(buf); std::list<string> l = splitString( buf.str(), "\n" ); y2mil("DETECTED OBJECTS"); @@ -724,12 +726,14 @@ if( access( SysfsFile.c_str(), R_OK )==0 ) { ifstream File( SysfsFile.c_str() ); + classic(File); File >> Range; } SysfsFile = SysfsDir+"/size"; if( access( SysfsFile.c_str(), R_OK )==0 ) { ifstream File( SysfsFile.c_str() ); + classic(File); File >> Size; } string dn = Entry->d_name; @@ -856,6 +860,7 @@ { string fname( Dir + "/volume_info.tmp" ); ofstream file( fname.c_str() ); + classic(file); for( VolIterator i=vBegin(); i!=vEnd(); ++i ) { if( i->getFs()!=FSUNKNOWN ) @@ -3483,6 +3488,7 @@ { co.sort( (stage==DECREASE)?sort_cont_up:sort_cont_down ); std::ostringstream b; + classic(b); if( stage==DECREASE ) { vl.reverse(); @@ -4390,6 +4396,7 @@ Storage::logCo( Container* c ) const { std::ostringstream b; + classic(b); c->print( b ); y2mil( "log co:" << b.str() ); for( Container::ConstPlainIterator i=c->begin(); i!=c->end(); ++i ) Modified: trunk/storage/libstorage/src/StorageTmpl.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageTmpl.h?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- trunk/storage/libstorage/src/StorageTmpl.h (original) +++ trunk/storage/libstorage/src/StorageTmpl.h Mon Aug 11 12:31:50 2008 @@ -124,24 +124,27 @@ template<class Num> string decString(Num number) - { +{ std::ostringstream num_str; + classic(num_str); num_str << number; - return( num_str.str() ); - } + return num_str.str(); +} template<class Num> string hexString(Num number) - { +{ std::ostringstream num_str; + classic(num_str); num_str << std::hex << number; - return( num_str.str() ); - } + return num_str.str(); +} -template<class Value> void operator>>( const string& d, Value& v) - { - std::istringstream Data( d ); +template<class Value> void operator>>(const string& d, Value& v) +{ + std::istringstream Data(d); + classic(Data); Data >> v; - } +} template<class Value> std::ostream& operator<<( std::ostream& s, const std::list<Value>& l ) { Modified: trunk/storage/libstorage/src/Volume.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Volume.cc?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- trunk/storage/libstorage/src/Volume.cc (original) +++ trunk/storage/libstorage/src/Volume.cc Mon Aug 11 12:31:50 2008 @@ -61,6 +61,7 @@ void Volume::setNameDev() { std::ostringstream Buf_Ci; + classic(Buf_Ci); if( numeric ) Buf_Ci << cont->device() << (Disk::needP(cont->device())?"p":"") << num; else @@ -240,6 +241,7 @@ if( found ) { std::ostringstream b; + classic(b); b << "line[" << device() << "]="; b << "noauto:" << entry.noauto; if( mp.empty() ) @@ -271,6 +273,7 @@ { char buf[10]; ifstream file( dev.c_str() ); + classic(file); file.read( buf, sizeof(buf) ); if( file.good() && strncmp( buf, "LUKS", 4 )==0 ) setEncryption( ENC_LUKS ); @@ -329,6 +332,7 @@ { list<string> l = splitString( *loopData.getLine( 0, true )); std::ostringstream b; + classic(b); b << "line[" << device() << "]=" << l; y2mil(b.str()); if( !l.empty() ) @@ -382,6 +386,7 @@ list<string> l = splitString( *blkidData.getLine( 0, true ), " \t\n", true, true, "\"" ); std::ostringstream b; + classic(b); b << "line[" << device() << "]=" << l; y2mil(b.str()); if( !l.empty() ) @@ -698,6 +703,7 @@ if( c.execute( cmd ) != 0 ) ret = VOLUME_FORMAT_DD_FAILED; ofstream s( mountDevice().c_str() ); + classic(s); ofstream::pos_type p = s.seekp( 0, ios_base::end ).tellp(); y2mil( "good:" << s.good() << " pos_type:" << p ); const unsigned count=200; @@ -907,6 +913,7 @@ if( access( path.c_str(), R_OK )==0 ) { ofstream file( path.c_str() ); + classic(file); if( file.good() ) { y2mil( "writing \"add\" to " << path ); @@ -1655,6 +1662,7 @@ do { ofstream pwdfile( fname.c_str() ); + classic(pwdfile); pwdfile << crypt_pwd; pwdfile.close(); encryption = orig_encryption = try_order[pos]; @@ -1765,6 +1773,7 @@ { fname = cont->getStorage()->tmpDir()+"/pwdf"; ofstream pwdfile( fname.c_str() ); + classic(pwdfile); pwdfile << crypt_pwd << endl; pwdfile.close(); } @@ -1870,6 +1879,7 @@ { string fname = cont->getStorage()->tmpDir()+"/pwdf"; ofstream pwdfile( fname.c_str() ); + classic(pwdfile); pwdfile << crypt_pwd; pwdfile.close(); SystemCmd cmd; @@ -2957,6 +2967,7 @@ if( uby!=rhs.uby ) { std::ostringstream b; + classic(b); b << uby << "-->" << string(rhs.uby); ret += b.str(); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org