aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-15 17:44:00 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-15 17:44:00 +0000
commitd80930475d96a59fb30dae346fbd32b9374a0d63 (patch)
tree152ce5be28b474f820a23e2a496a32a4de2db338
parent6f4819ef3f220deab856982f6684f584e618ff4f (diff)
downloadpaludis-d80930475d96a59fb30dae346fbd32b9374a0d63.tar.gz
paludis-d80930475d96a59fb30dae346fbd32b9374a0d63.tar.xz
Reduce non existing || ( ) warnings to maybe
-rw-r--r--paludis/qa/deps_exist_check.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/paludis/qa/deps_exist_check.cc b/paludis/qa/deps_exist_check.cc
index 246d65f..7cbb180 100644
--- a/paludis/qa/deps_exist_check.cc
+++ b/paludis/qa/deps_exist_check.cc
@@ -25,6 +25,7 @@
#include <paludis/package_dep_atom.hh>
#include <paludis/block_dep_atom.hh>
#include <paludis/use_dep_atom.hh>
+#include <paludis/save.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -37,19 +38,27 @@ namespace
CheckResult & result;
const std::string role;
const Environment * env;
+ bool in_any;
Checker(CheckResult & rr, const std::string & r, const Environment * e) :
result(rr),
role(r),
- env(e)
+ env(e),
+ in_any(false)
{
}
void visit(const PackageDepAtom * const p)
{
if (env->package_database()->query(p)->empty())
- result << Message(qal_major, "No match for " + role + " entry '"
- + stringify(*p) + "'");
+ {
+ if (in_any)
+ result << Message(qal_maybe, "No match for " + role + " entry '"
+ + stringify(*p) + "' inside || ( ) block");
+ else
+ result << Message(qal_major, "No match for " + role + " entry '"
+ + stringify(*p) + "'");
+ }
}
void visit(const AllDepAtom * const a)
@@ -60,6 +69,7 @@ namespace
void visit(const AnyDepAtom * const a)
{
/// \todo VV make this smarter
+ Save<bool> save_in_any(&in_any, true);
std::for_each(a->begin(), a->end(), accept_visitor(this));
}