summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/packagelist.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/oipkg/packagelist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/packagelist.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp
index b892b30..be20c71 100644
--- a/noncore/unsupported/oipkg/packagelist.cpp
+++ b/noncore/unsupported/oipkg/packagelist.cpp
@@ -33,17 +33,26 @@ PackageList::~PackageList()
/** Inserts a package into the list */
void PackageList::insertPackage( Package* pack )
{
+ if (!pack) return;
Package* p = packageList.find( pack->name() );
if ( p )
{
- p->copyValues( pack );
- delete pack;
- pack = p;
+ if ( p->version() == pack->version() )
+ {
+ p->copyValues( pack );
+ delete pack;
+ pack = p;
+ } else {
+ p->setName( pack->name()+"["+p->version()+"]" );
+ pack->setName( pack->name()+"["+pack->version()+"]" );
+ packageList.insert( pack->name(), pack );
+ origPackageList.insert( pack->name(), pack );
+ }
}else{
packageList.insert( pack->name(), pack );
origPackageList.insert( pack->name(), pack );
- empty=false;
};
+ empty=false;
updateSections( pack );
}