summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/ChangeLog7
-rw-r--r--noncore/settings/packagemanager/oipkg.cpp12
-rw-r--r--noncore/settings/packagemanager/opackagemanager.cpp7
3 files changed, 16 insertions, 10 deletions
diff --git a/noncore/settings/packagemanager/ChangeLog b/noncore/settings/packagemanager/ChangeLog
index 608cd98..38756b1 100644
--- a/noncore/settings/packagemanager/ChangeLog
+++ b/noncore/settings/packagemanager/ChangeLog
@@ -1,19 +1,24 @@
+2005-02-16 Dan Williams <drw@handhelds.org>
+
+ * Fixed stupid bug where last package in status file was not shown as installed when it should be
+ * Removed printf's
+
2005-01-02 Dan Williams <drw@handhelds.org>
* Released version 0.6.1
* Implemented native package linking code to remove need for ipkg-link
* Implement package in OIpkg (removed from InstallDlg) as this is ipkg specific
* Many small code tweaks
-
+
2004-12-21 Dan Williams <drw@handhelds.org>
* Released version 0.6.0
* Added support for Ipkg 'src/gz' feeds
* Improve server and destination tabs UI's in configuration dialog
* Fix app linking to link all dependent packages as well as selected packages
* Hide 'Retrive File List' button once list is retrieved in Package Info dialog
2004-11-18 Dan Williams <drw@handhelds.org>
* Released version 0.5.0
* All v1.0 functionality implemented
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp
index f2d7e39..e7e292e 100644
--- a/noncore/settings/packagemanager/oipkg.cpp
+++ b/noncore/settings/packagemanager/oipkg.cpp
@@ -354,24 +354,28 @@ 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 )
@@ -444,25 +448,25 @@ bool OIpkg::executeCommand( OPackage::Command command, const QStringList &parame
{
ipkg_packages_install( &m_ipkgArgs, (*it) );
}
if ( destination != "root" )
linkPackageDir( destination );
};
break;
case OPackage::Remove : {
connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput );
// Get list of destinations for unlinking of packages not installed to root
OConfItemList *destList = destinations();
-
+
for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it )
{
unlinkPackage( (*it), destList );
ipkg_packages_remove( &m_ipkgArgs, (*it), true );
}
delete destList;
};
break;
case OPackage::Download : {
connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput );
for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it )
@@ -636,25 +640,25 @@ const QString &OIpkg::rootPath()
: m_rootPath = '/';
if ( m_rootPath.right( 1 ) == '/' )
m_rootPath.truncate( m_rootPath.length() - 1 );
}
return m_rootPath;
}
void OIpkg::linkPackageDir( const QString &dest )
{
if ( !dest.isNull() )
{
OConfItem *destConfItem = findConfItem( OConfItem::Destination, dest );
-
+
emit signalIpkgMessage( tr( "Linking packages installed in: %1" ).arg( dest ) );
// Set package destination directory
QString destDir = destConfItem->value();
QString destInfoDir = destDir;
if ( destInfoDir.right( 1 ) != '/' )
destInfoDir.append( '/' );
destInfoDir.append( IPKG_INFO_PATH );
// Get list of installed packages in destination
QDir packageDir( destInfoDir );
QStringList packageFiles;
@@ -680,25 +684,25 @@ void OIpkg::linkPackageDir( const QString &dest )
QString linkFile;
while ( !t.eof() )
{
// Get the name of the file to link and build the sym link filename
linkFile = t.readLine();
QString linkDest( linkFile.right( linkFile.length() - destDir.length() ) );
linkDest.prepend( rootPath() );
// If file installed file is actually symbolic link, use actual file for linking
QFileInfo fileInfo( linkFile );
if ( fileInfo.isSymLink() && !fileInfo.readLink().isEmpty() )
linkFile = fileInfo.readLink();
-
+
// See if directory exists in 'root', if not, create
fileInfo.setFile( linkDest );
QString linkDestDirName = fileInfo.dirPath( true );
QDir linkDestDir( linkDestDirName );
if ( !linkDestDir.exists() )
{
linkDestDir.mkdir( linkDestDirName );
}
else
{
// Remove any previous link to make sure we will be pointing to the current version
if ( QFile::exists( linkDest ) )
@@ -724,25 +728,25 @@ void OIpkg::unlinkPackage( const QString &package, OConfItemList *destList )
{
// Find destination package is installed in
if ( destList )
{
OConfItemListIterator it( *destList );
for ( ; it.current(); ++it )
{
OConfItem *dest = it.current();
QString destInfoFileName = QString( "%1/%2/%3.list" ).arg( dest->value() )
.arg( IPKG_INFO_PATH )
.arg( package );
//emit signalIpkgMessage( QString( "Looking for '%1'" ).arg ( destInfoFileName ) );
-
+
// If found and destination is not 'root', remove symbolic links
if ( QFile::exists( destInfoFileName ) && dest->name() != "root" )
{
QFile destInfoFile( destInfoFileName );
if ( destInfoFile.open( IO_ReadOnly ) )
{
QTextStream t( &destInfoFile );
QString linkFile;
while ( !t.eof() )
{
// Get the name of the file to link and build the sym link filename
linkFile = t.readLine();
diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp
index ac16954..c9fdec1 100644
--- a/noncore/settings/packagemanager/opackagemanager.cpp
+++ b/noncore/settings/packagemanager/opackagemanager.cpp
@@ -74,28 +74,27 @@ void OPackageManager::loadAvailablePackages()
++serverCount;
emit statusBar( serverCount );
qApp->processEvents();
OPackageList *packageList = m_ipkg.availablePackages( server->name() );
if ( packageList )
{
for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt )
{
OPackage *package = packageIt.current();
// Load package info
- if ( !m_packages.find( package->name() ) ) {
- printf( "ADD AVAILABLE '%s'\n", package->name().latin1());
+ if ( !m_packages.find( package->name() ) )
m_packages.insert( package->name(), package );
- } else
+ else
{
// If new package is newer version, replace existing package
OPackage *currPackage = m_packages[package->name()];
if ( compareVersions( package->version(), currPackage->version() ) == 1 )
m_packages.replace( package->name(), package );
}
// Add category to list if it doesn't already exist
if ( m_categories.grep( package->category() ).isEmpty() )
{
m_categories << package->category();
categoryAdded = true;
@@ -130,45 +129,43 @@ void OPackageManager::loadInstalledPackages()
// Process destination only if it is active
if ( destination->active() )
{
// Update status
QString status = tr( "Reading installed packages:\n\t" );
status.append( destination->name() );
emit statusText( status );
++destCount;
emit statusBar( destCount );
qApp->processEvents();
- printf( "DESGTINATION %s\n", destination->name().latin1());
OPackageList *packageList = m_ipkg.installedPackages( destination->name(),
destination->value() );
if ( packageList )
{
for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt )
{
OPackage *package = packageIt.current();
OPackage *currPackage = m_packages[package->name()];
if ( currPackage )
{
// Package is in a current feed, update installed version, destination
currPackage->setVersionInstalled( package->versionInstalled() );
currPackage->setDestination( package->destination() );
delete package;
}
else
{
// Package isn't in a current feed, add to list
- printf( "ADD INSTALLED '%s'\n", package->name().latin1());
m_packages.insert( package->name(), package );
// Add category to list if it doesn't already exist
if ( m_categories.grep( package->category() ).isEmpty() )
{
m_categories << package->category();
categoryAdded = true;
}
}
}
}
}