author | andyq <andyq> | 2002-10-22 19:30:26 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-22 19:30:26 (UTC) |
commit | 44a60b35b903b68f2f60f5ba29b84db1563dd9f3 (patch) (unidiff) | |
tree | 64f2367de78806bbbb1ebf32bafc9dc9e56bb158 | |
parent | edcbb8b9bae3db2fae18ec6cd9efd202af4f913c (diff) | |
download | opie-44a60b35b903b68f2f60f5ba29b84db1563dd9f3.zip opie-44a60b35b903b68f2f60f5ba29b84db1563dd9f3.tar.gz opie-44a60b35b903b68f2f60f5ba29b84db1563dd9f3.tar.bz2 |
Removed some debug output
-rw-r--r-- | noncore/settings/aqpkg/ipkg.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp index eacef76..368548b 100644 --- a/noncore/settings/aqpkg/ipkg.cpp +++ b/noncore/settings/aqpkg/ipkg.cpp | |||
@@ -151,105 +151,103 @@ bool Ipkg :: runIpkg( ) | |||
151 | if ( *pkg == package ) | 151 | if ( *pkg == package ) |
152 | continue; | 152 | continue; |
153 | emit outputText( " " ); | 153 | emit outputText( " " ); |
154 | emit outputText( QString( "Creating symbolic links for " )+ (*pkg) ); | 154 | emit outputText( QString( "Creating symbolic links for " )+ (*pkg) ); |
155 | linkPackage( Utils::getPackageNameFromIpkFilename( *pkg ), destination, destDir ); | 155 | linkPackage( Utils::getPackageNameFromIpkFilename( *pkg ), destination, destDir ); |
156 | } | 156 | } |
157 | } | 157 | } |
158 | } | 158 | } |
159 | 159 | ||
160 | delete dependantPackages; | 160 | delete dependantPackages; |
161 | 161 | ||
162 | emit outputText( QString( "Finished - status=" ) + (ret ? "success" : "failure") ); | 162 | emit outputText( QString( "Finished - status=" ) + (ret ? "success" : "failure") ); |
163 | emit outputText( "" ); | 163 | emit outputText( "" ); |
164 | return ret; | 164 | return ret; |
165 | } | 165 | } |
166 | 166 | ||
167 | 167 | ||
168 | int Ipkg :: executeIpkgCommand( QString &cmd, const QString option ) | 168 | int Ipkg :: executeIpkgCommand( QString &cmd, const QString option ) |
169 | { | 169 | { |
170 | FILE *fp = NULL; | 170 | FILE *fp = NULL; |
171 | char line[130]; | 171 | char line[130]; |
172 | QString lineStr, lineStrOld; | 172 | QString lineStr, lineStrOld; |
173 | int ret = false; | 173 | int ret = false; |
174 | 174 | ||
175 | fp = popen( (const char *) cmd, "r"); | 175 | fp = popen( (const char *) cmd, "r"); |
176 | if ( fp == NULL ) | 176 | if ( fp == NULL ) |
177 | { | 177 | { |
178 | cout << "Couldn't execute " << cmd << "! err = " << fp << endl; | 178 | cout << "Couldn't execute " << cmd << "! err = " << fp << endl; |
179 | QString text; | 179 | QString text; |
180 | text.sprintf( "Couldn't execute %s! See stdout for error code", (const char *)cmd ); | 180 | text.sprintf( "Couldn't execute %s! See stdout for error code", (const char *)cmd ); |
181 | emit outputText( text ); | 181 | emit outputText( text ); |
182 | } | 182 | } |
183 | else | 183 | else |
184 | { | 184 | { |
185 | while ( fgets( line, sizeof line, fp) != NULL ) | 185 | while ( fgets( line, sizeof line, fp) != NULL ) |
186 | { | 186 | { |
187 | lineStr = line; | 187 | lineStr = line; |
188 | lineStr=lineStr.left( lineStr.length()-1 ); | 188 | lineStr=lineStr.left( lineStr.length()-1 ); |
189 | 189 | ||
190 | if ( lineStr != lineStrOld ) | 190 | if ( lineStr != lineStrOld ) |
191 | { | 191 | { |
192 | //See if we're finished | 192 | //See if we're finished |
193 | if ( option == "install" || option == "reinstall" ) | 193 | if ( option == "install" || option == "reinstall" ) |
194 | { | 194 | { |
195 | // Need to keep track of any dependant packages that get installed | 195 | // Need to keep track of any dependant packages that get installed |
196 | // so that we can create links to them as necessary | 196 | // so that we can create links to them as necessary |
197 | if ( lineStr.startsWith( "Installing " ) ) | 197 | if ( lineStr.startsWith( "Installing " ) ) |
198 | { | 198 | { |
199 | cout << "LineStr = " << lineStr << endl; | ||
200 | int start = lineStr.find( " " ) + 1; | 199 | int start = lineStr.find( " " ) + 1; |
201 | int end = lineStr.find( " ", start ); | 200 | int end = lineStr.find( " ", start ); |
202 | QString *package = new QString( lineStr.mid( start, end-start ) ); | 201 | QString *package = new QString( lineStr.mid( start, end-start ) ); |
203 | dependantPackages->append( package ); | 202 | dependantPackages->append( package ); |
204 | cout << "installing dependant package <" << *package << ">" << endl; | ||
205 | } | 203 | } |
206 | } | 204 | } |
207 | 205 | ||
208 | if ( option == "update" ) | 206 | if ( option == "update" ) |
209 | { | 207 | { |
210 | if (lineStr.contains("Updated list")) | 208 | if (lineStr.contains("Updated list")) |
211 | ret = true; | 209 | ret = true; |
212 | } | 210 | } |
213 | else if ( option == "download" ) | 211 | else if ( option == "download" ) |
214 | { | 212 | { |
215 | if (lineStr.contains("Downloaded")) | 213 | if (lineStr.contains("Downloaded")) |
216 | ret = true; | 214 | ret = true; |
217 | } | 215 | } |
218 | else | 216 | else |
219 | { | 217 | { |
220 | if (lineStr.contains("Done")) | 218 | if (lineStr.contains("Done")) |
221 | ret = true; | 219 | ret = true; |
222 | } | 220 | } |
223 | 221 | ||
224 | emit outputText( lineStr ); | 222 | emit outputText( lineStr ); |
225 | } | 223 | } |
226 | lineStrOld = lineStr; | 224 | lineStrOld = lineStr; |
227 | qApp->processEvents(); | 225 | qApp->processEvents(); |
228 | } | 226 | } |
229 | pclose(fp); | 227 | pclose(fp); |
230 | } | 228 | } |
231 | 229 | ||
232 | return ret; | 230 | return ret; |
233 | } | 231 | } |
234 | 232 | ||
235 | 233 | ||
236 | void Ipkg :: linkPackage( const QString &packFileName, const QString &dest, const QString &destDir ) | 234 | void Ipkg :: linkPackage( const QString &packFileName, const QString &dest, const QString &destDir ) |
237 | { | 235 | { |
238 | if ( dest == "root" || dest == "/" ) | 236 | if ( dest == "root" || dest == "/" ) |
239 | return; | 237 | return; |
240 | 238 | ||
241 | qApp->processEvents(); | 239 | qApp->processEvents(); |
242 | QStringList *fileList = getList( packFileName, destDir ); | 240 | QStringList *fileList = getList( packFileName, destDir ); |
243 | qApp->processEvents(); | 241 | qApp->processEvents(); |
244 | processFileList( fileList, destDir ); | 242 | processFileList( fileList, destDir ); |
245 | delete fileList; | 243 | delete fileList; |
246 | } | 244 | } |
247 | 245 | ||
248 | QStringList* Ipkg :: getList( const QString &packageFilename, const QString &destDir ) | 246 | QStringList* Ipkg :: getList( const QString &packageFilename, const QString &destDir ) |
249 | { | 247 | { |
250 | QString packageFileDir = destDir+"/usr/lib/ipkg/info/"+packageFilename+".list"; | 248 | QString packageFileDir = destDir+"/usr/lib/ipkg/info/"+packageFilename+".list"; |
251 | QFile f( packageFileDir ); | 249 | QFile f( packageFileDir ); |
252 | 250 | ||
253 | cout << "Try to open " << packageFileDir << endl; | 251 | cout << "Try to open " << packageFileDir << endl; |
254 | if ( !f.open(IO_ReadOnly) ) | 252 | if ( !f.open(IO_ReadOnly) ) |
255 | { | 253 | { |