diff options
author | Julian Andres Klode <jak@debian.org> | 2020-12-18 21:00:29 +0000 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2020-12-18 21:00:29 +0000 |
commit | 06ec0067057e0578f3bc515f6a97d6a9d70824f6 (patch) | |
tree | e0cb170d0a4f8caff89c2402bf24e6951b716360 /apt-pkg/deb/debmetaindex.cc | |
parent | ece7f5bb0afee0994a4fb4380e756ce725fe67a9 (diff) | |
parent | a5859bafdaa6bcf12934d0fb1715a5940965e13a (diff) |
Merge branch 'pu/uriencode' into 'master'
Use encoded URIs in the acquire system
See merge request apt-team/apt!139
Diffstat (limited to 'apt-pkg/deb/debmetaindex.cc')
-rw-r--r-- | apt-pkg/deb/debmetaindex.cc | 13 |
1 files changed, 10 insertions, 3 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)/*{{{*/ { |