summaryrefslogtreecommitdiff
path: root/apt-pkg/metaindex.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2017-05-28 19:18:30 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2017-06-26 23:31:15 +0200
commitd7c92411dc1f4c6be098d1425f9c1c075e0c2154 (patch)
tree39913a1c7c7d18639057cdbab2cc8fe2f025465b /apt-pkg/metaindex.cc
parent07815d4edc99585967b9f267e6f37c37008dcba5 (diff)
warn if an expected file can't be acquired
If we couldn't find an entry for a Sources file we would generate an error while for a Packages file we would silently skip it due to assuming it is missing because it is empty. We can do better by checking if the repository declares that it supports a component we want to get the file from and if not say so and hint at the user making a typo. An example were this helps is mozilla.debian.net which dropped the firefox-aurora component (as upstream did) meaning no upgrades until the user notices manually that the repository doesn't provide packages anymore. With this commit warnings are raised hopefully causing the user to investigate what is wrong (sooner).
Diffstat (limited to 'apt-pkg/metaindex.cc')
-rw-r--r--apt-pkg/metaindex.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc
index 8b31051fb..624c7c9c7 100644
--- a/apt-pkg/metaindex.cc
+++ b/apt-pkg/metaindex.cc
@@ -128,3 +128,11 @@ bool metaIndex::IsArchitectureAllSupportedFor(IndexTarget const &target) const/*
return true;
}
/*}}}*/
+bool metaIndex::HasSupportForComponent(std::string const &component) const/*{{{*/
+{
+ debReleaseIndex const * const deb = dynamic_cast<debReleaseIndex const *>(this);
+ if (deb != NULL)
+ return deb->HasSupportForComponent(component);
+ return true;
+}
+ /*}}}*/