struct Header;
struct Group;
struct Package;
+ struct ReleaseFile;
struct PackageFile;
struct Version;
struct Description;
class DescIterator;
class DepIterator;
class PrvIterator;
+ class RlsFileIterator;
class PkgFileIterator;
class VerFileIterator;
class DescFileIterator;
struct Flag
{
enum PkgFlags {Auto=(1<<0),Essential=(1<<3),Important=(1<<4)};
- enum PkgFFlags {NotSource=(1<<0),NotAutomatic=(1<<1),ButAutomaticUpgrades=(1<<2)};
+ enum PkgFFlags {
+ NotSource=(1<<0), /*!< packages can't be fetched from here, e.g. dpkg/status file */
+ LocalSource=(1<<1), /*!< local sources can't and will not be verified by hashes */
+ NoPackages=(1<<2), /*!< the file includes no package records itself, but additions like Translations */
+ };
+ enum ReleaseFileFlags {
+ NotAutomatic=(1<<0), /*!< archive has a default pin of 1 */
+ ButAutomaticUpgrades=(1<<1), /*!< (together with the previous) archive has a default pin of 100 */
+ };
};
protected:
Package *PkgP;
VerFile *VerFileP;
DescFile *DescFileP;
+ ReleaseFile *RlsFileP;
PackageFile *PkgFileP;
Version *VerP;
Description *DescP;
inline PkgIterator PkgEnd();
inline PkgFileIterator FileBegin();
inline PkgFileIterator FileEnd();
+ inline RlsFileIterator RlsFileBegin();
+ inline RlsFileIterator RlsFileEnd();
inline bool MultiArchCache() const { return MultiArchEnabled; }
inline char const * NativeArch();
static const char *CompTypeDeb(unsigned char Comp) APT_CONST;
static const char *CompType(unsigned char Comp) APT_CONST;
static const char *DepType(unsigned char Dep);
-
+
pkgCache(MMap *Map,bool DoMap = true);
- virtual ~pkgCache() {}
+ virtual ~pkgCache();
private:
+ void * const d;
bool MultiArchEnabled;
APT_HIDDEN PkgIterator SingleArchFindPkg(const std::string &Name);
};
unsigned short HeaderSz;
unsigned short GroupSz;
unsigned short PackageSz;
+ unsigned short ReleaseFileSz;
unsigned short PackageFileSz;
unsigned short VersionSz;
unsigned short DescriptionSz;
map_id_t VersionCount;
map_id_t DescriptionCount;
map_id_t DependsCount;
+ map_fileid_t ReleaseFileCount;
map_fileid_t PackageFileCount;
map_fileid_t VerFileCount;
map_fileid_t DescFileCount;
The PackageFile structures are singly linked lists that represent
all package files that have been merged into the cache. */
map_pointer_t FileList;
+ /** \brief index of the first ReleaseFile structure */
+ map_pointer_t RlsFileList;
+
#if APT_PKG_ABI < 413
APT_DEPRECATED map_pointer_t StringList;
#endif
unsigned long Flags;
};
/*}}}*/
-// Package File structure /*{{{*/
-/** \brief stores information about the files used to generate the cache
+// Release File structure /*{{{*/
+/** \brief stores information about the release files used to generate the cache
- Package files are referenced by Version structures to be able to know
- after the generation still from which Packages file includes this Version
- as we need this information later on e.g. for pinning. */
-struct pkgCache::PackageFile
+ PackageFiles reference ReleaseFiles as we need to keep record of which
+ version belongs to which release e.g. for pinning. */
+struct pkgCache::ReleaseFile
{
- /** \brief physical disk file that this PackageFile represents */
+ /** \brief physical disk file that this ReleaseFile represents */
map_stringitem_t FileName;
/** \brief the release information
release information means. */
map_stringitem_t Archive;
map_stringitem_t Codename;
- map_stringitem_t Component;
map_stringitem_t Version;
map_stringitem_t Origin;
map_stringitem_t Label;
- map_stringitem_t Architecture;
/** \brief The site the index file was fetched from */
map_stringitem_t Site;
+
+ /** \brief Size of the file
+
+ Used together with the modification time as a
+ simple check to ensure that the Packages
+ file has not been altered since Cache generation. */
+ map_filesize_t Size;
+ /** \brief Modification time for the file */
+ time_t mtime;
+
+ /** @TODO document PackageFile::Flags */
+ unsigned long Flags;
+
+ // Linked list
+ /** \brief Link to the next ReleaseFile in the Cache */
+ map_pointer_t NextFile;
+ /** \brief unique sequel ID */
+ should_be_map_fileid_t ID;
+};
+ /*}}}*/
+// Package File structure /*{{{*/
+/** \brief stores information about the files used to generate the cache
+
+ Package files are referenced by Version structures to be able to know
+ after the generation still from which Packages file includes this Version
+ as we need this information later on e.g. for pinning. */
+struct pkgCache::PackageFile
+{
+ /** \brief physical disk file that this PackageFile represents */
+ map_stringitem_t FileName;
+ /** \brief the release information */
+ map_pointer_t Release;
+
+ map_stringitem_t Component;
+ map_stringitem_t Architecture;
+
/** \brief indicates what sort of index file this is
@TODO enumerate at least the possible indexes */
{return PkgFileIterator(*this,PkgFileP + HeaderP->FileList);}
inline pkgCache::PkgFileIterator pkgCache::FileEnd()
{return PkgFileIterator(*this,PkgFileP);}
+inline pkgCache::RlsFileIterator pkgCache::RlsFileBegin()
+ {return RlsFileIterator(*this,RlsFileP + HeaderP->RlsFileList);}
+inline pkgCache::RlsFileIterator pkgCache::RlsFileEnd()
+ {return RlsFileIterator(*this,RlsFileP);}
+
// Oh I wish for Real Name Space Support
class pkgCache::Namespace /*{{{*/
typedef pkgCache::DescIterator DescIterator;
typedef pkgCache::DepIterator DepIterator;
typedef pkgCache::PrvIterator PrvIterator;
+ typedef pkgCache::RlsFileIterator RlsFileIterator;
typedef pkgCache::PkgFileIterator PkgFileIterator;
typedef pkgCache::VerFileIterator VerFileIterator;
typedef pkgCache::Version Version;