summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/package.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/oipkg/package.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/package.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp
index 4542e42..8c5f0ea 100644
--- a/noncore/unsupported/oipkg/package.cpp
+++ b/noncore/unsupported/oipkg/package.cpp
@@ -29,48 +29,49 @@ void Package::init( PackageManagerSettings *s )
_name = "";
_toProcess = false;
_useFileName = false;
_old = false;
_status = "";
_dest = settings->getDestinationName();
_link = settings->createLinks();
_versions=0;
_version="";
}
Package::Package( QStringList pack, PackageManagerSettings *s )
{
init(s);
parsePackage( pack );
}
Package::Package( QString n, PackageManagerSettings *s )
{
init(s);
if ( !QFile::exists( n ) )
{
_name = QString( n );
}else{
+ pvDebug(2,"remote file: "+n);
parseIpkgFile( n );
_useFileName = true;
_fileName = QString( n );
}
}
Package::Package( Package *pi )
{
init(pi->settings);
copyValues( pi );
}
void Package::setValue( QString n, QString t )
{
if ( n == "Package" )
{
_name = QString( t );
}else if ( n == "Installed-Size" )
{
_size = t;
// }else if ( n == "Priority")
// {
@@ -321,49 +322,50 @@ QString Package::details()
}
}
}
}
return description;
}
void Package::processed()
{
_toProcess = false;
//hack, but we're not writing status anyway...
if ( installed() ) _status = "install";
else _status = "installed";
}
QString Package::dest()
{
if ( installed()||(!installed() && _toProcess) )
return _dest!=""?_dest:settings->getDestinationName();
else return "";
}
void Package::setDest( QString d )
{
- _dest = d;
+ if ( d == "remote") _useFileName = true;
+ else _dest = d;
}
void Package::setOn()
{
_toProcess = true;
}
bool Package::link()
{
if ( _dest == "root" || (!installed() && !_toProcess) ) return false;
return _link;
}
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");
QFile f("/tmp/control");
if ( f.open(IO_ReadOnly) )