]> git.saurik.com Git - apt.git/blame - apt-private/private-cachefile.h
fix test/integration/test-apt-helper
[apt.git] / apt-private / private-cachefile.h
CommitLineData
b9179170
MV
1#ifndef APT_PRIVATE_CACHEFILE_H
2#define APT_PRIVATE_CACHEFILE_H
3
4#include <apt-pkg/cachefile.h>
5#include <apt-pkg/progress.h>
453b82a3
DK
6#include <apt-pkg/configuration.h>
7#include <apt-pkg/pkgcache.h>
b9179170
MV
8
9
10// class CacheFile - Cover class for some dependency cache functions /*{{{*/
11// ---------------------------------------------------------------------
12/* */
13class CacheFile : public pkgCacheFile
14{
15 static pkgCache *SortCache;
a02db58f 16 static int NameComp(const void *a,const void *b) APT_PURE;
b9179170
MV
17
18 public:
19 pkgCache::Package **List;
20
21 void Sort();
22 bool CheckDeps(bool AllowBroken = false);
23 bool BuildCaches(bool WithLock = true)
24 {
25 OpTextProgress Prog(*_config);
26 if (pkgCacheFile::BuildCaches(&Prog,WithLock) == false)
27 return false;
28 return true;
29 }
30 bool Open(bool WithLock = true)
31 {
32 OpTextProgress Prog(*_config);
33 if (pkgCacheFile::Open(&Prog,WithLock) == false)
34 return false;
35 Sort();
36
37 return true;
38 };
39 bool OpenForInstall()
40 {
41 if (_config->FindB("APT::Get::Print-URIs") == true)
42 return Open(false);
43 else
44 return Open(true);
45 }
46 CacheFile() : List(0) {};
47 ~CacheFile() {
48 delete[] List;
49 }
50};
51 /*}}}*/
52
53#endif