summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/packagelist.cpp2
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp36
2 files changed, 20 insertions, 18 deletions
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp
index f6c4c37..844f43f 100644
--- a/noncore/unsupported/oipkg/packagelist.cpp
+++ b/noncore/unsupported/oipkg/packagelist.cpp
@@ -47,49 +47,49 @@ PackageList::~PackageList()
47 47
48/** Inserts a package into the list */ 48/** Inserts a package into the list */
49void PackageList::insertPackage( Package* pack ) 49void PackageList::insertPackage( Package* pack )
50{ 50{
51 if (!pack) return; 51 if (!pack) return;
52 Package* p = packageListAll->find( pack->name() ); 52 Package* p = packageListAll->find( pack->name() );
53 if ( p ) 53 if ( p )
54 { 54 {
55 if ( (p->version() == pack->version()) 55 if ( (p->version() == pack->version())
56 // && (p->dest() == pack->dest()) 56 // && (p->dest() == pack->dest())
57 ) 57 )
58 { 58 {
59 p->copyValues( pack ); 59 p->copyValues( pack );
60 delete pack; 60 delete pack;
61 pack = p; 61 pack = p;
62 } else { 62 } else {
63 QDict<Package> *packver = p->getOtherVersions(); 63 QDict<Package> *packver = p->getOtherVersions();
64 // p->setName( pack->name()+"["+p->version()+"]" ); 64 // p->setName( pack->name()+"["+p->version()+"]" );
65 if (!packver) 65 if (!packver)
66 { 66 {
67 packver = new QDict<Package>(); 67 packver = new QDict<Package>();
68 packver->insert( pack->name(), p ); 68 packver->insert( pack->name(), p );
69 p->setOtherVersions( packver ); 69 p->setOtherVersions( packver );
70 } 70 }
71 pack->setName( pack->name()+"["+pack->version()+"]" ); 71 pack->setName( pack->name() );//+"["+pack->version()+"]" );
72 pack->setOtherVersions( packver ); 72 pack->setOtherVersions( packver );
73 packver->insert( pack->name(), pack ); 73 packver->insert( pack->name(), pack );
74 packageListAll->insert( pack->name(), pack ); 74 packageListAll->insert( pack->name(), pack );
75 packageList.insert( pack->name(), pack ); 75 packageList.insert( pack->name(), pack );
76 origPackageList.insert( pack->name(), pack ); 76 origPackageList.insert( pack->name(), pack );
77 } 77 }
78 }else{ 78 }else{
79 packageListAll->insert( pack->name(), pack ); 79 packageListAll->insert( pack->name(), pack );
80 packageList.insert( pack->name(), pack ); 80 packageList.insert( pack->name(), pack );
81 origPackageList.insert( pack->name(), pack ); 81 origPackageList.insert( pack->name(), pack );
82 }; 82 };
83 empty=false; 83 empty=false;
84 updateSections( pack ); 84 updateSections( pack );
85} 85}
86 86
87void PackageList::filterPackages( QString f ) 87void PackageList::filterPackages( QString f )
88 { 88 {
89 packageList.clear(); 89 packageList.clear();
90 QDictIterator<Package> filterIter( origPackageList ); 90 QDictIterator<Package> filterIter( origPackageList );
91 filterIter.toFirst(); 91 filterIter.toFirst();
92 Package *pack= filterIter.current() ; 92 Package *pack= filterIter.current() ;
93 while ( pack ) 93 while ( pack )
94 { 94 {
95 if ( 95 if (
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 2ed86ee..bffad15 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -52,66 +52,70 @@ PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlag
52 this, SLOT(getIpkgOutput(OProcess*,char*,int))); 52 this, SLOT(getIpkgOutput(OProcess*,char*,int)));
53 installDialog = 0; 53 installDialog = 0;
54#endif 54#endif
55} 55}
56 56
57PmIpkg::~PmIpkg() 57PmIpkg::~PmIpkg()
58{ 58{
59#ifdef OPROCESS 59#ifdef OPROCESS
60 delete ipkgProcess; 60 delete ipkgProcess;
61#endif 61#endif
62} 62}
63 63
64bool PmIpkg::runIpkg(const QString& args, const QString& dest ) 64bool PmIpkg::runIpkg(const QString& args, const QString& dest )
65{ 65{
66 bool ret=false; 66 bool ret=false;
67 QDir::setCurrent("/tmp"); 67 QDir::setCurrent("/tmp");
68 QString cmd = "/usr/bin/ipkg "; 68 QString cmd = "/usr/bin/ipkg ";
69#ifdef OPROCESS 69#ifdef OPROCESS
70 ipkgProcess->kill(); 70 ipkgProcess->kill();
71 ipkgProcess->clearArguments(); 71 ipkgProcess->clearArguments();
72 *ipkgProcess << "/usr/bin/ipkg "; 72 *ipkgProcess << "/usr/bin/ipkg ";
73 cmd = ""; 73 cmd = "";
74#endif 74#endif
75 pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); 75 pvDebug( 3,"PmIpkg::runIpkg got dest="+dest);
76 if ( dest == "" ) 76 if (!args.contains("update"))
77 cmd += " -dest "+settings->getDestinationName(); 77 {
78 else 78 if ( dest == "" )
79 cmd += " -dest "+ dest; 79 cmd += " -dest "+settings->getDestinationName();
80 else
81 cmd += " -dest "+ dest;
80 82
81 cmd += " -force-defaults "; 83 cmd += " -force-defaults ";
82 84
83 if (installDialog && installDialog->_force_depends) 85 if ( installDialog && installDialog->_force_depends )
84 { 86 {
85 if (installDialog->_force_depends->isChecked()) 87 if (installDialog->_force_depends->isChecked())
86 cmd += " -force-depends "; 88 cmd += " -force-depends ";
87 if (installDialog->_force_reinstall->isChecked()) 89 if (installDialog->_force_reinstall->isChecked())
88 cmd += " -force-reinstall "; 90 cmd += " -force-reinstall ";
89 if (installDialog->_force_remove->isChecked()) 91 if (installDialog->_force_remove->isChecked())
90 cmd += " -force-removal-of-essential-packages "; 92 cmd += " -force-removal-of-essential-packages ";
91 } 93 }
94 } //!args.contains("update")
92 95
93 out( "Starting to "+ args+"\n"); 96 out( "Starting to "+ args+"\n");
97 qApp->processEvents();
94 cmd += args; 98 cmd += args;
95 out( "running:\n"+cmd+"\n" ); 99 out( "running:\n"+cmd+"\n" );
96 pvDebug(2,"running:"+cmd); 100 pvDebug(2,"running:"+cmd);
97#ifdef OPROCESS 101#ifdef OPROCESS
98 *ipkgProcess << args; 102 *ipkgProcess << args;
99 out( "running:\n" + cmd); 103 out( "running:\n" + cmd);
100 *ipkgProcess << cmd; 104 *ipkgProcess << cmd;
101 105
102//debug 106//debug
103 delete ipkgProcess; 107 delete ipkgProcess;
104 ipkgProcess = new OProcess(); 108 ipkgProcess = new OProcess();
105 ipkgProcess->clearArguments(); 109 ipkgProcess->clearArguments();
106 *ipkgProcess << "/bin/ls "; 110 *ipkgProcess << "/bin/ls ";
107//debug 111//debug
108 QValueList<QCString> a = ipkgProcess->args(); 112 QValueList<QCString> a = ipkgProcess->args();
109 QValueList<QCString>::Iterator it; 113 QValueList<QCString>::Iterator it;
110 for( it = a.begin(); it != a.end(); ++it ) 114 for( it = a.begin(); it != a.end(); ++it )
111 { 115 {
112 out( *it ); 116 out( *it );
113 cmd += *it; 117 cmd += *it;
114 } 118 }
115 119
116 pvDebug(2,"running:"+cmd); 120 pvDebug(2,"running:"+cmd);
117 qApp->processEvents(); 121 qApp->processEvents();
@@ -412,51 +416,49 @@ void PmIpkg::install()
412 416
413void PmIpkg::createLinks( const QString &dest ) 417void PmIpkg::createLinks( const QString &dest )
414{ 418{
415 pvDebug(2,"PmIpkg::createLinks "+dest); 419 pvDebug(2,"PmIpkg::createLinks "+dest);
416 linkOpp=createLink; 420 linkOpp=createLink;
417 QString url = settings->getDestinationUrlByName( dest ); 421 QString url = settings->getDestinationUrlByName( dest );
418 url = url==""?dest:url; 422 url = url==""?dest:url;
419 processLinkDir( "/opt", url ); 423 processLinkDir( "/opt", url );
420 processLinkDir( "/usr", url ); 424 processLinkDir( "/usr", url );
421} 425}
422 426
423void PmIpkg::removeLinks( const QString &dest ) 427void PmIpkg::removeLinks( const QString &dest )
424{ 428{
425 pvDebug(2,"PmIpkg::removeLinks "+dest); 429 pvDebug(2,"PmIpkg::removeLinks "+dest);
426 linkOpp=removeLink; 430 linkOpp=removeLink;
427 QString url = settings->getDestinationUrlByName( dest ); 431 QString url = settings->getDestinationUrlByName( dest );
428 url = url==""?dest:url; 432 url = url==""?dest:url;
429 processLinkDir( "/opt", url ); 433 processLinkDir( "/opt", url );
430 processLinkDir( "/usr", url ); 434 processLinkDir( "/usr", url );
431} 435}
432 436
433void PmIpkg::update() 437void PmIpkg::update()
434{ 438{
435 show(); 439 show();
436 if ( runIpkg( "update" ) ) 440 runIpkg( "update" );
437 runwindow->close();
438 else out("An error occurred!\nPlease check the log.");
439} 441}
440 442
441void PmIpkg::out( QString o ) 443void PmIpkg::out( QString o )
442{ 444{
443 runwindow->outPut->append(o); 445 runwindow->outPut->append(o);
444 runwindow->outPut->setCursorPosition(runwindow->outPut->numLines() + 1,0,FALSE); 446 runwindow->outPut->setCursorPosition(runwindow->outPut->numLines() + 1,0,FALSE);
445} 447}
446 448
447 449
448 450
449 451
450void PmIpkg::show() 452void PmIpkg::show()
451{ 453{
452 if (!runwindow->isVisible()) 454 if (!runwindow->isVisible())
453 { 455 {
454 runwindow->showMaximized(); 456 runwindow->showMaximized();
455 runwindow->show(); 457 runwindow->show();
456 } 458 }
457 runwindow->outPut->setText(""); 459 runwindow->outPut->setText("");
458} 460}
459 461
460void PmIpkg::installFile(const QString &fileName, const QString &dest) 462void PmIpkg::installFile(const QString &fileName, const QString &dest)
461{ 463{
462 464