74 #ifndef PKGLIB_PKGCACHE_H
75 #define PKGLIB_PKGCACHE_H
79 #include <apt-pkg/mmap.h>
81 #ifndef APT_8_CLEANER_HEADERS
103 template<
typename Str,
typename Itr>
class Iterator;
123 enum DepType {Depends=1,PreDepends=2,Suggests=3,Recommends=4,
124 Conflicts=5,Replaces=6,Obsoletes=7,DpkgBreaks=8,Enhances=9};
131 Greater=0x4,Equals=0x5,NotEquals=0x6};
139 enum VerPriority {Important=1,Required=2,Standard=3,Optional=4,Extra=5};
140 enum PkgSelectedState {Unknown=0,Install=1,Hold=2,DeInstall=3,Purge=4};
141 enum PkgInstState {Ok=0,ReInstReq=1,HoldInst=2,HoldReInstReq=3};
142 enum PkgCurrentState {NotInstalled=0,UnPacked=1,HalfConfigured=2,
143 HalfInstalled=4,ConfigFiles=5,Installed=6,
144 TriggersAwaited=7,TriggersPending=8};
149 enum PkgFlags {Auto=(1<<0),Essential=(1<<3),Important=(1<<4)};
150 enum PkgFFlags {NotSource=(1<<0),NotAutomatic=(1<<1),ButAutomaticUpgrades=(1<<2)};
156 std::string CacheFile;
159 unsigned long sHash(
const std::string &S)
const;
160 unsigned long sHash(
const char *S)
const;
178 virtual bool ReMap(
bool const &Errorchecks =
true);
179 inline bool Sync() {
return Map.Sync();};
180 inline MMap &GetMap() {
return Map;};
181 inline void *DataEnd() {
return ((
unsigned char *)Map.Data()) + Map.Size();};
184 inline unsigned long Hash(
const std::string &S)
const {
return sHash(S);};
185 inline unsigned long Hash(
const char *S)
const {
return sHash(S);};
188 const char *Priority(
unsigned char Priority);
193 PkgIterator FindPkg(
const std::string &Name,
const std::string &Arch);
195 Header &Head() {
return *HeaderP;};
203 inline bool MultiArchCache()
const {
return MultiArchEnabled; };
204 inline char const *
const NativeArch()
const;
210 static const char *CompTypeDeb(
unsigned char Comp);
211 static const char *CompType(
unsigned char Comp);
212 static const char *DepType(
unsigned char Dep);
218 bool MultiArchEnabled;
219 PkgIterator SingleArchFindPkg(
const std::string &Name);
249 unsigned short GroupSz;
250 unsigned short PackageSz;
251 unsigned short PackageFileSz;
252 unsigned short VersionSz;
253 unsigned short DescriptionSz;
254 unsigned short DependencySz;
255 unsigned short ProvidesSz;
256 unsigned short VerFileSz;
257 unsigned short DescFileSz;
265 unsigned long PackageCount;
266 unsigned long VersionCount;
267 unsigned long DescriptionCount;
268 unsigned long DependsCount;
269 unsigned long PackageFileCount;
270 unsigned long VerFileCount;
271 unsigned long DescFileCount;
272 unsigned long ProvidesCount;
315 map_ptrloc PkgHashTable[2*1048];
316 map_ptrloc GrpHashTable[2*1048];
321 bool CheckSizes(
Header &Against)
const;
434 map_ptrloc Component;
438 map_ptrloc Architecture;
514 AllForeign = All | Foreign,
515 AllAllowed = All | Allowed };
664 inline char const *
const pkgCache::NativeArch()
const
665 {
return StrP + HeaderP->Architecture; };
667 #include <apt-pkg/cacheiterators.h>
670 {
return GrpIterator(*
this);};
672 {
return GrpIterator(*
this,GrpP);};
674 {
return PkgIterator(*
this);};
676 {
return PkgIterator(*
this,PkgP);};
678 {
return PkgFileIterator(*
this,PkgFileP + HeaderP->FileList);};
680 {
return PkgFileIterator(*
this,PkgFileP);};
map_ptrloc FileList
references all the PackageFile's that this version came from
Definition: pkgcache.h:528
map_ptrloc Archive
the release information
Definition: pkgcache.h:432
Definition: cacheiterators.h:136
Definition: cacheiterators.h:315
map_ptrloc NextFile
next step in the linked list
Definition: pkgcache.h:474
map_ptrloc Package
index of the package this depends applies to
Definition: pkgcache.h:600
information for a single version of a package
Definition: pkgcache.h:501
map_ptrloc ProvidesList
List of all "packages" this package provide.
Definition: pkgcache.h:393
map_ptrloc DependsList
base of the dependency list
Definition: pkgcache.h:534
map_ptrloc NextProvides
next provides (based of package)
Definition: pkgcache.h:640
map_ptrloc Offset
position in the file
Definition: pkgcache.h:490
unsigned int ID
unique sequel ID
Definition: pkgcache.h:582
Definition: cacheiterators.h:39
unsigned int ID
unique sequel ID
Definition: pkgcache.h:413
Definition: cacheiterators.h:95
Definition: pkgcache.h:121
VerMultiArch
Multi-Arch capabilities of a package version.
Definition: pkgcache.h:509
handles virtual packages
Definition: pkgcache.h:627
map_ptrloc Section
indicates the deduced section
Definition: pkgcache.h:383
information for a single dependency record
Definition: pkgcache.h:592
groups architecture depending packages together
Definition: pkgcache.h:332
map_ptrloc Offset
position in the package file
Definition: pkgcache.h:476
Definition: pkgcache.h:147
map_ptrloc Site
The site the index file was fetched from.
Definition: pkgcache.h:440
unsigned int ID
unique sequel ID
Definition: pkgcache.h:554
unsigned long long Size
archive size for this version
Definition: pkgcache.h:545
map_ptrloc ParentPkg
the text is a description of this package
Definition: pkgcache.h:579
map_ptrloc File
index of the file that this description was found in
Definition: pkgcache.h:486
unsigned short Hash
characteristic value representing this version
Definition: pkgcache.h:552
used for generating single instances of strings
Definition: pkgcache.h:654
map_ptrloc Name
Name of the package.
Definition: pkgcache.h:364
map_ptrloc IndexType
indicates what sort of index file this is
Definition: pkgcache.h:444
map_ptrloc NextItem
Next link in the chain.
Definition: pkgcache.h:659
map_ptrloc NextDepends
next dependency of this version
Definition: pkgcache.h:602
Definition: pkgcache.h:86
contains information for a single unique package
Definition: pkgcache.h:361
map_ptrloc Version
index of the version this provide line applies to
Definition: pkgcache.h:632
map_ptrloc FileName
physical disk file that this PackageFile represents
Definition: pkgcache.h:427
map_ptrloc Next
Link to the next Group.
Definition: pkgcache.h:343
map_ptrloc NextRevDepends
next reverse dependency of this package
Definition: pkgcache.h:604
unsigned long long InstalledSize
uncompressed size for this version
Definition: pkgcache.h:547
unsigned long Size
Size of the file.
Definition: pkgcache.h:450
associates a version with a PackageFile
Definition: pkgcache.h:469
map_ptrloc Group
index of the group this package belongs to
Definition: pkgcache.h:385
map_ptrloc ParentVer
version of the package which has the reverse depends
Definition: pkgcache.h:606
Definition: cacheiterators.h:264
Definition: cacheiterators.h:352
map_ptrloc LastPackage
Link to the last package which belongs to the group.
Definition: pkgcache.h:341
Definition: cacheiterators.h:404
map_ptrloc Version
string of the version the dependency is applied against
Definition: pkgcache.h:595
map_ptrloc ParentPkg
index of the package providing this
Definition: pkgcache.h:630
map_ptrloc RevDepends
List of all dependencies on this package.
Definition: pkgcache.h:391
map_ptrloc NextVer
next (lower or equal) version in the linked list
Definition: pkgcache.h:530
DepCompareOp
available compare operators
Definition: pkgcache.h:130
Definition: pkgcache.h:683
map_ptrloc NextPkgProv
next provides (based of version)
Definition: pkgcache.h:642
map_ptrloc language_code
Language code of this description (translation)
Definition: pkgcache.h:567
unsigned char MultiArch
stores the MultiArch capabilities of this version
Definition: pkgcache.h:520
Definition: cacheiterators.h:185
associates a description with a Translation file
Definition: pkgcache.h:483
unsigned char Priority
parsed priority value
Definition: pkgcache.h:556
unsigned long Flags
some useful indicators of the package's state
Definition: pkgcache.h:415
map_ptrloc String
string this refers to
Definition: pkgcache.h:657
VerPriority
priority of a package version
Definition: pkgcache.h:139
map_ptrloc ProvideVersion
version in the provides line (if any)
Definition: pkgcache.h:638
map_ptrloc NextDesc
next translation for this description
Definition: pkgcache.h:577
map_ptrloc File
index of the package file that this version was found in
Definition: pkgcache.h:472
map_ptrloc NextFile
next step in the linked list
Definition: pkgcache.h:488
Definition: cacheiterators.h:237
map_ptrloc ID
unique sequel ID
Definition: pkgcache.h:609
unsigned char InstState
installation state of the package
Definition: pkgcache.h:403
unsigned char CompareOp
comparison operator specified on the depends line
Definition: pkgcache.h:615
unsigned char CurrentState
indicates if the package is installed
Definition: pkgcache.h:405
map_ptrloc Name
Name of the group.
Definition: pkgcache.h:335
Definition: pkgcache.h:134
map_ptrloc Section
section this version is filled in
Definition: pkgcache.h:506
unsigned char SelectedState
state that the user wishes the package to be in
Definition: pkgcache.h:397
map_ptrloc NextPackage
Link to the next package in the same bucket.
Definition: pkgcache.h:389
map_ptrloc md5sum
MD5sum of the original description.
Definition: pkgcache.h:572
map_ptrloc ParentPkg
links to the owning package
Definition: pkgcache.h:538
map_ptrloc NextFile
Link to the next PackageFile in the Cache.
Definition: pkgcache.h:459
unsigned char Type
Dependency type - Depends, Recommends, Conflicts, etc.
Definition: pkgcache.h:611
map_ptrloc DescriptionList
next description in the linked list
Definition: pkgcache.h:532
map_ptrloc VersionList
Base of a singly linked list of versions.
Definition: pkgcache.h:376
map_ptrloc ProvidesList
list of pkgCache::Provides
Definition: pkgcache.h:540
time_t mtime
Modification time for the file.
Definition: pkgcache.h:452
map_ptrloc CurrentVer
index to the installed version
Definition: pkgcache.h:378
Definition: cacheiterators.h:385
map_ptrloc Arch
Architecture of the package.
Definition: pkgcache.h:366
stores information about the files used to generate the cache
Definition: pkgcache.h:424
datamember of a linked list of available description for a version
Definition: pkgcache.h:561
unsigned int ID
unique sequel ID
Definition: pkgcache.h:461
map_ptrloc FirstPackage
Link to the first package which belongs to the group.
Definition: pkgcache.h:339
map_ptrloc VerStr
complete version string
Definition: pkgcache.h:504
unsigned int ID
unique sequel ID
Definition: pkgcache.h:345