summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/deb/debmetaindex.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index 3bc7f78de..515893133 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/apt-pkg/deb/debmetaindex.cc
@@ -1315,6 +1315,7 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/
ArchiveURI.Path.erase(0, 1);
std::string Server;
+ auto const PreviousDeb = List.empty() ? nullptr : List.back();
auto const Deb = GetDebReleaseIndexBy(List, URI, Dist, Options);
std::string filename;
@@ -1343,7 +1344,13 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/
{
if (APT::String::Endswith(Snapshot, "?"))
{
+ // Erase the SHADOWED option and remove the release index from the list if we created it.
Options.erase("SHADOWED");
+ if (Deb && Deb != PreviousDeb) {
+ assert(List.back() == Deb);
+ List.pop_back();
+ delete Deb;
+ }
goto nosnapshot;
}
if (Server != "no" && filename.empty())