summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/pmipkg.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp25
1 files changed, 14 insertions, 11 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
@@ -42,25 +42,25 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
{
bool ret=false;
QDir::setCurrent("/tmp");
QString cmd = "/usr/bin/ipkg ";
pvDebug( 3,"PmIpkg::runIpkg got dest="+dest);
if ( dest == "" )
cmd += " -dest "+settings->getDestinationName();
else
cmd += " -dest "+ dest;
cmd += " -force-defaults ";
- if (installDialog->_force_depends)
+ 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 ";
}
out( "Starting to "+ args+"\n");
cmd += args;
out( "running:\n"+cmd+"\n" );
@@ -78,24 +78,25 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
out("\nError while executing "+ cmd+"\n\n");
return false;
} else {
while ( fgets( line, sizeof line, fp)) {
lineStr = line;
lineStr=lineStr.left(lineStr.length()-1);
//Configuring opie-oipkg...Done
if (lineStr.contains("Done"))
ret = true;
if (lineStr!=lineStrOld)
out(lineStr);
lineStrOld = lineStr;
+ qApp->processEvents();
}
pclose(fp);
}
//out( "Finished!");
pvDebug(2,QString(ret?"success\n":"failure\n"));
return ret;
}
void PmIpkg::makeLinks(Package *pack)
{
pvDebug( 2, "PmIpkg::makeLinks "+ pack->name());
linkPackage( pack->name(), pack->dest() );
@@ -147,24 +148,26 @@ void PmIpkg::processFileList( QStringList *fileList, QString d )
}
void PmIpkg::processLinkDir( QString file, QString dest )
{
pvDebug( 4,"PmIpkg::processLinkDir "+file+" to "+ dest);
if (linkOpp==createLink) pvDebug( 4,"opp: createLink");
if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink");
if ( dest == "???" || dest == "" ) return;
QString destFile = file;
file = dest+"/"+file;
if (file == dest) return;
+// if (linkOpp==createLink) out( "\ncreating links\n" );
+// if (linkOpp==removeLink) out( "\nremoving links\n" );
QFileInfo fileInfo( file );
if ( fileInfo.isDir() )
{
pvDebug(4, "process dir "+file);
QDir destDir( destFile );
if (linkOpp==createLink) destDir.mkdir( destFile, true );
QDir d( file );
// d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
const QFileInfoList *list = d.entryInfoList();
QFileInfoListIterator it( *list );
QFileInfo *fi;
while ( (fi=it.current()) )
@@ -256,63 +259,63 @@ void PmIpkg::remove()
out(tr("Removing")+"\n"+tr("please wait")+"\n\n");
QStringList *fileList;
for (uint i=0; i < to_remove.count(); i++)
{
if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() );
if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() ))
{
runwindow->progress->setProgress( 1 );
linkOpp = removeLink;
to_remove.at(i)->processed();
+ if ( to_remove.at(i)->link() )
+ processFileList( fileList, to_remove.at(i)->dest() );
to_remove.take( i );
- out("\n\n");
+ out("\n");
}else{
out(tr("Error while removing")+to_remove.at(i)->name()+"\n");
- }
if ( to_remove.at(i)->link() )
- {
- out( "\nremoving links\n" );
- out( "for package "+to_remove.at(i)->name()+" in "+to_remove.at(i)->dest()+"\n" );
processFileList( fileList, to_remove.at(i)->dest() );
}
+ if ( to_remove.at(i)->link() )
+ processFileList( fileList, to_remove.at(i)->dest() );
if ( to_remove.at(i)->link() )delete fileList;
}
to_remove.clear();
out("\n");
}
void PmIpkg::install()
{
if ( to_install.count() == 0 ) return;
out(tr("Installing")+"\n"+tr("please wait")+"\n");
for (uint i=0; i < to_install.count(); i++)
{
+ qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug
if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() ))
{
runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress());
to_install.at(i)->processed();
+ linkOpp = createLink;
+ if ( to_install.at(i)->link() )
+ makeLinks( to_install.at(i) );
to_install.take( i );
- out("\n\n");
+ out("\n");
}else{
out(tr("Error while installing")+to_install.at(i)->name()+"\n");
- }
linkOpp = createLink;
if ( to_install.at(i)->link() )
- {
- out( "\ncreating links\n" );
- out( "for package "+to_install.at(i)->name()+" in "+to_install.at(i)->dest()+"\n" );
makeLinks( to_install.at(i) );
}
}
out("\n");
to_install.clear();
}
void PmIpkg::createLinks( const QString &dest )
{
pvDebug(2,"PmIpkg::createLinks "+dest);
linkOpp=createLink;
QString url = settings->getDestinationUrlByName( dest );