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.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 2ed313c..cfaadbf 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -105,25 +105,25 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
105 if (lineStr.contains("Done")) ret = true; 105 if (lineStr.contains("Done")) ret = true;
106 if (lineStr!=lineStrOld) 106 if (lineStr!=lineStrOld)
107 out(lineStr); 107 out(lineStr);
108 lineStrOld = lineStr; 108 lineStrOld = lineStr;
109 qApp->processEvents(); 109 qApp->processEvents();
110 } 110 }
111 } 111 }
112 pclose(fp); 112 pclose(fp);
113 pvDebug(2,QString(ret?"success\n":"failure\n")); 113 pvDebug(2,QString(ret?"success\n":"failure\n"));
114 return ret; 114 return ret;
115} 115}
116 116
117void PmIpkg::makeLinks(Package *pack) 117void PmIpkg::makeLinks(OipkgPackage *pack)
118{ 118{
119 pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); 119 pvDebug( 2, "PmIpkg::makeLinks "+ pack->name());
120 QString pn = pack->name(); 120 QString pn = pack->name();
121 linkPackage( pack->packageName(), pack->dest() ); 121 linkPackage( pack->packageName(), pack->dest() );
122} 122}
123 123
124QStringList* PmIpkg::getList( QString packFileName, QString d ) 124QStringList* PmIpkg::getList( QString packFileName, QString d )
125{ 125{
126 QString dest = settings->getDestinationUrlByName( d ); 126 QString dest = settings->getDestinationUrlByName( d );
127 dest = dest==""?d:dest; 127 dest = dest==""?d:dest;
128 // if (dest == "/" ) return 0; 128 // if (dest == "/" ) return 0;
129 { 129 {
@@ -223,25 +223,25 @@ void PmIpkg::processLinkDir( QString file, QString dest )
223 QFileInfo toRemoveLink( destFile ); 223 QFileInfo toRemoveLink( destFile );
224 if ( !QFile::exists( file ) && toRemoveLink.isSymLink() ) 224 if ( !QFile::exists( file ) && toRemoveLink.isSymLink() )
225 { 225 {
226 pvDebug(4,"removing "+destFile+" no "+file); 226 pvDebug(4,"removing "+destFile+" no "+file);
227 unlink( linkFile ); 227 unlink( linkFile );
228 } 228 }
229 } 229 }
230 } 230 }
231} 231}
232 232
233void PmIpkg::loadList( PackageList *pl ) 233void PmIpkg::loadList( PackageList *pl )
234 { 234 {
235 for( Package *pack = pl->first();pack ; (pack = pl->next()) ) 235 for( OipkgPackage *pack = pl->first();pack ; (pack = pl->next()) )
236 { 236 {
237 if ( pack && (pack->name() != "") && pack) 237 if ( pack && (pack->name() != "") && pack)
238 { 238 {
239 if ( pack->toInstall() ) 239 if ( pack->toInstall() )
240 to_install.append( pack ); 240 to_install.append( pack );
241 if ( pack->toRemove() ) 241 if ( pack->toRemove() )
242 to_remove.append( pack ); 242 to_remove.append( pack );
243 } 243 }
244 } 244 }
245} 245}
246 246
247void PmIpkg::commit() 247void PmIpkg::commit()
@@ -282,25 +282,25 @@ void PmIpkg::doIt()
282 show(); 282 show();
283 remove(); 283 remove();
284 install(); 284 install();
285} 285}
286 286
287 287
288void PmIpkg::remove() 288void PmIpkg::remove()
289{ 289{
290 if ( to_remove.count() == 0 ) return; 290 if ( to_remove.count() == 0 ) return;
291 291
292 out(tr("Removing")+"\n"+tr("please wait")+"\n\n"); 292 out(tr("Removing")+"\n"+tr("please wait")+"\n\n");
293 293
294 QStringList *fileList; 294 QStringList *fileList = new QStringList;
295 for (uint i=0; i < to_remove.count(); i++) 295 for (uint i=0; i < to_remove.count(); i++)
296 { 296 {
297 if ( to_remove.at(i)->link() ) fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); 297 if ( to_remove.at(i)->link() ) fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() );
298 if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() )) 298 if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() ))
299 { 299 {
300 runwindow->progress->setProgress( 1 ); 300 runwindow->progress->setProgress( 1 );
301 linkOpp = removeLink; 301 linkOpp = removeLink;
302 to_remove.at(i)->processed(); 302 to_remove.at(i)->processed();
303 pvDebug(3,"link "+QString::number(i)); 303 pvDebug(3,"link "+QString::number(i));
304 if ( to_remove.at(i)->link() ) 304 if ( to_remove.at(i)->link() )
305 processFileList( fileList, to_remove.at(i)->dest() ); 305 processFileList( fileList, to_remove.at(i)->dest() );
306 //pvDebug(3,"take "+QString::number(i)+" of "+QString::number(to_remove.count())); 306 //pvDebug(3,"take "+QString::number(i)+" of "+QString::number(to_remove.count()));
@@ -405,38 +405,38 @@ void PmIpkg::show()
405 runwindow->showMaximized(); 405 runwindow->showMaximized();
406 runwindow->show(); 406 runwindow->show();
407 } 407 }
408 runwindow->outPut->setText(""); 408 runwindow->outPut->setText("");
409} 409}
410 410
411void PmIpkg::installFile(const QString &fileName, const QString &dest) 411void PmIpkg::installFile(const QString &fileName, const QString &dest)
412{ 412{
413 413
414 to_install.clear(); 414 to_install.clear();
415 to_remove.clear(); 415 to_remove.clear();
416 pvDebug( 2,"PmIpkg::installFile "+ fileName); 416 pvDebug( 2,"PmIpkg::installFile "+ fileName);
417 Package *p = new Package(fileName,settings); 417 OipkgPackage *p = new OipkgPackage(fileName,settings);
418 if ( dest!="") p->setDest( dest ); 418 if ( dest!="") p->setDest( dest );
419 to_install.append( p ); 419 to_install.append( p );
420 commit(); 420 commit();
421 delete p; 421 delete p;
422} 422}
423 423
424void PmIpkg::removeFile(const QString &fileName, const QString &dest) 424void PmIpkg::removeFile(const QString &fileName, const QString &dest)
425{ 425{
426 426
427 to_install.clear(); 427 to_install.clear();
428 to_remove.clear(); 428 to_remove.clear();
429 pvDebug( 2,"PmIpkg::removeFile "+ fileName); 429 pvDebug( 2,"PmIpkg::removeFile "+ fileName);
430 Package *p = new Package(fileName,settings); 430 OipkgPackage *p = new OipkgPackage(fileName,settings);
431 if ( dest!="") p->setDest( dest ); 431 if ( dest!="") p->setDest( dest );
432 to_remove.append( p ); 432 to_remove.append( p );
433 commit(); 433 commit();
434 delete p; 434 delete p;
435} 435}
436 436
437 437
438void PmIpkg::clearLists() 438void PmIpkg::clearLists()
439{ 439{
440 to_remove.clear(); 440 to_remove.clear();
441 to_install.clear(); 441 to_install.clear();
442} 442}