Diffstat (limited to 'noncore/settings/aqpkg/ipkg.cpp') (more/less context) (ignore 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 | |||
@@ -52,16 +52,15 @@ Ipkg :: ~Ipkg() | |||
52 | // packageName is the package name - (for a network package this will be the same as | 52 | // packageName is the package name - (for a network package this will be the same as |
53 | // package parameter) | 53 | // package parameter) |
54 | // dest is the destination alias (from ipk.conf) | 54 | // dest is the destination alias (from ipk.conf) |
55 | // destDir is the dir that the destination alias points to (used to link to root) | 55 | // destDir is the dir that the destination alias points to (used to link to root) |
56 | // flags is the ipkg options flags | 56 | // flags is the ipkg options flags |
57 | // dir is the directory to run ipkg in (defaults to "") | 57 | // dir is the directory to run ipkg in (defaults to "") |
58 | bool Ipkg :: runIpkg( ) | 58 | void Ipkg :: runIpkg() |
59 | { | 59 | { |
60 | error = false; | 60 | error = false; |
61 | bool ret = false; | ||
62 | QStringList commands; | 61 | QStringList commands; |
63 | 62 | ||
64 | QDir::setCurrent( "/tmp" ); | 63 | QDir::setCurrent( "/tmp" ); |
65 | 64 | ||
66 | if ( runtimeDir != "" ) | 65 | if ( runtimeDir != "" ) |
67 | { | 66 | { |
@@ -134,17 +133,18 @@ bool Ipkg :: runIpkg( ) | |||
134 | } | 133 | } |
135 | 134 | ||
136 | // Execute command | 135 | // Execute command |
137 | dependantPackages = new QList<QString>; | 136 | dependantPackages = new QList<QString>; |
138 | dependantPackages->setAutoDelete( true ); | 137 | dependantPackages->setAutoDelete( true ); |
139 | 138 | ||
140 | ret = executeIpkgCommand( commands, option ); | 139 | executeIpkgCommand( commands, option ); |
141 | 140 | ||
142 | if ( aborted ) | 141 | } |
143 | return false; | ||
144 | 142 | ||
143 | void Ipkg :: createSymLinks() | ||
144 | { | ||
145 | if ( option == "install" || option == "reinstall" || option == "upgrade" ) | 145 | if ( option == "install" || option == "reinstall" || option == "upgrade" ) |
146 | { | 146 | { |
147 | // If we are not removing packages and make links option is selected | 147 | // If we are not removing packages and make links option is selected |
148 | // create the links | 148 | // create the links |
149 | createLinks = true; | 149 | createLinks = true; |
150 | if ( flags & MAKE_LINKS ) | 150 | if ( flags & MAKE_LINKS ) |
@@ -168,13 +168,12 @@ bool Ipkg :: runIpkg( ) | |||
168 | } | 168 | } |
169 | 169 | ||
170 | delete dependantPackages; | 170 | delete dependantPackages; |
171 | 171 | ||
172 | emit outputText( "Finished" ); | 172 | emit outputText( "Finished" ); |
173 | emit outputText( "" ); | 173 | emit outputText( "" ); |
174 | return ret; | ||
175 | } | 174 | } |
176 | 175 | ||
177 | void Ipkg :: removeStatusEntry() | 176 | void Ipkg :: removeStatusEntry() |
178 | { | 177 | { |
179 | QString statusFile = destDir; | 178 | QString statusFile = destDir; |
180 | if ( statusFile.right( 1 ) != "/" ) | 179 | if ( statusFile.right( 1 ) != "/" ) |
@@ -292,16 +291,12 @@ int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) | |||
292 | // Start the process going | 291 | // Start the process going |
293 | finished = false; | 292 | finished = false; |
294 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) | 293 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) |
295 | { | 294 | { |
296 | emit outputText( QString( "Couldn't start ipkg process" ) ); | 295 | emit outputText( QString( "Couldn't start ipkg process" ) ); |
297 | } | 296 | } |
298 | |||
299 | // Now wait for it to finish | ||
300 | while ( !finished ) | ||
301 | qApp->processEvents(); | ||
302 | } | 297 | } |
303 | 298 | ||
304 | void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) | 299 | void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) |
305 | { | 300 | { |
306 | QString lineStr = buffer; | 301 | QString lineStr = buffer; |
307 | if ( lineStr[buflen-1] == '\n' ) | 302 | if ( lineStr[buflen-1] == '\n' ) |
@@ -351,12 +346,14 @@ void Ipkg::processFinished() | |||
351 | if ( !error && option == "remove" ) | 346 | if ( !error && option == "remove" ) |
352 | removeStatusEntry(); | 347 | removeStatusEntry(); |
353 | 348 | ||
354 | delete proc; | 349 | delete proc; |
355 | proc = 0; | 350 | proc = 0; |
356 | finished = true; | 351 | finished = true; |
352 | |||
353 | emit ipkgFinished(); | ||
357 | } | 354 | } |
358 | 355 | ||
359 | 356 | ||
360 | void Ipkg :: abort() | 357 | void Ipkg :: abort() |
361 | { | 358 | { |
362 | if ( proc ) | 359 | if ( proc ) |