[Apt-Rpm] please pull my changes

Alexey Tourbin at at altlinux.ru
Sun Nov 16 16:12:30 PST 2008


On Sun, Nov 16, 2008 at 12:09:49PM +0200, Panu Matilainen wrote:
> >8ca497e... Change type of pkgCache::Package.ID to 'unsigned int'.
> Hmm, I think this wants a bump of the cache MajorVersion to go with it to 
> force a cache rebuild due to the changed structure.

This change is backward compatible (for most achitecutres).

apt-pkg/pkgcache.h
   208  struct pkgCache::Package
   209  {
   210     // Pointers
   211     map_ptrloc Name;              // Stringtable
   212     map_ptrloc VersionList;       // Version
   213     map_ptrloc CurrentVer;        // Version
   214     map_ptrloc Section;           // StringTable (StringItem)
   215        
   216     // Linked list 
   217     map_ptrloc NextPackage;       // Package
   218     map_ptrloc RevDepends;        // Dependency
   219     map_ptrloc ProvidesList;      // Provides
   220     
   221     // Install/Remove/Purge etc
   222     unsigned char SelectedState;     // What
   223     unsigned char InstState;         // Flags
   224     unsigned char CurrentState;      // State
1-byte padding (like one more "unsigned char")
   225     
   226     unsigned short ID;
2-byte padding (like one more "short" before Flags)
   227     unsigned long Flags;
   228  };

So, changing "short" to "int" simply fills the second padding.
sizeof(struct pkgCache::Package) does not change, and the code
that expects "unsigned short" will get the right ID (provided
the ID does not exceed its old limit).

However, we may also want to remove other "short" limits,
and change MajorVersion then.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.laiskiainen.org/pipermail/apt-rpm-laiskiainen.org/attachments/20081117/b69bf86c/attachment-0003.pgp>


More information about the Apt-Rpm mailing list