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