summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/pmipkg.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index f2852c3..6ef6d19 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -48,13 +48,13 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
48 cmd += " -dest "+settings->getDestinationName(); 48 cmd += " -dest "+settings->getDestinationName();
49 else 49 else
50 cmd += " -dest "+ dest; 50 cmd += " -dest "+ dest;
51 51
52 cmd += " -force-defaults "; 52 cmd += " -force-defaults ";
53 53
54 if (installDialog->_force_depends) 54 if (installDialog && installDialog->_force_depends)
55 { 55 {
56 if (installDialog->_force_depends->isChecked()) 56 if (installDialog->_force_depends->isChecked())
57 cmd += " -force-depends "; 57 cmd += " -force-depends ";
58 if (installDialog->_force_reinstall->isChecked()) 58 if (installDialog->_force_reinstall->isChecked())
59 cmd += " -force-reinstall "; 59 cmd += " -force-reinstall ";
60 if (installDialog->_force_remove->isChecked()) 60 if (installDialog->_force_remove->isChecked())
@@ -84,12 +84,13 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
84 //Configuring opie-oipkg...Done 84 //Configuring opie-oipkg...Done
85 if (lineStr.contains("Done")) 85 if (lineStr.contains("Done"))
86 ret = true; 86 ret = true;
87 if (lineStr!=lineStrOld) 87 if (lineStr!=lineStrOld)
88 out(lineStr); 88 out(lineStr);
89 lineStrOld = lineStr; 89 lineStrOld = lineStr;
90 qApp->processEvents();
90 } 91 }
91 pclose(fp); 92 pclose(fp);
92 } 93 }
93 //out( "Finished!"); 94 //out( "Finished!");
94 pvDebug(2,QString(ret?"success\n":"failure\n")); 95 pvDebug(2,QString(ret?"success\n":"failure\n"));
95 return ret; 96 return ret;
@@ -153,12 +154,14 @@ void PmIpkg::processLinkDir( QString file, QString dest )
153 if (linkOpp==createLink) pvDebug( 4,"opp: createLink"); 154 if (linkOpp==createLink) pvDebug( 4,"opp: createLink");
154 if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink"); 155 if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink");
155 if ( dest == "???" || dest == "" ) return; 156 if ( dest == "???" || dest == "" ) return;
156 QString destFile = file; 157 QString destFile = file;
157 file = dest+"/"+file; 158 file = dest+"/"+file;
158 if (file == dest) return; 159 if (file == dest) return;
160// if (linkOpp==createLink) out( "\ncreating links\n" );
161 // if (linkOpp==removeLink) out( "\nremoving links\n" );
159 QFileInfo fileInfo( file ); 162 QFileInfo fileInfo( file );
160 if ( fileInfo.isDir() ) 163 if ( fileInfo.isDir() )
161 { 164 {
162 pvDebug(4, "process dir "+file); 165 pvDebug(4, "process dir "+file);
163 QDir destDir( destFile ); 166 QDir destDir( destFile );
164 if (linkOpp==createLink) destDir.mkdir( destFile, true ); 167 if (linkOpp==createLink) destDir.mkdir( destFile, true );
@@ -262,24 +265,24 @@ void PmIpkg::remove()
262 if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); 265 if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() );
263 if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() )) 266 if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() ))
264 { 267 {
265 runwindow->progress->setProgress( 1 ); 268 runwindow->progress->setProgress( 1 );
266 linkOpp = removeLink; 269 linkOpp = removeLink;
267 to_remove.at(i)->processed(); 270 to_remove.at(i)->processed();
271 if ( to_remove.at(i)->link() )
272 processFileList( fileList, to_remove.at(i)->dest() );
268 to_remove.take( i ); 273 to_remove.take( i );
269 274
270 out("\n\n"); 275 out("\n");
271 }else{ 276 }else{
272 out(tr("Error while removing")+to_remove.at(i)->name()+"\n"); 277 out(tr("Error while removing")+to_remove.at(i)->name()+"\n");
278 if ( to_remove.at(i)->link() )
279 processFileList( fileList, to_remove.at(i)->dest() );
273 } 280 }
274 if ( to_remove.at(i)->link() ) 281 if ( to_remove.at(i)->link() )
275 {
276 out( "\nremoving links\n" );
277 out( "for package "+to_remove.at(i)->name()+" in "+to_remove.at(i)->dest()+"\n" );
278 processFileList( fileList, to_remove.at(i)->dest() ); 282 processFileList( fileList, to_remove.at(i)->dest() );
279 }
280 if ( to_remove.at(i)->link() )delete fileList; 283 if ( to_remove.at(i)->link() )delete fileList;
281 } 284 }
282 to_remove.clear(); 285 to_remove.clear();
283 out("\n"); 286 out("\n");
284} 287}
285 288
@@ -287,27 +290,27 @@ void PmIpkg::remove()
287void PmIpkg::install() 290void PmIpkg::install()
288{ 291{
289 if ( to_install.count() == 0 ) return; 292 if ( to_install.count() == 0 ) return;
290 out(tr("Installing")+"\n"+tr("please wait")+"\n"); 293 out(tr("Installing")+"\n"+tr("please wait")+"\n");
291 for (uint i=0; i < to_install.count(); i++) 294 for (uint i=0; i < to_install.count(); i++)
292 { 295 {
296 qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug
293 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() )) 297 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() ))
294 { 298 {
295 runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); 299 runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress());
296 to_install.at(i)->processed(); 300 to_install.at(i)->processed();
301 linkOpp = createLink;
302 if ( to_install.at(i)->link() )
303 makeLinks( to_install.at(i) );
297 to_install.take( i ); 304 to_install.take( i );
298 out("\n\n"); 305 out("\n");
299 }else{ 306 }else{
300 out(tr("Error while installing")+to_install.at(i)->name()+"\n"); 307 out(tr("Error while installing")+to_install.at(i)->name()+"\n");
301 } 308 linkOpp = createLink;
302 linkOpp = createLink; 309 if ( to_install.at(i)->link() )
303 if ( to_install.at(i)->link() ) 310 makeLinks( to_install.at(i) );
304 {
305 out( "\ncreating links\n" );
306 out( "for package "+to_install.at(i)->name()+" in "+to_install.at(i)->dest()+"\n" );
307 makeLinks( to_install.at(i) );
308 } 311 }
309 } 312 }
310 out("\n"); 313 out("\n");
311 to_install.clear(); 314 to_install.clear();
312} 315}
313 316