|
|
|
@ -291,22 +291,22 @@ void DPkgPM::dpkgMonitor ()
|
|
|
|
|
|
|
|
|
|
// parse status updates from dpkg
|
|
|
|
|
while ( true ) {
|
|
|
|
|
std::string::size_type colon, nl = b.tqfind( '\n' );
|
|
|
|
|
std::string::size_type colon, nl = b.find( '\n' );
|
|
|
|
|
m_statusBuffer.append( string( b, 0, nl ) );
|
|
|
|
|
if ( nl == std::string::npos )
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
// cerr << "dpkg status completed line: " << m_statusBuffer << endl;
|
|
|
|
|
colon = m_statusBuffer.tqfind( ": " );
|
|
|
|
|
colon = m_statusBuffer.find( ": " );
|
|
|
|
|
string l( m_statusBuffer, 0, colon );
|
|
|
|
|
string r( m_statusBuffer, colon + 2, string::npos );
|
|
|
|
|
|
|
|
|
|
if ( l == "status" ) {
|
|
|
|
|
colon = r.tqfind( ": " );
|
|
|
|
|
colon = r.find( ": " );
|
|
|
|
|
std::string p( r, 0, colon );
|
|
|
|
|
r = string( r, colon + 2, string::npos );
|
|
|
|
|
|
|
|
|
|
colon = r.tqfind( ": " );
|
|
|
|
|
colon = r.find( ": " );
|
|
|
|
|
std::string e( r, 0, colon );
|
|
|
|
|
if ( colon == string::npos )
|
|
|
|
|
r = "";
|
|
|
|
@ -317,7 +317,7 @@ void DPkgPM::dpkgMonitor ()
|
|
|
|
|
|
|
|
|
|
b = string( b, nl + 1, string::npos );
|
|
|
|
|
m_statusBuffer = string();
|
|
|
|
|
nl = b.tqfind( '\n' );
|
|
|
|
|
nl = b.find( '\n' );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -348,7 +348,7 @@ bool DPkgPM::runScripts (const char *Cnf, bool sP)
|
|
|
|
|
// Determine the protocol version
|
|
|
|
|
string OptSec = Opts->Value;
|
|
|
|
|
string::size_type Pos;
|
|
|
|
|
if ((Pos = OptSec.tqfind(' ')) == string::npos || Pos == 0)
|
|
|
|
|
if ((Pos = OptSec.find(' ')) == string::npos || Pos == 0)
|
|
|
|
|
Pos = OptSec.length();
|
|
|
|
|
OptSec = "DPkg::Tools::Options::" + string(Opts->Value.c_str(),Pos);
|
|
|
|
|
|
|
|
|
|