summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/package.cpp23
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
@@ -53,20 +53,20 @@ void Package::init( PackageManagerSettings *s )
_versions=0;
_version="";
}
Package::Package( QStringList pack, PackageManagerSettings *s , QObject *parent, const char *name )
: QObject(parent,name)
-{
+{
init(s);
parsePackage( pack );
}
Package::Package( QString n, PackageManagerSettings *s, QObject *parent, const char *name )
: QObject(parent,name)
-{
+{
init(s);
if ( !QFile::exists( n ) )
{
_name = QString( n );
}else{
pvDebug(4,"remote file: "+n);
@@ -115,13 +115,13 @@ void Package::setValue( QString n, QString t )
}else if ( n == "Filename")
{
_fileName = t;
// }else if ( n == "Size")
// {
-//
+//
// }else if ( n == "MD5Sum")
// {
}else if ( n == "Description")
{
setDesc( t );
@@ -382,13 +382,13 @@ void Package::setDest( QString d )
if ( d == "remote") _useFileName = true;
else _dest = d;
}
void Package::setOn()
{
- _toProcess = true;
+ _toProcess = true;
}
bool Package::link()
{
if ( _dest == "root" || (!installed() && !_toProcess) ) return false;
return _link;
@@ -398,27 +398,34 @@ void Package::setLink(bool b)
{
_link = b;
}
void Package::parseIpkgFile( QString file)
{
- system("tar xzf "+file+" -C /tmp");
- system("tar xzf /tmp/control.tar.gz -C /tmp");
+// 20020830
+// a quick hack to make oipkg understand the new ipk format
+// neu: ar pf PACKAGE control.tar.gz | tar xfOz - ./control > /tmp/control
+ if (! system("ar pf "+file+" control.tar.gz | tar xfOz - ./control > /tmp/control") )
+ {
+//#old tar ipk format
+ system("tar xzf "+file+" -C /tmp");
+ system("tar xzf /tmp/control.tar.gz -C /tmp");
+ }
QFile f("/tmp/control");
if ( f.open(IO_ReadOnly) )
{
QTextStream t( &f );
QStringList pack;
while ( !t.eof() )
{
pack << t.readLine();
}
f.close();
parsePackage( pack );
}
-
+
}
//QString Package::getPackageName()
//{
// if ( _packageName.isEmpty() ) return _name;
// else return _packageName;
@@ -433,13 +440,13 @@ void Package::setName(QString n)
{
_displayName = n;
}
QDict<QString>* Package::getFields()
{
- return &_values;
+ return &_values;
}
QString Package::status()
{
return _status;
}