]>
git.saurik.com Git - apt.git/blob - apt-private/private-cachefile.h
1 #ifndef APT_PRIVATE_CACHEFILE_H
2 #define APT_PRIVATE_CACHEFILE_H
4 #include <apt-pkg/cachefile.h>
5 #include <apt-pkg/progress.h>
6 #include <apt-pkg/configuration.h>
7 #include <apt-pkg/pkgcache.h>
8 #include <apt-pkg/macros.h>
9 #include <apt-pkg/sourcelist.h>
12 // FIXME: we need to find a way to export this
13 class APT_PUBLIC SourceList
: public pkgSourceList
17 // Add custom metaIndex (e.g. local files)
18 void AddMetaIndex(metaIndex
*mi
) {
19 SrcList
.push_back(mi
);
24 // class CacheFile - Cover class for some dependency cache functions /*{{{*/
25 // ---------------------------------------------------------------------
27 class APT_PUBLIC CacheFile
: public pkgCacheFile
29 static pkgCache
*SortCache
;
30 APT_HIDDEN
static int NameComp(const void *a
,const void *b
) APT_PURE
;
33 pkgCache::Package
**List
;
36 bool CheckDeps(bool AllowBroken
= false);
37 bool BuildCaches(bool WithLock
= true)
39 OpTextProgress
Prog(*_config
);
40 if (pkgCacheFile::BuildCaches(&Prog
,WithLock
) == false)
44 // FIXME: this can go once the "libapt-pkg" pkgSourceList has a way
45 // to add custom metaIndexes (or custom local files or so)
46 bool BuildSourceList(OpProgress */
*Progress*/
= NULL
) {
49 SrcList
= new SourceList();
50 if (SrcList
->ReadMainList() == false)
51 return _error
->Error(_("The list of sources could not be read."));
54 bool Open(bool WithLock
= true)
56 OpTextProgress
Prog(*_config
);
57 if (pkgCacheFile::Open(&Prog
,WithLock
) == false)
65 if (_config
->FindB("APT::Get::Print-URIs") == true)
70 CacheFile() : List(0) {};