From 14b4780d0da30493b949bf65587f4e8a71db561d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 28 Jul 2011 10:26:39 +0200 Subject: * [ABI break] apt-pkg/acquire-item.{cc,h}: - cleanup around OptionalIndexTarget and SubIndexTarget --- apt-pkg/acquire-item.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'apt-pkg/acquire-item.h') diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index e6916a834..f39a90c0b 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -646,8 +646,9 @@ class pkgAcqIndexTrans : public pkgAcqIndex }; /*}}}*/ /** \brief Information about an index file. */ /*{{{*/ -struct IndexTarget +class IndexTarget { + public: /** \brief A URI from which the index file can be downloaded. */ string URI; @@ -662,14 +663,28 @@ struct IndexTarget */ string MetaKey; - //FIXME: We should use virtual methods here instead… - bool IsOptional() const; - bool IsSubIndex() const; + virtual bool IsOptional() const { + return false; + } + virtual bool IsSubIndex() const { + return false; + } }; /*}}}*/ /** \brief Information about an optional index file. */ /*{{{*/ -struct OptionalIndexTarget : public IndexTarget +class OptionalIndexTarget : public IndexTarget +{ + virtual bool IsOptional() const { + return true; + } +}; + /*}}}*/ +/** \brief Information about an subindex index file. */ /*{{{*/ +class SubIndexTarget : public IndexTarget { + virtual bool IsSubIndex() const { + return true; + } }; /*}}}*/ -- cgit v1.2.3 From c5f661b715fbd86fcbca694c44bb8422f01db267 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 5 Aug 2011 10:48:18 +0200 Subject: * apt-pkg/acquire-item.{cc,h}: - do not check for a "Package" tag in optional index targets like the translations index --- apt-pkg/acquire-item.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apt-pkg/acquire-item.h') diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index f39a90c0b..13be17a01 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -559,6 +559,16 @@ class pkgAcqIndex : public pkgAcquire::Item */ bool Erase; + /** \brief Verify for correctness by checking if a "Package" + * tag is found in the index. This can be set to + * false for optional index targets + * + */ + // FIXME: instead of a bool it should use a verify string that will + // then be used in the pkgAcqIndex::Done method to ensure that + // the downloaded file contains the expected tag + bool Verify; + /** \brief The download request that is currently being * processed. */ -- cgit v1.2.3