Diffstat (limited to 'noncore/settings/aqpkg/ipkg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/ipkg.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp index e906653..34999ad 100644 --- a/noncore/settings/aqpkg/ipkg.cpp +++ b/noncore/settings/aqpkg/ipkg.cpp @@ -50,20 +50,19 @@ Ipkg :: ~Ipkg() // package is the package name to install - either a fully qualified path and ipk // file (if stored locally) or just the name of the package (for a network package) // packageName is the package name - (for a network package this will be the same as // package parameter) // dest is the destination alias (from ipk.conf) // destDir is the dir that the destination alias points to (used to link to root) // flags is the ipkg options flags // dir is the directory to run ipkg in (defaults to "") -bool Ipkg :: runIpkg( ) +void Ipkg :: runIpkg() { error = false; - bool ret = false; QStringList commands; QDir::setCurrent( "/tmp" ); if ( runtimeDir != "" ) { commands << "cd "; commands << runtimeDir; @@ -132,21 +131,22 @@ bool Ipkg :: runIpkg( ) emit outputText( QString( " " ) ); } } // Execute command dependantPackages = new QList<QString>; dependantPackages->setAutoDelete( true ); - ret = executeIpkgCommand( commands, option ); + executeIpkgCommand( commands, option ); - if ( aborted ) - return false; +} +void Ipkg :: createSymLinks() +{ if ( option == "install" || option == "reinstall" || option == "upgrade" ) { // If we are not removing packages and make links option is selected // create the links createLinks = true; if ( flags & MAKE_LINKS ) { emit outputText( " " ); @@ -166,17 +166,16 @@ bool Ipkg :: runIpkg( ) } } } delete dependantPackages; emit outputText( "Finished" ); emit outputText( "" ); - return ret; } void Ipkg :: removeStatusEntry() { QString statusFile = destDir; if ( statusFile.right( 1 ) != "/" ) statusFile.append( "/" ); statusFile.append( "usr/lib/ipkg/status" ); @@ -290,20 +289,16 @@ int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) } // Start the process going finished = false; if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { emit outputText( QString( "Couldn't start ipkg process" ) ); } - - // Now wait for it to finish - while ( !finished ) - qApp->processEvents(); } void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) { QString lineStr = buffer; if ( lineStr[buflen-1] == '\n' ) buflen --; lineStr = lineStr.left( buflen ); @@ -349,16 +344,18 @@ void Ipkg::processFinished() // to workaround an ipkg bug which stops reinstall to a different location if ( !error && option == "remove" ) removeStatusEntry(); delete proc; proc = 0; finished = true; + + emit ipkgFinished(); } void Ipkg :: abort() { if ( proc ) { proc->kill(); |