diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-28 10:26:39 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-28 10:26:39 +0200 |
commit | 14b4780d0da30493b949bf65587f4e8a71db561d (patch) | |
tree | 1ac6619cd88933135bf9889922fcf429712738d3 | |
parent | a2cba9cca24762c090ee6988f14ae40f92a6441f (diff) |
* [ABI break] apt-pkg/acquire-item.{cc,h}:
- cleanup around OptionalIndexTarget and SubIndexTarget
-rw-r--r-- | apt-pkg/acquire-item.cc | 10 | ||||
-rw-r--r-- | apt-pkg/acquire-item.h | 25 | ||||
-rw-r--r-- | debian/changelog | 2 |
3 files changed, 22 insertions, 15 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index aa77824f8..df83d1481 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -2071,13 +2071,3 @@ string pkgAcqFile::Custom600Headers() return ""; } /*}}}*/ -bool IndexTarget::IsOptional() const { - if (strncmp(ShortDesc.c_str(), "Translation", 11) != 0) - return false; - return true; -} -bool IndexTarget::IsSubIndex() const { - if (ShortDesc != "TranslationIndex") - return false; - return true; -} 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; + } }; /*}}}*/ diff --git a/debian/changelog b/debian/changelog index bc7e4dd59..c8af59ab2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ apt (0.8.16~exp4) UNRELEASED; urgency=low * merged latest fixes from debian-sid * apt-pkg/cdrom.{cc,h}: - cleanup old ABI break avoidance hacks + * [ABI break] apt-pkg/acquire-item.{cc,h}: + - cleanup around OptionalIndexTarget and SubIndexTarget -- Julian Andres Klode <jak@debian.org> Wed, 20 Jul 2011 16:23:55 +0200 |