aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-06 18:59:53 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-06 18:59:53 +0000
commit8d6a7fe24df29be771088fb470f3afc63a64d574 (patch)
tree643586328531f550ef65454cc2dde5ee380ca445
parent1a9b0f5740722927ab360ac13adb65eb6b8dac07 (diff)
downloadpaludis-8d6a7fe24df29be771088fb470f3afc63a64d574.tar.gz
paludis-8d6a7fe24df29be771088fb470f3afc63a64d574.tar.xz
Include the failing ID in additional reqs exceptions
-rw-r--r--paludis/dep_list.cc8
-rw-r--r--paludis/dep_list_exceptions.cc10
-rw-r--r--paludis/dep_list_exceptions.hh17
3 files changed, 25 insertions, 10 deletions
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index 65595f8..9bd4150 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -583,13 +583,13 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::T
if (! node.spec()->additional_requirements_ptr())
throw AllMaskedError(*node.spec());
- std::tr1::shared_ptr<const PackageIDSequence> match_except_reqs((*d->_imp->env)[selection::AllVersionsUnsorted(
+ std::tr1::shared_ptr<const PackageIDSequence> match_except_reqs((*d->_imp->env)[selection::AllVersionsSorted(
generator::Matches(*node.spec(), d->_imp->opts->match_package_options() + mpo_ignore_additional_requirements))]);
- for (PackageIDSequence::ConstIterator i(match_except_reqs->begin()),
- i_end(match_except_reqs->end()) ; i != i_end ; ++i)
+ for (PackageIDSequence::ReverseConstIterator i(match_except_reqs->rbegin()),
+ i_end(match_except_reqs->rend()) ; i != i_end ; ++i)
if (! (*i)->masked())
- throw AdditionalRequirementsNotMetError(*node.spec());
+ throw AdditionalRequirementsNotMetError(*node.spec(), *i);
throw AllMaskedError(*node.spec());
}
diff --git a/paludis/dep_list_exceptions.cc b/paludis/dep_list_exceptions.cc
index 44b934d..71e5e60 100644
--- a/paludis/dep_list_exceptions.cc
+++ b/paludis/dep_list_exceptions.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -34,9 +34,11 @@ AllMaskedError::AllMaskedError(const PackageDepSpec & q) throw () :
{
}
-AdditionalRequirementsNotMetError::AdditionalRequirementsNotMetError(const PackageDepSpec & q) throw () :
- DepListError("Error searching for '" + stringify(q) + "': additional requirements are not met"),
- _query(q)
+AdditionalRequirementsNotMetError::AdditionalRequirementsNotMetError(const PackageDepSpec & q,
+ const std::tr1::shared_ptr<const PackageID> & i) throw () :
+ DepListError("Error searching for '" + stringify(q) + "': additional requirements are not met on '" + stringify(*i) + "'"),
+ _query(q),
+ _id(i)
{
}
diff --git a/paludis/dep_list_exceptions.hh b/paludis/dep_list_exceptions.hh
index a8a3abd..33a5a18 100644
--- a/paludis/dep_list_exceptions.hh
+++ b/paludis/dep_list_exceptions.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -99,12 +99,15 @@ namespace paludis
{
private:
PackageDepSpec _query;
+ const std::tr1::shared_ptr<const PackageID> _id;
public:
///\name Basic operations
///\{
- AdditionalRequirementsNotMetError(const PackageDepSpec & query) throw ();
+ AdditionalRequirementsNotMetError(
+ const PackageDepSpec & query,
+ const std::tr1::shared_ptr<const PackageID> & id) throw ();
virtual ~AdditionalRequirementsNotMetError() throw ();
@@ -117,6 +120,16 @@ namespace paludis
{
return _query;
}
+
+ /**
+ * Our ID of choice.
+ *
+ * \since 0.44
+ */
+ const std::tr1::shared_ptr<const PackageID> package_id() const
+ {
+ return _id;
+ }
};
/**