summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/deb/debmetaindex.cc2
-rw-r--r--apt-pkg/deb/debmetaindex.h3
-rw-r--r--apt-pkg/metaindex.cc40
-rw-r--r--apt-pkg/metaindex.h25
-rw-r--r--cmdline/apt-get.cc30
-rw-r--r--debian/libapt-pkg4.15.symbols1
6 files changed, 51 insertions, 50 deletions
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index a6c88b393..d99fd8393 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/apt-pkg/deb/debmetaindex.cc
@@ -78,7 +78,6 @@ string debReleaseIndex::MetaIndexURI(const char *Type) const
return Res;
}
-#if APT_PKG_ABI >= 0x0413
std::string debReleaseIndex::LocalFileName() const
{
// see if we have a InRelease file
@@ -92,7 +91,6 @@ std::string debReleaseIndex::LocalFileName() const
return "";
}
-#endif
string debReleaseIndex::IndexURISuffix(const char *Type, string const &Section, string const &Arch) const
{
diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h
index 3d35401ec..4a8e454c7 100644
--- a/apt-pkg/deb/debmetaindex.h
+++ b/apt-pkg/deb/debmetaindex.h
@@ -54,8 +54,9 @@ class debReleaseIndex : public metaIndex {
std::string MetaIndexURI(const char *Type) const;
#if APT_PKG_ABI >= 413
- virtual std::string LocalFileName() const;
+ virtual
#endif
+ std::string LocalFileName() const;
std::string IndexURI(const char *Type, std::string const &Section, std::string const &Arch="native") const;
std::string IndexURISuffix(const char *Type, std::string const &Section, std::string const &Arch="native") const;
diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc
new file mode 100644
index 000000000..31a8ec009
--- /dev/null
+++ b/apt-pkg/metaindex.cc
@@ -0,0 +1,40 @@
+// Include Files /*{{{*/
+#include <apt-pkg/indexfile.h>
+#include <apt-pkg/metaindex.h>
+
+#include <stddef.h>
+
+#include <string>
+#include <vector>
+ /*}}}*/
+
+#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
+std::string metaIndex::LocalFileName() const { return ""; }
+#else
+#include <apt-pkg/debmetaindex.h>
+std::string metaIndex::LocalFileName() const
+{
+ debReleaseIndex const * deb = dynamic_cast<debReleaseIndex const*>(this);
+ if (deb != NULL)
+ return deb->LocalFileName();
+
+ return "";
+}
+#endif
+
+metaIndex::metaIndex(std::string const &URI, std::string const &Dist,
+ char const * const Type)
+: Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(false)
+{
+ /* nothing */
+}
+
+metaIndex::~metaIndex()
+{
+ if (Indexes == 0)
+ return;
+ for (std::vector<pkgIndexFile *>::iterator I = (*Indexes).begin();
+ I != (*Indexes).end(); ++I)
+ delete *I;
+ delete Indexes;
+}
diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h
index ae73c27dd..6c3d2880b 100644
--- a/apt-pkg/metaindex.h
+++ b/apt-pkg/metaindex.h
@@ -41,8 +41,8 @@ class metaIndex
// interface to to query it
#if APT_PKG_ABI >= 413
- // returns the path of the local file (or "" if its not available)
- virtual std::string LocalFileName() const {return "";};
+ /** \return the path of the local file (or "" if its not available) */
+ virtual std::string LocalFileName() const;
#else
std::string LocalFileName() const;
#endif
@@ -50,25 +50,12 @@ class metaIndex
// Interface for acquire
virtual std::string ArchiveURI(std::string const& File) const = 0;
virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const = 0;
- virtual std::vector<pkgIndexFile *> *GetIndexFiles() = 0;
+ virtual std::vector<pkgIndexFile *> *GetIndexFiles() = 0;
virtual bool IsTrusted() const = 0;
- metaIndex(std::string const &URI, std::string const &Dist,
- char const * const Type)
- : Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(false)
- {
- /* nothing */
- }
-
- virtual ~metaIndex()
- {
- if (Indexes == 0)
- return;
- for (std::vector<pkgIndexFile *>::iterator I = (*Indexes).begin();
- I != (*Indexes).end(); ++I)
- delete *I;
- delete Indexes;
- }
+ metaIndex(std::string const &URI, std::string const &Dist,
+ char const * const Type);
+ virtual ~metaIndex();
};
#endif
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index b6786faf8..e9e38debc 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -136,28 +136,6 @@ static bool TryToInstallBuildDep(pkgCache::PkgIterator Pkg,pkgCacheFile &Cache,
return true;
}
/*}}}*/
-
-
-// helper that can go wit hthe next ABI break
-#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR < 13)
-static std::string MetaIndexFileNameOnDisk(metaIndex *metaindex)
-{
- // FIXME: this cast is the horror, the horror
- debReleaseIndex *r = (debReleaseIndex*)metaindex;
-
- // see if we have a InRelease file
- std::string PathInRelease = r->MetaIndexFile("InRelease");
- if (FileExists(PathInRelease))
- return PathInRelease;
-
- // and if not return the normal one
- if (FileExists(PathInRelease))
- return r->MetaIndexFile("Release");
-
- return "";
-}
-#endif
-
// GetReleaseForSourceRecord - Return Suite for the given srcrecord /*{{{*/
// ---------------------------------------------------------------------
/* */
@@ -176,12 +154,8 @@ static std::string GetReleaseForSourceRecord(pkgSourceList *SrcList,
{
if (&CurrentIndexFile == (*IF))
{
-#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR < 13)
- std::string path = MetaIndexFileNameOnDisk(*S);
-#else
- std::string path = (*S)->LocalFileName();
-#endif
- if (path != "")
+ std::string const path = (*S)->LocalFileName();
+ if (path != "")
{
indexRecords records;
records.Load(path);
diff --git a/debian/libapt-pkg4.15.symbols b/debian/libapt-pkg4.15.symbols
index 90f67b5cd..a6c5c21ea 100644
--- a/debian/libapt-pkg4.15.symbols
+++ b/debian/libapt-pkg4.15.symbols
@@ -1789,6 +1789,7 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER#
(c++)"indexRecords::IsAlwaysTrusted() const@Base" 1.1~exp5
(c++)"indexRecords::IsNeverTrusted() const@Base" 1.1~exp5
(c++)"indexRecords::SetTrusted(bool)@Base" 1.1~exp5
+ (c++)"metaIndex::metaIndex(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)@Base" 1.1~exp9
### demangle strangeness - buildd report it as MISSING and as new…
(c++)"pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<IndexTarget*, std::allocator<IndexTarget*> > const*, indexRecords*)@Base" 0.8.0
(c++)"pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<IndexTarget*, std::allocator<IndexTarget*> > const*, indexRecords*)@Base" 0.8.0