summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/global.h2
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp10
-rw-r--r--noncore/settings/aqpkg/server.cpp8
3 files changed, 18 insertions, 2 deletions
diff --git a/noncore/settings/aqpkg/global.h b/noncore/settings/aqpkg/global.h
index 96ab46c..a4363b4 100644
--- a/noncore/settings/aqpkg/global.h
+++ b/noncore/settings/aqpkg/global.h
@@ -5,33 +5,33 @@
copyright : (C) 2002 by Andy Qua
email : andy.qua@blueyonder.co.uk
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef __GLOBAL_H
#define __GLOBAL_H
-#define VERSION_TEXT "AQPkg Version 0.7"
+#define VERSION_TEXT "AQPkg Version 0.8"
// Uncomment the below line to run on a Linux box rather than a Zaurus
// box this allows you to change where root is, and where to load config files from
// #define X86
// Sets up location of ipkg.conf and root directory
#ifdef QWS
#ifndef X86
// Running QT/Embedded on an arm processor
#define IPKG_CONF "/etc/ipkg.conf"
#define ROOT "/"
#define IPKG_DIR "/usr/lib/ipkg/"
#else
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp
index 3d06aef..dee834e 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.cpp
+++ b/noncore/settings/aqpkg/networkpkgmgr.cpp
@@ -504,59 +504,69 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item )
QString name = item->text();
int pos = name.find( "*" );
name.truncate( pos );
// if (there is a (installed), remove it
pos = name.find( "(installed)" );
if ( pos > 0 )
name.truncate( pos - 1 );
// Get package
Server *s = dataMgr->getServer( serversList->currentText() );
Package *p = s->getPackage( name );
// If the package has a filename then it is a local file
if ( p->isPackageStoredLocally() )
name = p->getFilename();
+
QString option;
QString dest = "root";
if ( !p->isInstalled() )
{
InstallData item;
item.option = "I";
item.packageName = name;
return item;
}
else
{
InstallData item;
item.option = "D";
+ if ( !p->isPackageStoredLocally() )
item.packageName = p->getInstalledPackageName();
+ else
+ item.packageName = name;
+
if ( p->getInstalledTo() )
{
item.destination = p->getInstalledTo();
cout << "dest - " << p->getInstalledTo()->getDestinationName() << endl;
cout << "dest - " << p->getInstalledTo()->getDestinationPath() << endl;
}
else
{
item.destination = p->getLocalPackage()->getInstalledTo();
}
// Now see if version is newer or not
int val = compareVersions( p->getInstalledVersion(), p->getVersion() );
+
+ // If the version requested is older and user selected a local ipk file, then reinstall the file
+ if ( p->isPackageStoredLocally() && val == -1 )
+ val = 0;
+
if ( val == -2 )
{
// Error - should handle
}
else if ( val == -1 )
{
// Version available is older - remove only
item.option = "D";
}
else
{
QString caption;
QString text;
QString secondButton;
QString secondOption;
if ( val == 0 )
diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp
index 8bca892..539ebf0 100644
--- a/noncore/settings/aqpkg/server.cpp
+++ b/noncore/settings/aqpkg/server.cpp
@@ -97,33 +97,34 @@ void Server :: readLocalIpks( Server *local )
#ifdef QWS
// First, get any local IPKGs in the documents area
// Only applicable to Qtopie/Opie
DocLnkSet files;
Global::findDocuments( &files, "application/ipkg" );
// Now add the items to the list
QListIterator<DocLnk> it( files.children() );
for ( ; it.current() ; ++it )
{
// OK, we have a local IPK file, I think the standard naming conventions
// for these are packagename_version_arm.ipk
QString file = (*it)->file();
- QString packageName = Utils::getPackageNameFromIpkFilename( file );
+ // Changed to display the filename (excluding the path)
+ QString packageName = Utils::getFilenameFromIpkFilename( file );
QString ver = Utils::getPackageVersionFromIpkFilename( file );
packageList.push_back( Package( packageName ) );
packageList.back().setVersion( ver );
packageList.back().setFilename( file );
packageList.back().setPackageStoredLocally( true );
}
#else
QString names[] = { "advancedfm_0.9.1-20020811_arm.ipk", "libopie_0.9.1-20020811_arm.ipk", "libopieobex_0.9.1-20020811.1_arm.ipk", "opie-addressbook_0.9.1-20020811_arm.ipk" };
for ( int i = 0 ; i < 4 ; ++i )
{
// OK, we have a local IPK file, I think the standard naming conventions
// for these are packagename_version_arm.ipk
QString file = names[i];
int p = file.find( "_" );
QString tmp = file.mid( 0, p );
@@ -214,32 +215,37 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR
{
newPackage = true;
}
} while ( !in.eof() );
in.close();
// build local packages
buildLocalPackages( local );
}
void Server :: buildLocalPackages( Server *local )
{
for ( unsigned int i = 0 ; i < packageList.size() ; ++i )
{
QString name = packageList[i].getPackageName();
+
+ // If the package name is an ipk name, then convert the filename to a package name
+ if ( name.find( ".ipk" ) != -1 )
+ name = Utils::getPackageNameFromIpkFilename( packageList[i].getFilename() );
+
if ( local )
packageList[i].setLocalPackage( local->getPackage( name ) );
else
packageList[i].setLocalPackage( 0 );
}
}
Package *Server :: getPackage( QString &name )
{
return getPackage( (const char *)name );
}
Package *Server :: getPackage( const char *name )
{
Package *ret = 0;