summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/package.cpp8
-rw-r--r--noncore/unsupported/oipkg/package.h1
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp5
3 files changed, 12 insertions, 2 deletions
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp
index 517b37a..8bbdd77 100644
--- a/noncore/unsupported/oipkg/package.cpp
+++ b/noncore/unsupported/oipkg/package.cpp
@@ -118,48 +118,56 @@ void Package::setValue( QString n, QString t )
{
if ( installed() ) return;
_status = t;
// }else if ( n == "Essential")
// {
}else{
_values.insert(n,new QString(t));
}
}
QString Package::name()
{
if (_displayName.isEmpty() ) return _name;
else return _displayName;
}
QString Package::installName()
{
if (_useFileName) return _fileName;
else return _name;
}
+QString Package::packageName()
+{
+ QString pn = installName();
+ pn = pn.right(pn.length()-pn.findRev("/"));
+ pn = pn.left(pn.find("_"));
+ return pn;
+}
+
bool Package::installed()
{
if (_status.contains("installed"))
{
if (_status.contains("not-installed"))
{
_toProcess = true;
return false;
}
else return true;
}
else
if (_versions)
{
QDictIterator<Package> other( *_versions );
while ( other.current() )
{
if (other.current()->status().contains("installed")
&& other.current()->version() == version())
return true;
++other;
}
}
return false;
diff --git a/noncore/unsupported/oipkg/package.h b/noncore/unsupported/oipkg/package.h
index f50b9b5..0f76ece 100644
--- a/noncore/unsupported/oipkg/package.h
+++ b/noncore/unsupported/oipkg/package.h
@@ -5,48 +5,49 @@
#include <qlistview.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qdict.h>
#include <qobject.h>
#include "pksettings.h"
class Package : public QObject
{
Q_OBJECT
public:
Package(QObject *parent=0, const char *name=0);
Package(PackageManagerSettings *s, QObject *parent=0, const char *name=0);
~Package();
Package( QStringList, PackageManagerSettings *s, QObject *parent=0, const char *name=0 );
Package( QString, PackageManagerSettings *s, QObject *parent=0, const char *name=0 );
Package( Package*s, QObject *parent=0, const char *name=0 );
void setValue( QString, QString );
void copyValues( Package* );
QString name();
QString installName();
+ QString packageName();
bool installed();
bool otherInstalled();
void setDesc( QString );
QString shortDesc();
QString desc();
QString size();
QString sizeUnits();
QString version();
void setSection( QString );
QString section();
QString subSection();
QString details();
bool toProcess();
bool toInstall();
bool toRemove();
void processed();
QString dest();
void setDest( QString d );
void setOn();
bool link();
void setLink(bool);
bool isOld();
bool hasVersions();
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 7d0e246..89309a2 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -39,49 +39,49 @@ PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlag
connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)),
this, SLOT(getIpkgOutput(OProcess*,char*,int)));
connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)),
this, SLOT(getIpkgOutput(OProcess*,char*,int)));
installDialog = 0;
#endif
}
PmIpkg::~PmIpkg()
{
#ifdef OPROCESS
delete ipkgProcess;
#endif
}
bool PmIpkg::runIpkg(const QString& args, const QString& dest )
{
bool ret=false;
QDir::setCurrent("/tmp");
QString cmd = "/usr/bin/ipkg ";
#ifdef OPROCESS
ipkgProcess->clearArguments();
*ipkgProcess << "/usr/bin/ipkg ";
- QString cmd = "";
+ cmd = "";
#endif
pvDebug( 3,"PmIpkg::runIpkg got dest="+dest);
if ( dest == "" )
cmd += " -dest "+settings->getDestinationName();
else
cmd += " -dest "+ dest;
cmd += " -force-defaults ";
if (installDialog && installDialog->_force_depends)
{
if (installDialog->_force_depends->isChecked())
cmd += " -force-depends ";
if (installDialog->_force_reinstall->isChecked())
cmd += " -force-reinstall ";
if (installDialog->_force_remove->isChecked())
cmd += " -force-removal-of-essential-packages ";
}
out( "Starting to "+ args+"\n");
cmd += args;
out( "running:\n"+cmd+"\n" );
pvDebug(2,"running:"+cmd);
#ifdef OPROCESS
@@ -132,49 +132,50 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
ret = false;
} else {
while ( fgets( line, sizeof line, fp) != NULL)
{
lineStr = line;
lineStr=lineStr.left(lineStr.length()-1);
//Configuring opie-oipkg...Done
if (lineStr.contains("Done")) ret = true;
if (lineStr!=lineStrOld)
out(lineStr);
lineStrOld = lineStr;
qApp->processEvents();
}
}
pclose(fp);
#endif
//out( "Finished!");
pvDebug(2,QString(ret?"success\n":"failure\n"));
return ret;
}
void PmIpkg::makeLinks(Package *pack)
{
pvDebug( 2, "PmIpkg::makeLinks "+ pack->name());
- linkPackage( pack->name(), pack->dest() );
+ QString pn = pack->name();
+ linkPackage( pack->packageName(), pack->dest() );
}
QStringList* PmIpkg::getList( QString packFileName, QString d )
{
QString dest = settings->getDestinationUrlByName( d );
dest = dest==""?d:dest;
if (dest == "/" ) return 0;
{
Config cfg( "oipkg", Config::User );
cfg.setGroup( "Common" );
QString statusDir = cfg.readEntry( "statusDir", "" );
}
packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list";
QFile f( packFileName );
if ( ! f.open(IO_ReadOnly) )
{
pvDebug(1," Panik! Could not open");
out( "Panik!\n Could not open:\n"+packFileName );
return (QStringList*)0;
}
QStringList *fileList = new QStringList();
QTextStream t( &f );
while ( !t.eof() )
{