libapt-pkg2_to_3.txt 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. libapt-pkg v2 to v3 incorperates several source-incompatible changes that
  2. people need to be aware of.. Many of this changes are done so that most old
  3. source will continue to function, but perhaps at reduced functionality.
  4. * pkgDepCache is no longer self initilizing, you have to call the Init
  5. method separately after constructing it. Users of pkgCacheFile do not
  6. need to worry about this
  7. * GetCandidateVer/etc is gone from the pkgCache. It exists only in the
  8. DepCache and is just an inline around the new Policy class
  9. * TargetVer/TargetDist have been eliminated. Nothing should have been using
  10. these.
  11. * There is a policy class. The v0 policy engine which has been used since
  12. APT 0.0.0 is instantiated by the DepCache by default. However pkgCacheFile
  13. constructs and initializes the new v4 engine. People accessing GetCandidate
  14. version outside of a CacheFile/DepCache will need to instantiate and
  15. initialize a policy engine on their own.
  16. * All byte counters are now doubles to advoid 4G wraparound. The compiler
  17. should generate warnings on any incorrect use of these.
  18. * The PriorityType/CompType/DepType functions have been moved out of the
  19. iterators and into generate static functions of pkgCache - inline stubs
  20. are left in the iterators.
  21. * The deb dependency element parser has been made into a static function
  22. of the list parser and enhanced to optionally understand architecture
  23. restrictions.
  24. * TagSections no longer include the trailing \n. This means that the
  25. Offset/Length of a package record in the version structure also does not
  26. include the trailing \n.
  27. * GenCaches::SelectFile accepts a site parameter now too.
  28. * Global version compare functions are gone. If you
  29. #define APT_COMPATIBILITY 1
  30. They will come back as they were before. Code should be updated to
  31. reference the compare functions to the VersioningSystem (VS) referenced
  32. by the Cache or _system structures.
  33. * Initialization is now two stage (define APT_COMPATIBILITY..) The first
  34. stage, pkgInitConfig is called before commandline parsing, and
  35. pkgInitSystem is called after. This gives the user the oppertunity to
  36. override default settings from the config files before startup has been
  37. finalized.
  38. * pkgSourceList has been gutted. All the junk that was in there before is
  39. cleaned up and put in the pkgIndexFile class. There is very little API
  40. corrispondence here..
  41. * pkgMakeStatusCacheMem is gone, pkgMakeStatusCache does the same thing if
  42. you set the AllowMem flag. Also, you can get a copy of the map used to
  43. store the cache to advoid having to remap it in the calling code. A bunch
  44. of other cache related functions are gone, but nobody should have been using
  45. them in the first place!
  46. * Downloading the 'Package' and 'Source' index files is different, use
  47. the GetIndexes call in SourceList.
  48. * SourceRecords::Parser::Source is gone, replaced with Index which does
  49. much the same thing.
  50. * DynamicMap has changed slightly, nobody should care
  51. * pkgMakeOnlyStatusCache exists, which creates a really small cache that
  52. only contains the status file, and in memory.
  53. * The pkgRecords stuff is changed to abstract through the index file list
  54. (should be transparent largely)
  55. * Locking is handled differently, there is no dpkg lock class, the _system
  56. class provides Lock/UnLock methods
  57. * pkgDepCache is not a subclass of pkgCache, it aggregates it now. Some
  58. compatibility functions are provided that make this transition fairly
  59. easy.
  60. * The following functions have had minor argument changes:
  61. - pkgSimulate(pkgDepCache &Cache);
  62. + pkgSimulate(pkgDepCache *Cache);
  63. - pkgProblemResolver(pkgDepCache &Cache);
  64. + pkgProblemResolver(pkgDepCache *Cache);
  65. - pkgDepCache(MMap &Map,Policy *Plcy = 0);
  66. + pkgDepCache(pkgCache *Cache,Policy *Plcy = 0);
  67. - pkgOrderList(pkgDepCache &Cache);
  68. + pkgOrderList(pkgDepCache *Cache);
  69. - pkgPackageManager(pkgDepCache &Cache);
  70. + pkgPackageManager(pkgDepCache *Cache);
  71. - pkgCache(MMap &Map,bool DoMap = true);
  72. + pkgCache(MMap *Map,bool DoMap = true);
  73. - pkgCacheGenerator(DynamicMMap &Map,OpProgress &Progress);
  74. + pkgCacheGenerator(DynamicMMap *Map,OpProgress *Progress);
  75. - pkgTagFile(FileFd &F,unsigned long Size = 32*1024);
  76. + pkgTagFile(FileFd *F,unsigned long Size = 32*1024);
  77. * Configuration class is const-correct
  78. * The legacy ability to create a PkgFileIterator that started at Begin
  79. is gone, everyone should be using FileBegin().
  80. * A new dependency relation called obsoletes that is similar to conflicts.