author | andyq <andyq> | 2002-12-20 13:00:05 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-12-20 13:00:05 (UTC) |
commit | 48bab4b65417d12dac1e2ef61f9b059fc5dabdcc (patch) (unidiff) | |
tree | 0ac43a75511b3b0feed0c357ecc21a31b09c1afa | |
parent | 9328bf79f49294e14c1753c9ee17ddd2985c1969 (diff) | |
download | opie-48bab4b65417d12dac1e2ef61f9b059fc5dabdcc.zip opie-48bab4b65417d12dac1e2ef61f9b059fc5dabdcc.tar.gz opie-48bab4b65417d12dac1e2ef61f9b059fc5dabdcc.tar.bz2 |
Should create links for installed dependant packages again
-rw-r--r-- | noncore/settings/aqpkg/ipkg.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp index 7afe04f..29bf40d 100644 --- a/noncore/settings/aqpkg/ipkg.cpp +++ b/noncore/settings/aqpkg/ipkg.cpp | |||
@@ -282,64 +282,79 @@ int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString option ) | |||
282 | connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), | 282 | connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), |
283 | this, SLOT(commandStderr(OProcess *, char *, int))); | 283 | this, SLOT(commandStderr(OProcess *, char *, int))); |
284 | 284 | ||
285 | for ( QStringList::Iterator it = cmd.begin(); it != cmd.end(); ++it ) | 285 | for ( QStringList::Iterator it = cmd.begin(); it != cmd.end(); ++it ) |
286 | { | 286 | { |
287 | qDebug( "%s ", (*it).latin1() ); | 287 | qDebug( "%s ", (*it).latin1() ); |
288 | *proc << (*it).latin1(); | 288 | *proc << (*it).latin1(); |
289 | } | 289 | } |
290 | cout << endl; | 290 | cout << endl; |
291 | 291 | ||
292 | // Start the process going | 292 | // Start the process going |
293 | finished = false; | 293 | finished = false; |
294 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) | 294 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) |
295 | { | 295 | { |
296 | emit outputText( QString( "Couldn't start ipkg process" ) ); | 296 | emit outputText( QString( "Couldn't start ipkg process" ) ); |
297 | qDebug( "Couldn't start ipkg process!" ); | 297 | qDebug( "Couldn't start ipkg process!" ); |
298 | } | 298 | } |
299 | 299 | ||
300 | // Now wait for it to finish | 300 | // Now wait for it to finish |
301 | while ( !finished ) | 301 | while ( !finished ) |
302 | qApp->processEvents(); | 302 | qApp->processEvents(); |
303 | } | 303 | } |
304 | 304 | ||
305 | void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) | 305 | void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) |
306 | { | 306 | { |
307 | qDebug("received stdout %d bytes", buflen); | 307 | qDebug("received stdout %d bytes", buflen); |
308 | 308 | ||
309 | QString lineStr = buffer; | 309 | QString lineStr = buffer; |
310 | if ( lineStr[buflen-1] == '\n' ) | 310 | if ( lineStr[buflen-1] == '\n' ) |
311 | buflen --; | 311 | buflen --; |
312 | lineStr = lineStr.left( buflen ); | 312 | lineStr = lineStr.left( buflen ); |
313 | emit outputText( lineStr ); | 313 | emit outputText( lineStr ); |
314 | |||
315 | // check if we are installing dependant packages | ||
316 | if ( option == "install" || option == "reinstall" ) | ||
317 | { | ||
318 | // Need to keep track of any dependant packages that get installed | ||
319 | // so that we can create links to them as necessary | ||
320 | if ( lineStr.startsWith( "Installing " ) ) | ||
321 | { | ||
322 | int start = lineStr.find( " " ) + 1; | ||
323 | int end = lineStr.find( " ", start ); | ||
324 | QString *package = new QString( lineStr.mid( start, end-start ) ); | ||
325 | dependantPackages->append( package ); | ||
326 | } | ||
327 | } | ||
328 | |||
314 | qDebug(lineStr); | 329 | qDebug(lineStr); |
315 | buffer[0] = '\0'; | 330 | buffer[0] = '\0'; |
316 | } | 331 | } |
317 | 332 | ||
318 | void Ipkg::commandStderr(OProcess*, char *buffer, int buflen) | 333 | void Ipkg::commandStderr(OProcess*, char *buffer, int buflen) |
319 | { | 334 | { |
320 | qDebug("received stderrt %d bytes", buflen); | 335 | qDebug("received stderrt %d bytes", buflen); |
321 | 336 | ||
322 | QString lineStr = buffer; | 337 | QString lineStr = buffer; |
323 | if ( lineStr[buflen-1] == '\n' ) | 338 | if ( lineStr[buflen-1] == '\n' ) |
324 | buflen --; | 339 | buflen --; |
325 | lineStr=lineStr.left( buflen ); | 340 | lineStr=lineStr.left( buflen ); |
326 | emit outputText( lineStr ); | 341 | emit outputText( lineStr ); |
327 | buffer[0] = '\0'; | 342 | buffer[0] = '\0'; |
328 | } | 343 | } |
329 | 344 | ||
330 | void Ipkg::processFinished() | 345 | void Ipkg::processFinished() |
331 | { | 346 | { |
332 | delete proc; | 347 | delete proc; |
333 | proc = 0; | 348 | proc = 0; |
334 | finished = true; | 349 | finished = true; |
335 | } | 350 | } |
336 | 351 | ||
337 | 352 | ||
338 | void Ipkg :: abort() | 353 | void Ipkg :: abort() |
339 | { | 354 | { |
340 | if ( proc ) | 355 | if ( proc ) |
341 | { | 356 | { |
342 | proc->kill(); | 357 | proc->kill(); |
343 | aborted = true; | 358 | aborted = true; |
344 | } | 359 | } |
345 | } | 360 | } |