-rw-r--r-- | noncore/settings/aqpkg/ipkg.cpp | 19 | ||||
-rw-r--r-- | noncore/settings/aqpkg/ipkg.h | 1 |
2 files changed, 17 insertions, 3 deletions
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp index 8de3c48..dad34b0 100644 --- a/noncore/settings/aqpkg/ipkg.cpp +++ b/noncore/settings/aqpkg/ipkg.cpp | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include <fstream> | 18 | #include <fstream> |
19 | #include <iostream> | 19 | #include <iostream> |
20 | #include <vector> | ||
20 | using namespace std; | 21 | using namespace std; |
21 | 22 | ||
22 | #include <stdio.h> | 23 | #include <stdio.h> |
@@ -81,6 +82,8 @@ bool Ipkg :: runIpkg( ) | |||
81 | cmd += " -force-removal-of-essential-packages"; | 82 | cmd += " -force-removal-of-essential-packages"; |
82 | if ( flags & FORCE_OVERWRITE ) | 83 | if ( flags & FORCE_OVERWRITE ) |
83 | cmd += " -force-overwrite"; | 84 | cmd += " -force-overwrite"; |
85 | if ( flags & VERBOSE_WGET ) | ||
86 | cmd += " -verbose_wget"; | ||
84 | 87 | ||
85 | // Handle make links | 88 | // Handle make links |
86 | // Rules - If make links is switched on, create links to root | 89 | // Rules - If make links is switched on, create links to root |
@@ -189,7 +192,7 @@ void Ipkg :: removeStatusEntry() | |||
189 | 192 | ||
190 | ifstream in( statusFile ); | 193 | ifstream in( statusFile ); |
191 | ofstream out( outStatusFile ); | 194 | ofstream out( outStatusFile ); |
192 | if ( !in.is_open() ) | 195 | if ( !in.is_open() ) |
193 | { | 196 | { |
194 | emit outputText( QString( "Couldn't open status file - " )+ statusFile ); | 197 | emit outputText( QString( "Couldn't open status file - " )+ statusFile ); |
195 | return; | 198 | return; |
@@ -206,6 +209,7 @@ void Ipkg :: removeStatusEntry() | |||
206 | char v[1001]; | 209 | char v[1001]; |
207 | QString key; | 210 | QString key; |
208 | QString value; | 211 | QString value; |
212 | vector<QString> lines; | ||
209 | do | 213 | do |
210 | { | 214 | { |
211 | in.getline( line, 1000 ); | 215 | in.getline( line, 1000 ); |
@@ -231,9 +235,18 @@ void Ipkg :: removeStatusEntry() | |||
231 | } while ( !in.eof() && QString( line ).stripWhiteSpace() != "" ); | 235 | } while ( !in.eof() && QString( line ).stripWhiteSpace() != "" ); |
232 | } | 236 | } |
233 | 237 | ||
234 | out << line << endl; | 238 | lines.push_back( QString( line ) ); |
239 | // out << line << endl; | ||
235 | } while ( !in.eof() ); | 240 | } while ( !in.eof() ); |
236 | 241 | ||
242 | // Write lines out | ||
243 | vector<QString>::iterator it; | ||
244 | for ( it = lines.begin() ; it != lines.end() ; ++it ) | ||
245 | { | ||
246 | cout << "Writing " << (const char *)(*it) << endl; | ||
247 | out << (const char *)(*it) << endl; | ||
248 | } | ||
249 | |||
237 | in.close(); | 250 | in.close(); |
238 | out.close(); | 251 | out.close(); |
239 | 252 | ||
@@ -406,7 +419,7 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const | |||
406 | d.mkdir( linkFile, true ); | 419 | d.mkdir( linkFile, true ); |
407 | } | 420 | } |
408 | else | 421 | else |
409 | emit outputText( QString( "Directory " ) + linkFile + " exists" ); | 422 | emit outputText( QString( "Directory " ) + linkFile + " already exists" ); |
410 | 423 | ||
411 | } | 424 | } |
412 | else | 425 | else |
diff --git a/noncore/settings/aqpkg/ipkg.h b/noncore/settings/aqpkg/ipkg.h index 55e9ff4..7099ca7 100644 --- a/noncore/settings/aqpkg/ipkg.h +++ b/noncore/settings/aqpkg/ipkg.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #define FORCE_REINSTALL 0x0004 | 32 | #define FORCE_REINSTALL 0x0004 |
33 | #define FORCE_OVERWRITE 0x0008 | 33 | #define FORCE_OVERWRITE 0x0008 |
34 | #define MAKE_LINKS 0x0010 | 34 | #define MAKE_LINKS 0x0010 |
35 | #define VERBOSE_WGET 0x0020 | ||
35 | 36 | ||
36 | class Ipkg : public QObject | 37 | class Ipkg : public QObject |
37 | { | 38 | { |