Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index de1f162..4a8a389 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp @@ -64,12 +64,13 @@ PmIpkg::~PmIpkg() 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 == "" ) @@ -96,12 +97,14 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest ) #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 ) @@ -167,37 +170,45 @@ void PmIpkg::makeLinks(Package *pack) } QStringList* PmIpkg::getList( QString packFileName, QString d ) { QString dest = settings->getDestinationUrlByName( d ); dest = dest==""?d:dest; - if (dest == "/" ) return 0; + // if (dest == "/" ) return 0; { Config cfg( "oipkg", Config::User ); cfg.setGroup( "Common" ); QString statusDir = cfg.readEntry( "statusDir", "" ); } - packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list"; + QString packFileDir = dest+"/"+statusDir+"/info/"+packFileName+".list"; QFile f( packFileName ); if ( ! f.open(IO_ReadOnly) ) { - pvDebug(1," Panik! Could not open"); - out( "Panik!\n Could not open:\n"+packFileName ); - return (QStringList*)0; + out( "Could not open:\n"+packFileDir ); + f.close(); + packFileDir = "/"+statusDir+"/info/"+packFileName+".list"; + f.setName( packFileDir ); + if ( ! f.open(IO_ReadOnly) ) + { + qDebug(" Panik! Could not open"+packFileDir); + out( "Could not open:\n"+packFileDir+"\n Panik!" ); + } } QStringList *fileList = new QStringList(); QTextStream t( &f ); while ( !t.eof() ) { *fileList += t.readLine(); } + f.close(); return fileList; } void PmIpkg::linkPackage( QString packFileName, QString dest ) { + if (dest == "root" || dest == "/" ) return; QStringList *fileList = getList( packFileName, dest ); processFileList( fileList, dest ); delete fileList; } void PmIpkg::processFileList( QStringList *fileList, QString d ) |