diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2023-06-27 17:11:06 +0200 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2023-07-12 16:49:19 +0200 |
| commit | 5dcb36e7af4bd65211ac4937e5e7feac8c85683c (patch) | |
| tree | fa2d8af7c69f7460bed3e6cde8ea5b791e734662 | |
| parent | f26a15a3f9b020dcd5c5203bd73133c8d647c99c (diff) | |
Fix snapshot crashes
We did not handle multiple components properly, add a contrib
component to the test case.
| -rw-r--r-- | apt-pkg/deb/debmetaindex.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 744a5cab7..3fef976e9 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -1158,6 +1158,8 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ std::transform(Options.begin(), Options.end(), std::back_inserter(ret), [](auto &&O) { return O.first; }); std::sort(ret.begin(), ret.end()); + auto r = std::remove(ret.begin(), ret.end(), "SHADOWED"); + ret.erase(r, ret.end()); return ret; } @@ -1315,7 +1317,7 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ std::string filename; // The Release file and config based on that should be the ultimate source of truth. - if (ReleaseFileName(Deb, filename)) + if (Deb && ReleaseFileName(Deb, filename)) { auto OldDeb = dynamic_cast<debReleaseIndex *>(Deb->UnloadedClone()); if (not OldDeb->Load(filename, nullptr)) |
