summaryrefslogtreecommitdiff
authorkergoth <kergoth>2002-11-29 18:58:15 (UTC)
committer kergoth <kergoth>2002-11-29 18:58:15 (UTC)
commit17906c7fefc001c74af2141610c23c28c28a4e52 (patch) (unidiff)
tree527fe02d74b54debefd4f66eb5989e14a6d2d1ba
parentd85d0022270da220f219764593c98dc8f28439b7 (diff)
downloadopie-17906c7fefc001c74af2141610c23c28c28a4e52.zip
opie-17906c7fefc001c74af2141610c23c28c28a4e52.tar.gz
opie-17906c7fefc001c74af2141610c23c28c28a4e52.tar.bz2
Compile fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index 1efe030..407abe9 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -357,129 +357,129 @@ int Ipkg :: executeIpkgCommand( QString &cmd, const QString option )
357 int start = lineStr.find( " " ) + 1; 357 int start = lineStr.find( " " ) + 1;
358 int end = lineStr.find( " ", start ); 358 int end = lineStr.find( " ", start );
359 QString *package = new QString( lineStr.mid( start, end-start ) ); 359 QString *package = new QString( lineStr.mid( start, end-start ) );
360 dependantPackages->append( package ); 360 dependantPackages->append( package );
361 } 361 }
362 } 362 }
363 363
364 if ( option == "update" ) 364 if ( option == "update" )
365 { 365 {
366 if (lineStr.contains("Updated list")) 366 if (lineStr.contains("Updated list"))
367 ret = true; 367 ret = true;
368 } 368 }
369 else if ( option == "download" ) 369 else if ( option == "download" )
370 { 370 {
371 if (lineStr.contains("Downloaded")) 371 if (lineStr.contains("Downloaded"))
372 ret = true; 372 ret = true;
373 } 373 }
374 else 374 else
375 { 375 {
376 if (lineStr.contains("Done")) 376 if (lineStr.contains("Done"))
377 ret = true; 377 ret = true;
378 } 378 }
379 379
380 emit outputText( lineStr ); 380 emit outputText( lineStr );
381 } 381 }
382 lineStrOld = lineStr; 382 lineStrOld = lineStr;
383 qApp->processEvents(); 383 qApp->processEvents();
384 } 384 }
385 pclose(fp); 385 pclose(fp);
386 } 386 }
387 387
388 return ret; 388 return ret;
389} 389}
390*/ 390*/
391 391
392void Ipkg :: linkPackage( const QString &packFileName, const QString &dest, const QString &destDir ) 392void Ipkg :: linkPackage( const QString &packFileName, const QString &dest, const QString &destDir )
393{ 393{
394 if ( dest == "root" || dest == "/" ) 394 if ( dest == "root" || dest == "/" )
395 return; 395 return;
396 396
397 qApp->processEvents(); 397 qApp->processEvents();
398 QStringList *fileList = getList( packFileName, destDir ); 398 QStringList *fileList = getList( packFileName, destDir );
399 qApp->processEvents(); 399 qApp->processEvents();
400 processFileList( fileList, destDir ); 400 processFileList( fileList, destDir );
401 delete fileList; 401 delete fileList;
402} 402}
403 403
404QStringList* Ipkg :: getList( const QString &packageFilename, const QString &destDir ) 404QStringList* Ipkg :: getList( const QString &packageFilename, const QString &destDir )
405{ 405{
406 QString packageFileDir = destDir+"/usr/lib/ipkg/info/"+packageFilename+".list"; 406 QString packageFileDir = destDir+"/usr/lib/ipkg/info/"+packageFilename+".list";
407 QFile f( packageFileDir ); 407 QFile f( packageFileDir );
408 408
409 cout << "Try to open " << packageFileDir << endl; 409 cout << "Try to open " << packageFileDir << endl;
410 if ( !f.open(IO_ReadOnly) ) 410 if ( !f.open(IO_ReadOnly) )
411 { 411 {
412 // Couldn't open from dest, try from / 412 // Couldn't open from dest, try from /
413 cout << "Could not open:" << packageFileDir << endl; 413 cout << "Could not open:" << packageFileDir << endl;
414 f.close(); 414 f.close();
415 415
416 packageFileDir = "/usr/lib/ipkg/info/"+packageFilename+".list"; 416 packageFileDir = "/usr/lib/ipkg/info/"+packageFilename+".list";
417 f.setName( packageFileDir ); 417 f.setName( packageFileDir );
418 qDebug( "Try to open %s", packageFileDir.latin1() ); 418 qDebug( "Try to open %s", packageFileDir.latin1() );
419 if ( ! f.open(IO_ReadOnly) ) 419 if ( ! f.open(IO_ReadOnly) )
420 { 420 {
421 qDebug( "Could not open: %s", packageFileDir ); 421 qDebug( "Could not open: %s", packageFileDir.latin1() );
422 emit outputText( QString( "Could not open :" ) + packageFileDir ); 422 emit outputText( QString( "Could not open :" ) + packageFileDir );
423 return (QStringList*)0; 423 return (QStringList*)0;
424 } 424 }
425 } 425 }
426 QStringList *fileList = new QStringList(); 426 QStringList *fileList = new QStringList();
427 QTextStream t( &f ); 427 QTextStream t( &f );
428 while ( !t.eof() ) 428 while ( !t.eof() )
429 *fileList += t.readLine(); 429 *fileList += t.readLine();
430 430
431 f.close(); 431 f.close();
432 return fileList; 432 return fileList;
433} 433}
434 434
435void Ipkg :: processFileList( const QStringList *fileList, const QString &destDir ) 435void Ipkg :: processFileList( const QStringList *fileList, const QString &destDir )
436{ 436{
437 if ( !fileList || fileList->isEmpty() ) 437 if ( !fileList || fileList->isEmpty() )
438 return; 438 return;
439 439
440 QString baseDir = ROOT; 440 QString baseDir = ROOT;
441 441
442 if ( createLinks == true ) 442 if ( createLinks == true )
443 { 443 {
444 for ( uint i=0; i < fileList->count(); i++ ) 444 for ( uint i=0; i < fileList->count(); i++ )
445 { 445 {
446 processLinkDir( (*fileList)[i], baseDir, destDir ); 446 processLinkDir( (*fileList)[i], baseDir, destDir );
447 qApp->processEvents(); 447 qApp->processEvents();
448 } 448 }
449 } 449 }
450 else 450 else
451 { 451 {
452 for ( int i = fileList->count()-1; i >= 0 ; i-- ) 452 for ( int i = fileList->count()-1; i >= 0 ; i-- )
453 { 453 {
454 processLinkDir( (*fileList)[i], baseDir, destDir ); 454 processLinkDir( (*fileList)[i], baseDir, destDir );
455 qApp->processEvents(); 455 qApp->processEvents();
456 } 456 }
457 } 457 }
458} 458}
459 459
460void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const QString &baseDir ) 460void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const QString &baseDir )
461{ 461{
462 462
463 QString sourceFile = baseDir + file; 463 QString sourceFile = baseDir + file;
464 464
465 QString linkFile = destDir; 465 QString linkFile = destDir;
466 if ( file.startsWith( "/" ) && destDir.right( 1 ) == "/" ) 466 if ( file.startsWith( "/" ) && destDir.right( 1 ) == "/" )
467 { 467 {
468 linkFile += file.mid( 1 ); 468 linkFile += file.mid( 1 );
469 } 469 }
470 else 470 else
471 { 471 {
472 linkFile += file; 472 linkFile += file;
473 } 473 }
474 QString text; 474 QString text;
475 if ( createLinks ) 475 if ( createLinks )
476 { 476 {
477 // If this file is a directory (ends with a /) and it doesn't exist, 477 // If this file is a directory (ends with a /) and it doesn't exist,
478 // we need to create it 478 // we need to create it
479 if ( file.right(1) == "/" ) 479 if ( file.right(1) == "/" )
480 { 480 {
481 QFileInfo f( linkFile ); 481 QFileInfo f( linkFile );
482 if ( !f.exists() ) 482 if ( !f.exists() )
483 { 483 {
484 emit outputText( QString( "Creating directory " ) + linkFile ); 484 emit outputText( QString( "Creating directory " ) + linkFile );
485 QDir d; 485 QDir d;