-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 7aaa240..1054a1d 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp | |||
@@ -56,14 +56,14 @@ void Package::init( PackageManagerSettings *s ) | |||
56 | 56 | ||
57 | Package::Package( QStringList pack, PackageManagerSettings *s , QObject *parent, const char *name ) | 57 | Package::Package( QStringList pack, PackageManagerSettings *s , QObject *parent, const char *name ) |
58 | : QObject(parent,name) | 58 | : QObject(parent,name) |
59 | { | 59 | { |
60 | init(s); | 60 | init(s); |
61 | parsePackage( pack ); | 61 | parsePackage( pack ); |
62 | } | 62 | } |
63 | 63 | ||
64 | Package::Package( QString n, PackageManagerSettings *s, QObject *parent, const char *name ) | 64 | Package::Package( QString n, PackageManagerSettings *s, QObject *parent, const char *name ) |
65 | : QObject(parent,name) | 65 | : QObject(parent,name) |
66 | { | 66 | { |
67 | init(s); | 67 | init(s); |
68 | if ( !QFile::exists( n ) ) | 68 | if ( !QFile::exists( n ) ) |
69 | { | 69 | { |
@@ -118,7 +118,7 @@ void Package::setValue( QString n, QString t ) | |||
118 | _fileName = t; | 118 | _fileName = t; |
119 | // }else if ( n == "Size") | 119 | // }else if ( n == "Size") |
120 | // { | 120 | // { |
121 | // | 121 | // |
122 | //}else if ( n == "MD5Sum") | 122 | //}else if ( n == "MD5Sum") |
123 | //{ | 123 | //{ |
124 | 124 | ||
@@ -385,7 +385,7 @@ void Package::setDest( QString d ) | |||
385 | 385 | ||
386 | void Package::setOn() | 386 | void Package::setOn() |
387 | { | 387 | { |
388 | _toProcess = true; | 388 | _toProcess = true; |
389 | } | 389 | } |
390 | 390 | ||
391 | bool Package::link() | 391 | bool Package::link() |
@@ -401,8 +401,15 @@ void Package::setLink(bool b) | |||
401 | 401 | ||
402 | void Package::parseIpkgFile( QString file) | 402 | void Package::parseIpkgFile( QString file) |
403 | { | 403 | { |
404 | system("tar xzf "+file+" -C /tmp"); | 404 | // 20020830 |
405 | system("tar xzf /tmp/control.tar.gz -C /tmp"); | 405 | // a quick hack to make oipkg understand the new ipk format |
406 | // 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") ) | ||
408 | { | ||
409 | //#old tar ipk format | ||
410 | system("tar xzf "+file+" -C /tmp"); | ||
411 | system("tar xzf /tmp/control.tar.gz -C /tmp"); | ||
412 | } | ||
406 | QFile f("/tmp/control"); | 413 | QFile f("/tmp/control"); |
407 | if ( f.open(IO_ReadOnly) ) | 414 | if ( f.open(IO_ReadOnly) ) |
408 | { | 415 | { |
@@ -415,7 +422,7 @@ void Package::parseIpkgFile( QString file) | |||
415 | f.close(); | 422 | f.close(); |
416 | parsePackage( pack ); | 423 | parsePackage( pack ); |
417 | } | 424 | } |
418 | 425 | ||
419 | } | 426 | } |
420 | 427 | ||
421 | //QString Package::getPackageName() | 428 | //QString Package::getPackageName() |
@@ -436,7 +443,7 @@ void Package::setName(QString n) | |||
436 | 443 | ||
437 | QDict<QString>* Package::getFields() | 444 | QDict<QString>* Package::getFields() |
438 | { | 445 | { |
439 | return &_values; | 446 | return &_values; |
440 | } | 447 | } |
441 | 448 | ||
442 | QString Package::status() | 449 | QString Package::status() |