author | tille <tille> | 2002-11-10 22:50:50 (UTC) |
---|---|---|
committer | tille <tille> | 2002-11-10 22:50:50 (UTC) |
commit | 9337c912158da3ad2fcda7ee1120c9357faddf8b (patch) (unidiff) | |
tree | c5800efad3f90cfc9901db0337039eb883c0cf28 /noncore/unsupported/oipkg/package.cpp | |
parent | f6cabaaa364ee6d894462c0902734e434715fc58 (diff) | |
download | opie-9337c912158da3ad2fcda7ee1120c9357faddf8b.zip opie-9337c912158da3ad2fcda7ee1120c9357faddf8b.tar.gz opie-9337c912158da3ad2fcda7ee1120c9357faddf8b.tar.bz2 |
here it's...
Diffstat (limited to 'noncore/unsupported/oipkg/package.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 100 |
1 files changed, 49 insertions, 51 deletions
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 3effb73..e020601 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp | |||
@@ -13,34 +13,33 @@ | |||
13 | #include <qpe/stringutil.h> | 13 | #include <qpe/stringutil.h> |
14 | #include <qfile.h> | 14 | #include <qfile.h> |
15 | #include <qtextstream.h> | 15 | #include <qtextstream.h> |
16 | #include <stdlib.h> | 16 | #include <stdlib.h> |
17 | #include <unistd.h> | 17 | #include <unistd.h> |
18 | 18 | ||
19 | #include "debug.h" | 19 | #include "debug.h" |
20 | 20 | ||
21 | Package::Package( QObject *parent, const char *name ) | 21 | OipkgPackage::OipkgPackage( QObject *parent, const char *name ) |
22 | : QObject(parent,name) | 22 | : QObject(parent,name) |
23 | { | 23 | { |
24 | 24 | ||
25 | } | 25 | } |
26 | 26 | ||
27 | Package::~Package() | 27 | OipkgPackage::~OipkgPackage() |
28 | { | 28 | { |
29 | } | 29 | } |
30 | 30 | ||
31 | Package::Package( PackageManagerSettings *s, QObject *parent, const char *name ) | 31 | OipkgPackage::OipkgPackage( PackageManagerSettings *s, QObject *parent, const char *name ) |
32 | : QObject(parent,name) | 32 | : QObject(parent,name) |
33 | { | 33 | { |
34 | Package(parent,name); | ||
35 | init(s); | 34 | init(s); |
36 | } | 35 | } |
37 | 36 | ||
38 | void Package::init( PackageManagerSettings *s ) | 37 | void OipkgPackage::init( PackageManagerSettings *s ) |
39 | { | 38 | { |
40 | settings = s; | 39 | settings = s; |
41 | _size = ""; | 40 | _size = ""; |
42 | _section = ""; | 41 | _section = ""; |
43 | _subsection = ""; | 42 | _subsection = ""; |
44 | _shortDesc = ""; | 43 | _shortDesc = ""; |
45 | _desc = ""; | 44 | _desc = ""; |
46 | _name = ""; | 45 | _name = ""; |
@@ -49,47 +48,47 @@ void Package::init( PackageManagerSettings *s ) | |||
49 | _old = false; | 48 | _old = false; |
50 | _status = ""; | 49 | _status = ""; |
51 | _dest = settings->getDestinationName(); | 50 | _dest = settings->getDestinationName(); |
52 | _link = settings->createLinks(); | 51 | _link = settings->createLinks(); |
53 | _versions=0; | 52 | _versions=0; |
54 | _version=""; | 53 | _version=""; |
55 | } | 54 | } |
56 | 55 | ||
57 | Package::Package( QStringList pack, PackageManagerSettings *s , QObject *parent, const char *name ) | 56 | OipkgPackage::OipkgPackage( QStringList pack, PackageManagerSettings *s , QObject *parent, const char *name ) |
58 | : QObject(parent,name) | 57 | : QObject(parent,name) |
59 | { | 58 | { |
60 | init(s); | 59 | init(s); |
61 | parsePackage( pack ); | 60 | parsePackage( pack ); |
62 | } | 61 | } |
63 | 62 | ||
64 | Package::Package( QString n, PackageManagerSettings *s, QObject *parent, const char *name ) | 63 | OipkgPackage::OipkgPackage( QString n, PackageManagerSettings *s, QObject *parent, const char *name ) |
65 | : QObject(parent,name) | 64 | : QObject(parent,name) |
66 | { | 65 | { |
67 | init(s); | 66 | init(s); |
68 | if ( !QFile::exists( n ) ) | 67 | if ( !QFile::exists( n ) ) |
69 | { | 68 | { |
70 | _name = QString( n ); | 69 | _name = QString( n ); |
71 | }else{ | 70 | }else{ |
72 | pvDebug(4,"remote file: "+n); | 71 | pvDebug(4,"remote file: "+n); |
73 | parseIpkgFile( n ); | 72 | parseIpkgFile( n ); |
74 | _useFileName = true; | 73 | _useFileName = true; |
75 | _fileName = QString( n ); | 74 | _fileName = QString( n ); |
76 | } | 75 | } |
77 | } | 76 | } |
78 | 77 | ||
79 | Package::Package( Package *pi, QObject *parent, const char *name ) | 78 | OipkgPackage::OipkgPackage( OipkgPackage *pi, QObject *parent, const char *name ) |
80 | : QObject(parent,name) | 79 | : QObject(parent,name) |
81 | { | 80 | { |
82 | init(pi->settings); | 81 | init(pi->settings); |
83 | copyValues( pi ); | 82 | copyValues( pi ); |
84 | } | 83 | } |
85 | 84 | ||
86 | 85 | ||
87 | void Package::setValue( QString n, QString t ) | 86 | void OipkgPackage::setValue( QString n, QString t ) |
88 | { | 87 | { |
89 | if ( n == "Package" ) | 88 | if ( n == "Package" ) |
90 | { | 89 | { |
91 | _name = QString( t ); | 90 | _name = QString( t ); |
92 | }else if ( n == "Installed-Size" ) | 91 | }else if ( n == "Installed-Size" ) |
93 | { | 92 | { |
94 | _size = t; | 93 | _size = t; |
95 | // }else if ( n == "Priority") | 94 | // }else if ( n == "Priority") |
@@ -132,184 +131,183 @@ void Package::setValue( QString n, QString t ) | |||
132 | // }else if ( n == "Essential") | 131 | // }else if ( n == "Essential") |
133 | // { | 132 | // { |
134 | 133 | ||
135 | }else{ | 134 | }else{ |
136 | _values.insert(n,new QString(t)); | 135 | _values.insert(n,new QString(t)); |
137 | } | 136 | } |
138 | } | 137 | } |
139 | 138 | ||
140 | QString Package::name() | 139 | QString OipkgPackage::name() |
141 | { | 140 | { |
142 | if (_displayName.isEmpty() ) return _name; | 141 | if (_displayName.isEmpty() ) return _name; |
143 | else return _displayName; | 142 | else return _displayName; |
144 | } | 143 | } |
145 | 144 | ||
146 | 145 | ||
147 | QString Package::installName() | 146 | QString OipkgPackage::installName() |
148 | { | 147 | { |
149 | if (_useFileName) return _fileName; | 148 | if (_useFileName) return _fileName; |
150 | else return _name; | 149 | else return _name; |
151 | } | 150 | } |
152 | 151 | ||
153 | QString Package::packageName() | 152 | QString OipkgPackage::packageName() |
154 | { | 153 | { |
155 | QString pn = installName(); | 154 | QString pn = installName(); |
156 | pn = pn.right(pn.length()-pn.findRev("/")); | 155 | pn = pn.right(pn.length()-pn.findRev("/")); |
157 | pn = pn.left(pn.find("_")); | 156 | pn = pn.left(pn.find("_")); |
158 | return pn; | 157 | return pn; |
159 | } | 158 | } |
160 | 159 | ||
161 | bool Package::installed() | 160 | bool OipkgPackage::installed() |
162 | { | 161 | { |
163 | if (_status.contains("installed")) | 162 | if (_status.contains("installed")) |
164 | { | 163 | { |
165 | if (_status.contains("not-installed")) | 164 | if (_status.contains("not-installed")) |
166 | { | 165 | { |
167 | _toProcess = true; | 166 | _toProcess = true; |
168 | return false; | 167 | return false; |
169 | } | 168 | } |
170 | else return true; | 169 | else return true; |
171 | } | 170 | } |
172 | else | 171 | else |
173 | if (_versions) | 172 | if (_versions) |
174 | { | 173 | { |
175 | QDictIterator<Package> other( *_versions ); | 174 | QDictIterator<OipkgPackage> other( *_versions ); |
176 | while ( other.current() ) | 175 | while ( other.current() ) |
177 | { | 176 | { |
178 | if (other.current()->status().contains("installed") | 177 | if (other.current()->status().contains("installed") |
179 | && other.current()->version() == version()) | 178 | && other.current()->version() == version()) |
180 | return true; | 179 | return true; |
181 | ++other; | 180 | ++other; |
182 | } | 181 | } |
183 | } | 182 | } |
184 | return false; | 183 | return false; |
185 | } | 184 | } |
186 | 185 | ||
187 | bool Package::otherInstalled() | 186 | bool OipkgPackage::otherInstalled() |
188 | { | 187 | { |
189 | if (_versions) | 188 | if (_versions) |
190 | { | 189 | { |
191 | QDictIterator<Package> other( *_versions ); | 190 | QDictIterator<OipkgPackage> other( *_versions ); |
192 | while ( other.current() ) | 191 | while ( other.current() ) |
193 | { | 192 | { |
194 | if (other.current()->installed()) return true; | 193 | if (other.current()->installed()) return true; |
195 | ++other; | 194 | ++other; |
196 | } | 195 | } |
197 | } | 196 | } |
198 | return false; | 197 | return false; |
199 | } | 198 | } |
200 | 199 | ||
201 | void Package::setDesc( QString s ) | 200 | void OipkgPackage::setDesc( QString s ) |
202 | { | 201 | { |
203 | _desc = s; | 202 | _desc = s; |
204 | _shortDesc = s.left( s.find("\n") ); | 203 | _shortDesc = s.left( s.find("\n") ); |
205 | } | 204 | } |
206 | 205 | ||
207 | QString Package::desc() | 206 | QString OipkgPackage::desc() |
208 | { | 207 | { |
209 | return _desc; | 208 | return _desc; |
210 | } | 209 | } |
211 | 210 | ||
212 | QString Package::shortDesc() | 211 | QString OipkgPackage::shortDesc() |
213 | { | 212 | { |
214 | return _shortDesc; | 213 | return _shortDesc; |
215 | } | 214 | } |
216 | 215 | ||
217 | QString Package::size() | 216 | QString OipkgPackage::size() |
218 | { | 217 | { |
219 | return _size; | 218 | return _size; |
220 | } | 219 | } |
221 | 220 | ||
222 | 221 | ||
223 | QString Package::version() | 222 | QString OipkgPackage::version() |
224 | { | 223 | { |
225 | return _version; | 224 | return _version; |
226 | } | 225 | } |
227 | 226 | ||
228 | QString Package::sizeUnits() | 227 | QString OipkgPackage::sizeUnits() |
229 | { | 228 | { |
230 | int i = _size.toInt(); | 229 | int i = _size.toInt(); |
231 | int c = 0; | 230 | int c = 0; |
232 | QString ret; | 231 | QString ret; |
233 | QStringList unit; | 232 | QStringList unit; |
234 | unit << "B" << "KB" << "MB" << "GB" << "TB"; //prepair for the future ;) | 233 | unit << "B" << "KB" << "MB" << "GB" << "TB"; //prepair for the future ;) |
235 | while (i > 1) | 234 | while (i > 1) |
236 | { | 235 | { |
237 | ret=QString::number(i)+" "+unit[c]; | 236 | ret=QString::number(i)+" "+unit[c]; |
238 | c++; | 237 | c++; |
239 | i /= 1024; | 238 | i /= 1024; |
240 | } | 239 | } |
241 | return ret; | 240 | return ret; |
242 | } | 241 | } |
243 | 242 | ||
244 | bool Package::toProcess() | 243 | bool OipkgPackage::toProcess() |
245 | { | 244 | { |
246 | return _toProcess; | 245 | return _toProcess; |
247 | } | 246 | } |
248 | 247 | ||
249 | bool Package::toRemove() | 248 | bool OipkgPackage::toRemove() |
250 | { | 249 | { |
251 | if ( _toProcess && installed() ) return true; | 250 | if ( _toProcess && installed() ) return true; |
252 | else return false; | 251 | else return false; |
253 | } | 252 | } |
254 | 253 | ||
255 | bool Package::toInstall() | 254 | bool OipkgPackage::toInstall() |
256 | { | 255 | { |
257 | if ( _toProcess && !installed() ) return true; | 256 | if ( _toProcess && !installed() ) return true; |
258 | else return false; | 257 | else return false; |
259 | } | 258 | } |
260 | 259 | ||
261 | void Package::toggleProcess() | 260 | void OipkgPackage::toggleProcess() |
262 | { | 261 | { |
263 | _toProcess = ! _toProcess; | 262 | _toProcess = ! _toProcess; |
264 | } | 263 | } |
265 | 264 | ||
266 | 265 | ||
267 | 266 | void OipkgPackage::copyValues( OipkgPackage* pack ) | |
268 | void Package::copyValues( Package* pack ) | ||
269 | { | 267 | { |
270 | if (_size.isEmpty() && !pack->_size.isEmpty()) _size = QString( pack->_size ); | 268 | if (_size.isEmpty() && !pack->_size.isEmpty()) _size = QString( pack->_size ); |
271 | if (_section.isEmpty() && !pack->_section.isEmpty()) _section = QString( pack->_section ); | 269 | if (_section.isEmpty() && !pack->_section.isEmpty()) _section = QString( pack->_section ); |
272 | if (_subsection.isEmpty()&& !pack->_subsection.isEmpty()) _subsection = QString( pack->_subsection ); | 270 | if (_subsection.isEmpty()&& !pack->_subsection.isEmpty()) _subsection = QString( pack->_subsection ); |
273 | if (_shortDesc.isEmpty() && !pack->_shortDesc.isEmpty()) _shortDesc = QString( pack->_shortDesc ); | 271 | if (_shortDesc.isEmpty() && !pack->_shortDesc.isEmpty()) _shortDesc = QString( pack->_shortDesc ); |
274 | if (_desc.isEmpty() && !pack->_desc.isEmpty()) _desc = QString( pack->_desc ); | 272 | if (_desc.isEmpty() && !pack->_desc.isEmpty()) _desc = QString( pack->_desc ); |
275 | if (_name.isEmpty() && !pack->_name.isEmpty()) _name = QString( pack->_name ); | 273 | if (_name.isEmpty() && !pack->_name.isEmpty()) _name = QString( pack->_name ); |
276 | if (_dest.isEmpty() && !pack->_dest.isEmpty()) _dest= QString( pack->_dest ); | 274 | if (_dest.isEmpty() && !pack->_dest.isEmpty()) _dest= QString( pack->_dest ); |
277 | if (_displayName.isEmpty()&& !pack->_displayName.isEmpty()) _displayName = QString( pack->_displayName ); | 275 | if (_displayName.isEmpty()&& !pack->_displayName.isEmpty()) _displayName = QString( pack->_displayName ); |
278 | if (_fileName.isEmpty() && !pack->_fileName.isEmpty()) _fileName = QString( pack->_fileName ); | 276 | if (_fileName.isEmpty() && !pack->_fileName.isEmpty()) _fileName = QString( pack->_fileName ); |
279 | if (_version.isEmpty() && !pack->_version.isEmpty()) _version = QString( pack->_version ); | 277 | if (_version.isEmpty() && !pack->_version.isEmpty()) _version = QString( pack->_version ); |
280 | if (_values.isEmpty() && !pack->_values.isEmpty())_values = QDict<QString>( pack->_values ); | 278 | if (_values.isEmpty() && !pack->_values.isEmpty())_values = QDict<QString>( pack->_values ); |
281 | if (!installed() && _status.isEmpty() && !pack->_status.isEmpty()) _status = QString( pack->_status ); | 279 | if (!installed() && _status.isEmpty() && !pack->_status.isEmpty()) _status = QString( pack->_status ); |
282 | } | 280 | } |
283 | 281 | ||
284 | QString Package::section() | 282 | QString OipkgPackage::section() |
285 | { | 283 | { |
286 | return _section; | 284 | return _section; |
287 | } | 285 | } |
288 | 286 | ||
289 | void Package::setSection( QString s) | 287 | void OipkgPackage::setSection( QString s) |
290 | { | 288 | { |
291 | int i = s.find("/"); | 289 | int i = s.find("/"); |
292 | if ( i > 0 ) | 290 | if ( i > 0 ) |
293 | { | 291 | { |
294 | _section = s.left(i); | 292 | _section = s.left(i); |
295 | _subsection = s.mid(i+1); | 293 | _subsection = s.mid(i+1); |
296 | }else{ | 294 | }else{ |
297 | _section = s; | 295 | _section = s; |
298 | _subsection = ""; | 296 | _subsection = ""; |
299 | } | 297 | } |
300 | } | 298 | } |
301 | 299 | ||
302 | QString Package::subSection() | 300 | QString OipkgPackage::subSection() |
303 | { | 301 | { |
304 | return _subsection; | 302 | return _subsection; |
305 | } | 303 | } |
306 | 304 | ||
307 | void Package::parsePackage( QStringList pack ) | 305 | void OipkgPackage::parsePackage( QStringList pack ) |
308 | { | 306 | { |
309 | if ( pack.isEmpty() ) return; | 307 | if ( pack.isEmpty() ) return; |
310 | int count = pack.count(); | 308 | int count = pack.count(); |
311 | for( int i = 0; i < count; i++ ) | 309 | for( int i = 0; i < count; i++ ) |
312 | { | 310 | { |
313 | QString line = pack[i]; | 311 | QString line = pack[i]; |
314 | int sep = line.find( QRegExp(":[\t ]+") ); | 312 | int sep = line.find( QRegExp(":[\t ]+") ); |
315 | if ( sep >= 0 ) | 313 | if ( sep >= 0 ) |
@@ -318,17 +316,17 @@ void Package::parsePackage( QStringList pack ) | |||
318 | QString value = line.mid(sep+2).simplifyWhiteSpace(); | 316 | QString value = line.mid(sep+2).simplifyWhiteSpace(); |
319 | setValue( tag, value ); | 317 | setValue( tag, value ); |
320 | }else{ | 318 | }else{ |
321 | } | 319 | } |
322 | } | 320 | } |
323 | return; | 321 | return; |
324 | } | 322 | } |
325 | 323 | ||
326 | QString Package::details() | 324 | QString OipkgPackage::details() |
327 | { | 325 | { |
328 | QString status; | 326 | QString status; |
329 | Process ipkg_status(QStringList() << "ipkg" << "info" << name() ); | 327 | Process ipkg_status(QStringList() << "ipkg" << "info" << name() ); |
330 | QString description; | 328 | QString description; |
331 | if ( ipkg_status.exec("",status) ) | 329 | if ( ipkg_status.exec("",status) ) |
332 | { | 330 | { |
333 | QStringList lines = QStringList::split('\n',status,TRUE); | 331 | QStringList lines = QStringList::split('\n',status,TRUE); |
334 | for (QStringList::Iterator it = lines.begin(); it!=lines.end(); ++it) { | 332 | for (QStringList::Iterator it = lines.begin(); it!=lines.end(); ++it) { |
@@ -357,54 +355,54 @@ QString Package::details() | |||
357 | description.append(Qtopia::escapeString(line)); | 355 | description.append(Qtopia::escapeString(line)); |
358 | } | 356 | } |
359 | } | 357 | } |
360 | } | 358 | } |
361 | } | 359 | } |
362 | return description; | 360 | return description; |
363 | } | 361 | } |
364 | 362 | ||
365 | void Package::processed() | 363 | void OipkgPackage::processed() |
366 | { | 364 | { |
367 | _toProcess = false; | 365 | _toProcess = false; |
368 | //hack, but we're not writing status anyway... | 366 | //hack, but we're not writing status anyway... |
369 | if ( installed() ) _status = "install"; | 367 | if ( installed() ) _status = "install"; |
370 | else _status = "installed"; | 368 | else _status = "installed"; |
371 | } | 369 | } |
372 | 370 | ||
373 | QString Package::dest() | 371 | QString OipkgPackage::dest() |
374 | { | 372 | { |
375 | if ( installed()||(!installed() && _toProcess) ) | 373 | if ( installed()||(!installed() && _toProcess) ) |
376 | return _dest!=""?_dest:settings->getDestinationName(); | 374 | return _dest!=""?_dest:settings->getDestinationName(); |
377 | else return ""; | 375 | else return ""; |
378 | } | 376 | } |
379 | 377 | ||
380 | void Package::setDest( QString d ) | 378 | void OipkgPackage::setDest( QString d ) |
381 | { | 379 | { |
382 | if ( d == "remote") _useFileName = true; | 380 | if ( d == "remote") _useFileName = true; |
383 | else _dest = d; | 381 | else _dest = d; |
384 | } | 382 | } |
385 | 383 | ||
386 | void Package::setOn() | 384 | void OipkgPackage::setOn() |
387 | { | 385 | { |
388 | _toProcess = true; | 386 | _toProcess = true; |
389 | } | 387 | } |
390 | 388 | ||
391 | bool Package::link() | 389 | bool OipkgPackage::link() |
392 | { | 390 | { |
393 | if ( _dest == "root" || (!installed() && !_toProcess) ) return false; | 391 | if ( _dest == "root" || (!installed() && !_toProcess) ) return false; |
394 | return _link; | 392 | return _link; |
395 | } | 393 | } |
396 | 394 | ||
397 | void Package::setLink(bool b) | 395 | void OipkgPackage::setLink(bool b) |
398 | { | 396 | { |
399 | _link = b; | 397 | _link = b; |
400 | } | 398 | } |
401 | 399 | ||
402 | void Package::parseIpkgFile( QString file) | 400 | void OipkgPackage::parseIpkgFile( QString file) |
403 | { | 401 | { |
404 | // 20020830 | 402 | // 20020830 |
405 | // a quick hack to make oipkg understand the new ipk format | 403 | // a quick hack to make oipkg understand the new ipk format |
406 | // neu: ar pf PACKAGE control.tar.gz | tar xfOz - ./control > /tmp/control | 404 | // neu: ar pf PACKAGE control.tar.gz | tar xfOz - ./control > /tmp/control |
407 | if (system("ar pf "+file+" control.tar.gz | tar xfOz - ./control > /tmp/control") != 0) | 405 | if (system("ar pf "+file+" control.tar.gz | tar xfOz - ./control > /tmp/control") != 0) |
408 | { | 406 | { |
409 | //#old tar ipk format | 407 | //#old tar ipk format |
410 | system("tar xzf "+file+" -C /tmp"); | 408 | system("tar xzf "+file+" -C /tmp"); |
@@ -420,60 +418,60 @@ void Package::parseIpkgFile( QString file) | |||
420 | pack << t.readLine(); | 418 | pack << t.readLine(); |
421 | } | 419 | } |
422 | f.close(); | 420 | f.close(); |
423 | parsePackage( pack ); | 421 | parsePackage( pack ); |
424 | } | 422 | } |
425 | 423 | ||
426 | } | 424 | } |
427 | 425 | ||
428 | //QString Package::getPackageName() | 426 | //QString OipkgPackage::getPackageName() |
429 | //{ | 427 | //{ |
430 | //if ( _packageName.isEmpty() ) return _name; | 428 | //if ( _packageName.isEmpty() ) return _name; |
431 | //else return _packageName; | 429 | //else return _packageName; |
432 | //} | 430 | //} |
433 | 431 | ||
434 | void Package::instalFromFile(bool iff) | 432 | void OipkgPackage::instalFromFile(bool iff) |
435 | { | 433 | { |
436 | _useFileName = iff; | 434 | _useFileName = iff; |
437 | } | 435 | } |
438 | 436 | ||
439 | void Package::setName(QString n) | 437 | void OipkgPackage::setName(QString n) |
440 | { | 438 | { |
441 | _displayName = n; | 439 | _displayName = n; |
442 | } | 440 | } |
443 | 441 | ||
444 | QDict<QString>* Package::getFields() | 442 | QDict<QString>* OipkgPackage::getFields() |
445 | { | 443 | { |
446 | return &_values; | 444 | return &_values; |
447 | } | 445 | } |
448 | 446 | ||
449 | QString Package::status() | 447 | QString OipkgPackage::status() |
450 | { | 448 | { |
451 | return _status; | 449 | return _status; |
452 | } | 450 | } |
453 | 451 | ||
454 | bool Package::isOld() | 452 | bool OipkgPackage::isOld() |
455 | { | 453 | { |
456 | if (!_versions) return false; | 454 | if (!_versions) return false; |
457 | QDictIterator<Package> other( *_versions ); | 455 | QDictIterator<OipkgPackage> other( *_versions ); |
458 | while ( other.current() ) { | 456 | while ( other.current() ) { |
459 | if (other.current()->version() > version() ) return true; | 457 | if (other.current()->version() > version() ) return true; |
460 | ++other; | 458 | ++other; |
461 | } | 459 | } |
462 | return false; | 460 | return false; |
463 | } | 461 | } |
464 | 462 | ||
465 | bool Package::hasVersions() | 463 | bool OipkgPackage::hasVersions() |
466 | { | 464 | { |
467 | if (!_versions) return false; | 465 | if (!_versions) return false; |
468 | else return true; | 466 | else return true; |
469 | } | 467 | } |
470 | 468 | ||
471 | QDict<Package>* Package::getOtherVersions() | 469 | QDict<OipkgPackage>* OipkgPackage::getOtherVersions() |
472 | { | 470 | { |
473 | return _versions; | 471 | return _versions; |
474 | } | 472 | } |
475 | 473 | ||
476 | void Package::setOtherVersions(QDict<Package> *v) | 474 | void OipkgPackage::setOtherVersions(QDict<OipkgPackage> *v) |
477 | { | 475 | { |
478 | _versions=v; | 476 | _versions=v; |
479 | } | 477 | } |