-rw-r--r-- | noncore/unsupported/oipkg/packagelist.cpp | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 36 |
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() /** Inserts a package into the list */ void PackageList::insertPackage( Package* pack ) { if (!pack) return; Package* p = packageListAll->find( pack->name() ); if ( p ) { if ( (p->version() == pack->version()) // && (p->dest() == pack->dest()) ) { p->copyValues( pack ); delete pack; pack = p; } else { QDict<Package> *packver = p->getOtherVersions(); // p->setName( pack->name()+"["+p->version()+"]" ); if (!packver) { packver = new QDict<Package>(); packver->insert( pack->name(), p ); p->setOtherVersions( packver ); } - pack->setName( pack->name()+"["+pack->version()+"]" ); + pack->setName( pack->name() );//+"["+pack->version()+"]" ); pack->setOtherVersions( packver ); packver->insert( pack->name(), pack ); packageListAll->insert( pack->name(), pack ); packageList.insert( pack->name(), pack ); origPackageList.insert( pack->name(), pack ); } }else{ packageListAll->insert( pack->name(), pack ); packageList.insert( pack->name(), pack ); origPackageList.insert( pack->name(), pack ); }; empty=false; updateSections( pack ); } void PackageList::filterPackages( QString f ) { packageList.clear(); QDictIterator<Package> filterIter( origPackageList ); filterIter.toFirst(); Package *pack= filterIter.current() ; while ( pack ) { 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 this, SLOT(getIpkgOutput(OProcess*,char*,int))); installDialog = 0; #endif } PmIpkg::~PmIpkg() { #ifdef OPROCESS delete ipkgProcess; #endif } bool PmIpkg::runIpkg(const QString& args, const QString& dest ) { bool ret=false; QDir::setCurrent("/tmp"); QString cmd = "/usr/bin/ipkg "; #ifdef OPROCESS ipkgProcess->kill(); ipkgProcess->clearArguments(); *ipkgProcess << "/usr/bin/ipkg "; cmd = ""; #endif pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); - if ( dest == "" ) - cmd += " -dest "+settings->getDestinationName(); - else - cmd += " -dest "+ dest; + if (!args.contains("update")) + { + if ( dest == "" ) + cmd += " -dest "+settings->getDestinationName(); + else + cmd += " -dest "+ dest; - cmd += " -force-defaults "; + cmd += " -force-defaults "; - if (installDialog && installDialog->_force_depends) - { - if (installDialog->_force_depends->isChecked()) - cmd += " -force-depends "; - if (installDialog->_force_reinstall->isChecked()) - cmd += " -force-reinstall "; - if (installDialog->_force_remove->isChecked()) - cmd += " -force-removal-of-essential-packages "; - } + if ( installDialog && installDialog->_force_depends ) + { + if (installDialog->_force_depends->isChecked()) + cmd += " -force-depends "; + if (installDialog->_force_reinstall->isChecked()) + cmd += " -force-reinstall "; + if (installDialog->_force_remove->isChecked()) + cmd += " -force-removal-of-essential-packages "; + } + } //!args.contains("update") out( "Starting to "+ args+"\n"); + qApp->processEvents(); cmd += args; out( "running:\n"+cmd+"\n" ); pvDebug(2,"running:"+cmd); #ifdef OPROCESS *ipkgProcess << args; out( "running:\n" + cmd); *ipkgProcess << cmd; //debug delete ipkgProcess; ipkgProcess = new OProcess(); ipkgProcess->clearArguments(); *ipkgProcess << "/bin/ls "; //debug QValueList<QCString> a = ipkgProcess->args(); QValueList<QCString>::Iterator it; for( it = a.begin(); it != a.end(); ++it ) { out( *it ); cmd += *it; } pvDebug(2,"running:"+cmd); qApp->processEvents(); @@ -412,51 +416,49 @@ void PmIpkg::install() void PmIpkg::createLinks( const QString &dest ) { pvDebug(2,"PmIpkg::createLinks "+dest); linkOpp=createLink; QString url = settings->getDestinationUrlByName( dest ); url = url==""?dest:url; processLinkDir( "/opt", url ); processLinkDir( "/usr", url ); } void PmIpkg::removeLinks( const QString &dest ) { pvDebug(2,"PmIpkg::removeLinks "+dest); linkOpp=removeLink; QString url = settings->getDestinationUrlByName( dest ); url = url==""?dest:url; processLinkDir( "/opt", url ); processLinkDir( "/usr", url ); } void PmIpkg::update() { show(); - if ( runIpkg( "update" ) ) - runwindow->close(); - else out("An error occurred!\nPlease check the log."); + runIpkg( "update" ); } void PmIpkg::out( QString o ) { runwindow->outPut->append(o); runwindow->outPut->setCursorPosition(runwindow->outPut->numLines() + 1,0,FALSE); } void PmIpkg::show() { if (!runwindow->isVisible()) { runwindow->showMaximized(); runwindow->show(); } runwindow->outPut->setText(""); } void PmIpkg::installFile(const QString &fileName, const QString &dest) { |