author | tille <tille> | 2002-05-01 15:49:08 (UTC) |
---|---|---|
committer | tille <tille> | 2002-05-01 15:49:08 (UTC) |
commit | da94bce203afca412336a7793ff8e58e18d59108 (patch) (side-by-side diff) | |
tree | 0bc25fd1145459656d8cc7a4897bad51f123daf9 /noncore/unsupported/oipkg/packagelist.cpp | |
parent | fcc0cee7ae337e8179b8ba4d4b6c46b519129daa (diff) | |
download | opie-da94bce203afca412336a7793ff8e58e18d59108.zip opie-da94bce203afca412336a7793ff8e58e18d59108.tar.gz opie-da94bce203afca412336a7793ff8e58e18d59108.tar.bz2 |
handles different versions of the same package
Diffstat (limited to 'noncore/unsupported/oipkg/packagelist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/packagelist.cpp | 17 |
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 @@ -35,2 +35,3 @@ void PackageList::insertPackage( Package* pack ) { + if (!pack) return; Package* p = packageList.find( pack->name() ); @@ -38,5 +39,13 @@ void PackageList::insertPackage( Package* pack ) { - 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{ @@ -44,4 +53,4 @@ void PackageList::insertPackage( Package* pack ) origPackageList.insert( pack->name(), pack ); - empty=false; }; + empty=false; updateSections( pack ); |