Increase the range of the ID type for deps
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:58:30 +0000 (16:58 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:58:30 +0000 (16:58 +0000)
Author: jgg
Date: 2001-07-01 22:28:24 GMT
Increase the range of the ID type for deps

apt-pkg/pkgcache.cc
apt-pkg/pkgcache.h
apt-pkg/pkgcachegen.cc

index d0a86ec..484cde5 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: pkgcache.cc,v 1.35 2001/05/14 05:54:10 jgg Exp $
+// $Id: pkgcache.cc,v 1.36 2001/07/01 22:28:24 jgg Exp $
 /* ######################################################################
    
    Package Cache - Accessor code for the cache
@@ -52,8 +52,8 @@ pkgCache::Header::Header()
    
    /* Whenever the structures change the major version should be bumped,
       whenever the generator changes the minor version should be bumped. */
-   MajorVersion = 3;
-   MinorVersion = 5;
+   MajorVersion = 4;
+   MinorVersion = 0;
    Dirty = false;
    
    HeaderSz = sizeof(pkgCache::Header);
index 0d62c64..b07951d 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: pkgcache.h,v 1.24 2001/05/07 04:24:08 jgg Exp $
+// $Id: pkgcache.h,v 1.25 2001/07/01 22:28:24 jgg Exp $
 /* ######################################################################
    
    Cache - Structure definitions for the cache file
@@ -261,9 +261,9 @@ struct pkgCache::Dependency
    map_ptrloc ParentVer;       // Version
    
    // Specific types of depends
+   map_ptrloc ID;   
    unsigned char Type;
    unsigned char CompareOp;
-   unsigned short ID;   
 };
 
 struct pkgCache::Provides
index 026f795..534217e 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: pkgcachegen.cc,v 1.49 2001/05/27 05:55:27 jgg Exp $
+// $Id: pkgcachegen.cc,v 1.50 2001/07/01 22:28:24 jgg Exp $
 /* ######################################################################
    
    Package Cache Generator - Generator for the cache structure.
@@ -192,6 +192,15 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
       }      
    }
 
+   if (Cache.HeaderP->PackageCount >= (1ULL<<sizeof(Cache.PkgP->ID)*8)-1)
+      return _error->Error(_("Wow, you exceeded the number of package "
+                            "names this APT is capable of."));
+   if (Cache.HeaderP->VersionCount >= (1ULL<<(sizeof(Cache.VerP->ID)*8))-1)
+      return _error->Error(_("Wow, you exceeded the number of versions "
+                            "this APT is capable of."));
+   if (Cache.HeaderP->DependsCount >= (1ULL<<(sizeof(Cache.DepP->ID)*8))-1ULL)
+      return _error->Error(_("Wow, you exceeded the number of dependencies "
+                            "this APT is capable of."));
    return true;
 }
                                                                        /*}}}*/