aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-04-16 00:05:25 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-04-16 00:05:25 +0000
commitcc1b7db13ed996b8d85176677574f5479ea425c2 (patch)
tree2d0df33ec10e1dcdfe2e775e369b3d7bfe827cb9
parentfc47615e397f61f7f6d5e08003510f94fefd75d9 (diff)
downloadpaludis-cc1b7db13ed996b8d85176677574f5479ea425c2.tar.gz
paludis-cc1b7db13ed996b8d85176677574f5479ea425c2.tar.xz
Always show the more verbose AllMaskedError message. Fixes: ticket:197
-rw-r--r--paludis/dep_list/dep_list.cc4
-rw-r--r--paludis/dep_list/exceptions.cc4
-rw-r--r--paludis/dep_list/exceptions.hh6
-rw-r--r--ruby/paludis_ruby.cc2
-rw-r--r--src/clients/contrarius/install.cc4
-rw-r--r--src/clients/paludis/install.cc5
6 files changed, 12 insertions, 13 deletions
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index b1973fa..fddb2d0 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -657,7 +657,7 @@ DepList::AddVisitor::visit(const PackageDepSpec * const a)
if (already_installed->empty() || ! can_fall_back)
{
if (! a->use_requirements_ptr())
- throw AllMaskedError(stringify(*a));
+ throw AllMaskedError(*a);
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> match_except_reqs(d->_imp->env->package_database()->query(
*a->without_use_requirements(), is_any, qo_whatever));
@@ -667,7 +667,7 @@ DepList::AddVisitor::visit(const PackageDepSpec * const a)
if (! (d->_imp->env->mask_reasons(*i).any()))
throw UseRequirementsNotMetError(stringify(*a));
- throw AllMaskedError(stringify(*a));
+ throw AllMaskedError(*a);
}
else
{
diff --git a/paludis/dep_list/exceptions.cc b/paludis/dep_list/exceptions.cc
index 7cc3e08..4e7555e 100644
--- a/paludis/dep_list/exceptions.cc
+++ b/paludis/dep_list/exceptions.cc
@@ -26,8 +26,8 @@ DepListError::DepListError(const std::string & m) throw () :
{
}
-AllMaskedError::AllMaskedError(const std::string & q) throw () :
- DepListError("Error searching for '" + q + "': no available versions"),
+AllMaskedError::AllMaskedError(const PackageDepSpec & q) throw () :
+ DepListError("Error searching for '" + stringify(q) + "': no available versions"),
_query(q)
{
}
diff --git a/paludis/dep_list/exceptions.hh b/paludis/dep_list/exceptions.hh
index 2c7d347..df34668 100644
--- a/paludis/dep_list/exceptions.hh
+++ b/paludis/dep_list/exceptions.hh
@@ -54,13 +54,13 @@ namespace paludis
class AllMaskedError : public DepListError
{
private:
- std::string _query;
+ const PackageDepSpec _query;
public:
///\name Basic operations
///\{
- AllMaskedError(const std::string & query) throw ();
+ AllMaskedError(const PackageDepSpec & query) throw ();
virtual ~AllMaskedError() throw ()
{
@@ -71,7 +71,7 @@ namespace paludis
/**
* Our query.
*/
- const std::string & query() const
+ const PackageDepSpec query() const
{
return _query;
}
diff --git a/ruby/paludis_ruby.cc b/ruby/paludis_ruby.cc
index b3970ec..c63d9f6 100644
--- a/ruby/paludis_ruby.cc
+++ b/ruby/paludis_ruby.cc
@@ -166,7 +166,7 @@ void paludis::ruby::exception_to_ruby_exception(const std::exception & ee)
{
VALUE ex_args[2];
ex_args[0] = rb_str_new2(dynamic_cast<const paludis::AllMaskedError *>(&ee)->message().c_str());
- ex_args[1] = rb_str_new2(dynamic_cast<const paludis::AllMaskedError *>(&ee)->query().c_str());
+ ex_args[1] = rb_str_new2(stringify(dynamic_cast<const paludis::AllMaskedError *>(&ee)->query()).c_str());
rb_exc_raise(rb_class_new_instance(2, ex_args, c_all_masked_error));
}
else if (0 != dynamic_cast<const paludis::BlockError *>(&ee))
diff --git a/src/clients/contrarius/install.cc b/src/clients/contrarius/install.cc
index 2daf6ca..f0d9b9d 100644
--- a/src/clients/contrarius/install.cc
+++ b/src/clients/contrarius/install.cc
@@ -295,8 +295,8 @@ do_install(std::tr1::shared_ptr<Environment> env, std::string spec_str)
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> p(
env->package_database()->query(
- query::Matches(PackageDepSpec(e.query(), pds_pm_unspecific)) &
- query::RepositoryHasUninstallableInterface(),
+ query::Matches(e.query()) &
+ query::RepositoryHasInstallableInterface(),
qo_order_by_version));
if (p->empty())
diff --git a/src/clients/paludis/install.cc b/src/clients/paludis/install.cc
index e278c61..e1d24a2 100644
--- a/src/clients/paludis/install.cc
+++ b/src/clients/paludis/install.cc
@@ -601,9 +601,7 @@ do_install(std::tr1::shared_ptr<Environment> env)
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> p(
env->package_database()->query(
- query::Matches(PackageDepSpec(
- std::tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(e.query()))))
- & query::RepositoryHasInstallableInterface(), qo_order_by_version));
+ query::Matches(e.query()) & query::RepositoryHasInstallableInterface(), qo_order_by_version));
if (p->empty())
{
cout << endl;
@@ -685,6 +683,7 @@ do_install(std::tr1::shared_ptr<Environment> env)
}
catch (...)
{
+ Log::get_instance()->message(ll_warning, lc_context, "Couldn't work out a friendly error message for mask reasons");
throw e;
}