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 | |||
@@ -67,6 +67,7 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest ) | |||
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->clearArguments(); | 71 | ipkgProcess->clearArguments(); |
71 | *ipkgProcess << "/usr/bin/ipkg "; | 72 | *ipkgProcess << "/usr/bin/ipkg "; |
72 | cmd = ""; | 73 | cmd = ""; |
@@ -99,6 +100,8 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest ) | |||
99 | *ipkgProcess << cmd; | 100 | *ipkgProcess << cmd; |
100 | 101 | ||
101 | //debug | 102 | //debug |
103 | delete ipkgProcess; | ||
104 | ipkgProcess = new OProcess(); | ||
102 | ipkgProcess->clearArguments(); | 105 | ipkgProcess->clearArguments(); |
103 | *ipkgProcess << "/bin/ls "; | 106 | *ipkgProcess << "/bin/ls "; |
104 | //debug | 107 | //debug |
@@ -170,19 +173,25 @@ QStringList* PmIpkg::getList( QString packFileName, QString d ) | |||
170 | { | 173 | { |
171 | QString dest = settings->getDestinationUrlByName( d ); | 174 | QString dest = settings->getDestinationUrlByName( d ); |
172 | dest = dest==""?d:dest; | 175 | dest = dest==""?d:dest; |
173 | if (dest == "/" ) return 0; | 176 | // if (dest == "/" ) return 0; |
174 | { | 177 | { |
175 | Config cfg( "oipkg", Config::User ); | 178 | Config cfg( "oipkg", Config::User ); |
176 | cfg.setGroup( "Common" ); | 179 | cfg.setGroup( "Common" ); |
177 | QString statusDir = cfg.readEntry( "statusDir", "" ); | 180 | QString statusDir = cfg.readEntry( "statusDir", "" ); |
178 | } | 181 | } |
179 | packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list"; | 182 | QString packFileDir = dest+"/"+statusDir+"/info/"+packFileName+".list"; |
180 | QFile f( packFileName ); | 183 | QFile f( packFileName ); |
181 | if ( ! f.open(IO_ReadOnly) ) | 184 | if ( ! f.open(IO_ReadOnly) ) |
182 | { | 185 | { |
183 | pvDebug(1," Panik! Could not open"); | 186 | out( "Could not open:\n"+packFileDir ); |
184 | out( "Panik!\n Could not open:\n"+packFileName ); | 187 | f.close(); |
185 | return (QStringList*)0; | 188 | packFileDir = "/"+statusDir+"/info/"+packFileName+".list"; |
189 | f.setName( packFileDir ); | ||
190 | if ( ! f.open(IO_ReadOnly) ) | ||
191 | { | ||
192 | qDebug(" Panik! Could not open"+packFileDir); | ||
193 | out( "Could not open:\n"+packFileDir+"\n Panik!" ); | ||
194 | } | ||
186 | } | 195 | } |
187 | QStringList *fileList = new QStringList(); | 196 | QStringList *fileList = new QStringList(); |
188 | QTextStream t( &f ); | 197 | QTextStream t( &f ); |
@@ -190,11 +199,13 @@ QStringList* PmIpkg::getList( QString packFileName, QString d ) | |||
190 | { | 199 | { |
191 | *fileList += t.readLine(); | 200 | *fileList += t.readLine(); |
192 | } | 201 | } |
202 | f.close(); | ||
193 | return fileList; | 203 | return fileList; |
194 | } | 204 | } |
195 | 205 | ||
196 | void PmIpkg::linkPackage( QString packFileName, QString dest ) | 206 | void PmIpkg::linkPackage( QString packFileName, QString dest ) |
197 | { | 207 | { |
208 | if (dest == "root" || dest == "/" ) return; | ||
198 | QStringList *fileList = getList( packFileName, dest ); | 209 | QStringList *fileList = getList( packFileName, dest ); |
199 | processFileList( fileList, dest ); | 210 | processFileList( fileList, dest ); |
200 | delete fileList; | 211 | delete fileList; |