summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/debmetaindex.cc13
-rw-r--r--apt-pkg/deb/debmetaindex.h2
2 files changed, 11 insertions, 4 deletions
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index a72f6d055..f24a5e79e 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/apt-pkg/deb/debmetaindex.cc
@@ -142,10 +142,10 @@ static std::string constructMetaIndexURI(std::string URI, std::string const &Dis
if (Dist == "/")
;
else if (Dist[Dist.size()-1] == '/')
- URI += Dist;
+ URI += pkgAcquire::URIEncode(Dist);
else
- URI += "dists/" + Dist + "/";
- return URI + Type;
+ URI += "dists/" + pkgAcquire::URIEncode(Dist) + "/";
+ return URI + pkgAcquire::URIEncode(Type);
}
std::string debReleaseIndex::MetaIndexURI(const char *Type) const
{
@@ -420,6 +420,13 @@ void debReleaseIndex::AddComponent(std::string const &sourcesEntry, /*{{{*/
d->DebEntries.push_back(entry);
}
/*}}}*/
+std::string debReleaseIndex::ArchiveURI(std::string const &File) const /*{{{*/
+{
+ if (File.empty())
+ return URI;
+ return URI + pkgAcquire::URIEncode(File);
+}
+ /*}}}*/
bool debReleaseIndex::Load(std::string const &Filename, std::string * const ErrorText)/*{{{*/
{
diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h
index 5576ff809..717f08e2b 100644
--- a/apt-pkg/deb/debmetaindex.h
+++ b/apt-pkg/deb/debmetaindex.h
@@ -32,7 +32,7 @@ class APT_HIDDEN debReleaseIndex : public metaIndex
debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted, std::map<std::string,std::string> const &Options);
virtual ~debReleaseIndex();
- virtual std::string ArchiveURI(std::string const &File) const APT_OVERRIDE {return URI + File;};
+ virtual std::string ArchiveURI(std::string const &File) const APT_OVERRIDE;
virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) APT_OVERRIDE;
virtual std::vector<IndexTarget> GetIndexTargets() const APT_OVERRIDE;