summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/oipkg.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/packagemanager/oipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/oipkg.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp
index ffb3687..38cd824 100644
--- a/noncore/settings/packagemanager/oipkg.cpp
+++ b/noncore/settings/packagemanager/oipkg.cpp
@@ -377,96 +377,98 @@ OPackageList *OIpkg::installedPackages( const QString &destName, const QString &
if ( key == "Description" )
{
line = t.readLine();
while ( !line.isEmpty() && line.find( ':', 0 ) == -1 && !t.eof() )
line = t.readLine();
}
else
line = t.readLine();
}
f.close();
// Make sure to add to list last entry
if ( !name.isNull() && status.contains( " installed" ) )
pl->append( new OPackage( name, QString::null, version, QString::null, destName ) );
return pl;
}
OConfItem *OIpkg::findConfItem( OConfItem::Type type, const QString &name )
{
// Find configuration item in list
OConfItemListIterator configIt( *m_confInfo );
OConfItem *config = 0l;
for ( ; configIt.current(); ++configIt )
{
config = configIt.current();
if ( config->type() == type && config->name() == name )
break;
}
if ( config && config->type() == type && config->name() == name )
return config;
return 0l;
}
bool OIpkg::executeCommand( OPackage::Command command, const QStringList &parameters, const QString &destination,
const QObject *receiver, const char *slotOutput, bool rawOutput )
{
if ( command == OPackage::NotDefined )
return false;
// Set ipkg run-time options/arguments
m_ipkgArgs.force_depends = ( m_ipkgExecOptions & FORCE_DEPENDS );
m_ipkgArgs.force_reinstall = ( m_ipkgExecOptions & FORCE_REINSTALL );
// TODO m_ipkgArgs.force_remove = ( m_ipkgExecOptions & FORCE_REMOVE );
m_ipkgArgs.force_overwrite = ( m_ipkgExecOptions & FORCE_OVERWRITE );
+ m_ipkgArgs.force_removal_of_dependent_packages = ( m_ipkgExecOptions & FORCE_RECURSIVE );
+ m_ipkgArgs.verbose_wget = ( m_ipkgExecOptions & FORCE_VERBOSE_WGET );
m_ipkgArgs.verbosity = m_ipkgExecVerbosity;
if ( m_ipkgArgs.dest )
free( m_ipkgArgs.dest );
if ( !destination.isNull() )
{
int len = destination.length() + 1;
m_ipkgArgs.dest = (char *)malloc( len );
strncpy( m_ipkgArgs.dest, destination, destination.length() );
m_ipkgArgs.dest[ len - 1 ] = '\0';
}
else
m_ipkgArgs.dest = 0l;
// Connect output signal to widget
if ( !rawOutput )
{
// TODO - connect to local slot and parse output before emitting signalIpkgMessage
}
switch( command )
{
case OPackage::Update : {
connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput );
ipkg_lists_update( &m_ipkgArgs );
disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 );
};
break;
case OPackage::Upgrade : {
connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput );
ipkg_packages_upgrade( &m_ipkgArgs );
// Re-link non-root destinations to make sure everything is in sync
OConfItemList *destList = destinations();
OConfItemListIterator it( *destList );
for ( ; it.current(); ++it )
{
OConfItem *dest = it.current();
if ( dest->name() != "root" )
linkPackageDir( dest->name() );
}
delete destList;
disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 );
};
break;
case OPackage::Install : {
connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput );
for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it )