author | tille <tille> | 2002-04-27 21:02:53 (UTC) |
---|---|---|
committer | tille <tille> | 2002-04-27 21:02:53 (UTC) |
commit | 69e271e44d23befc74a96a98708ddb6ec754a4b6 (patch) (side-by-side diff) | |
tree | 6f8300d8858d2c7659eb90066b58b302a2863e43 /noncore/unsupported/oipkg/package.cpp | |
parent | acdc33336307e48ac7089b146006fe7b36e321a5 (diff) | |
download | opie-69e271e44d23befc74a96a98708ddb6ec754a4b6.zip opie-69e271e44d23befc74a96a98708ddb6ec754a4b6.tar.gz opie-69e271e44d23befc74a96a98708ddb6ec754a4b6.tar.bz2 |
setDocument working and some changes in install gui
Diffstat (limited to 'noncore/unsupported/oipkg/package.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 9f602b5..5f0e5fa 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp @@ -4,2 +4,6 @@ #include <qpe/stringutil.h> +#include <qfile.h> +#include <qtextstream.h> +#include <stdlib.h> +#include <unistd.h> @@ -27,3 +31,4 @@ void Package::init( PackageManagerSettings *s ) _status = ""; - _dest = ""; + _dest = settings->getDestinationName(); + _link = settings->createLinks(); } @@ -34,3 +39,2 @@ Package::Package( QStringList pack, PackageManagerSettings *s ) parsePackage( pack ); - _toProcess = false; } @@ -40,4 +44,10 @@ Package::Package( QString n, PackageManagerSettings *s ) init(s); + if ( !QFile::exists( n ) ) + { _name = QString( n ); - _toProcess = false; + }else{ + parseIpkgFile( n ); + _toProcess = true; + _packageName = QString( n ); + } } @@ -48,3 +58,2 @@ Package::Package( Package *pi ) copyValues( pi ); - _toProcess = false; } @@ -297 +306,26 @@ void Package::setLink(bool b) } + +void Package::parseIpkgFile( QString file) +{ + 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; +} |