summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:53:48 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:53:48 +0000
commit204fbdcce67a08d33a5e7eb3ca9e7a9ae80918c5 (patch)
treefef1ee61740101afa96ab907003385c9f6db0f08 /apt-pkg/pkgcachegen.cc
parent8b75eb1cadd4db3d6ecb27fa4f441843d3856f77 (diff)
Multiple different versions support
Author: jgg Date: 1999-05-23 22:55:54 GMT Multiple different versions support
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index fd4f8965b..11d539dff 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: pkgcachegen.cc,v 1.37 1999/04/19 02:35:38 jgg Exp $
+// $Id: pkgcachegen.cc,v 1.38 1999/05/23 22:55:54 jgg Exp $
/* ######################################################################
Package Cache Generator - Generator for the cache structure.
@@ -111,7 +111,8 @@ bool pkgCacheGenerator::MergeList(ListParser &List)
/* We already have a version for this item, record that we
saw it */
- if (Res == 0)
+ unsigned long Hash = List.VersionHash();
+ if (Res == 0 && Ver->Hash == Hash)
{
if (List.UsePackage(Pkg,Ver) == false)
return _error->Error("Error occured while processing %s (UsePackage2)",PackageName.c_str());
@@ -122,9 +123,22 @@ bool pkgCacheGenerator::MergeList(ListParser &List)
continue;
}
+ // Skip to the end of the same version set.
+ if (Res == 0)
+ {
+ for (; Ver.end() == false; Last = &Ver->NextVer, Ver++)
+ {
+ Res = pkgVersionCompare(Version.begin(),Version.end(),Ver.VerStr(),
+ Ver.VerStr() + strlen(Ver.VerStr()));
+ if (Res != 0)
+ break;
+ }
+ }
+
// Add a new version
*Last = NewVersion(Ver,Version,*Last);
Ver->ParentPkg = Pkg.Index();
+ Ver->Hash = Hash;
if (List.NewVersion(Ver) == false)
return _error->Error("Error occured while processing %s (NewVersion1)",PackageName.c_str());