aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-10 14:37:06 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-10 14:37:06 +0100
commitc84fb95a15d9b9b96a2e36509391fe6444cc69a0 (patch)
treec9a133c1628b9684a7ae469ef661a7574d56f0ce
parent0087be380e8f5cac800d07bf364b2974fccf17cf (diff)
downloadpaludis-c84fb95a15d9b9b96a2e36509391fe6444cc69a0.tar.gz
paludis-c84fb95a15d9b9b96a2e36509391fe6444cc69a0.tar.xz
Action exceptions work differently.
Aborts are no longer counted as 'failures'.
-rw-r--r--doc/api/cplusplus/examples/example_action.cc10
-rw-r--r--paludis/action-fwd.hh9
-rw-r--r--paludis/action.cc48
-rw-r--r--paludis/action.hh132
-rw-r--r--paludis/install_task.cc61
-rw-r--r--paludis/install_task.hh7
-rw-r--r--paludis/repositories/accounts/accounts_id.cc6
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc2
-rw-r--r--paludis/repositories/accounts/installed_accounts_id.cc2
-rw-r--r--paludis/repositories/accounts/passwd_accounts_handler.cc44
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc2
-rw-r--r--paludis/repositories/cran/cran_package_id.cc2
-rw-r--r--paludis/repositories/e/e_installed_repository.cc10
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc98
-rw-r--r--paludis/repositories/e/e_repository_TEST_exlibs.cc42
-rw-r--r--paludis/repositories/e/e_repository_TEST_phases.cc2
-rw-r--r--paludis/repositories/e/ebuild.cc22
-rw-r--r--paludis/repositories/e/ebuild_entries.cc26
-rw-r--r--paludis/repositories/e/ebuild_id.cc6
-rw-r--r--paludis/repositories/e/exndbam_repository.cc8
-rw-r--r--paludis/repositories/e/fetch_visitor.cc2
-rw-r--r--paludis/repositories/e/manifest2_reader.cc2
-rw-r--r--paludis/repositories/e/manifest2_reader.hh2
-rw-r--r--paludis/repositories/e/source_uri_finder.cc2
-rw-r--r--paludis/repositories/e/vdb_repository.cc8
-rw-r--r--paludis/repositories/fake/fake_package_id.cc14
-rw-r--r--paludis/repositories/gems/gem_specification.cc14
-rw-r--r--paludis/repositories/unavailable/unavailable_id.cc2
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc14
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc14
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc8
-rw-r--r--paludis/repositories/unwritten/unwritten_id.cc2
-rw-r--r--paludis/repositories/virtuals/package_id.cc14
-rw-r--r--paludis/uninstall_task.cc10
-rw-r--r--python/action.cc25
-rw-r--r--ruby/action.cc1
-rw-r--r--ruby/paludis_ruby.cc87
-rw-r--r--src/clients/accerso/accerso.cc65
-rw-r--r--src/clients/appareo/appareo.cc60
-rw-r--r--src/clients/cave/cave.cc9
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc16
-rw-r--r--src/clients/cave/cmd_perform.cc6
-rw-r--r--src/clients/paludis/do_config.cc4
-rw-r--r--src/clients/paludis/info.cc2
-rw-r--r--src/clients/paludis/paludis.cc10
-rw-r--r--src/clients/paludis/uninstall.cc4
-rw-r--r--src/output/console_install_task.cc11
-rw-r--r--src/output/console_install_task.hh7
49 files changed, 390 insertions, 572 deletions
diff --git a/doc/api/cplusplus/examples/example_action.cc b/doc/api/cplusplus/examples/example_action.cc
index 3fe9caa..69a52f1 100644
--- a/doc/api/cplusplus/examples/example_action.cc
+++ b/doc/api/cplusplus/examples/example_action.cc
@@ -54,9 +54,12 @@ int main(int argc, char * argv[])
generator::Package(QualifiedPackageName("sys-apps/paludis")))]);
/* For each ID: */
- for (PackageIDSet::ConstIterator i(ids->begin()), i_end(ids->end()) ;
+ for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
{
+ /* Failures go here: */
+ const std::tr1::shared_ptr<Sequence<FetchActionFailure> > failures(new Sequence<FetchActionFailure>);
+
/* Do we support a FetchAction? We find out by creating a
* SupportsActionTest<FetchAction> object, and querying via the
* PackageID::supports_action method. */
@@ -74,6 +77,7 @@ int main(int argc, char * argv[])
* and whether unneeded (e.g. due to disabled USE flags) and
* unmirrorable source files should still be fetched. */
FetchAction fetch_action(make_named_values<FetchActionOptions>(
+ value_for<n::errors>(failures),
value_for<n::exclude_unmirrorable>(false),
value_for<n::fetch_unneeded>(false),
value_for<n::ignore_unfetched>(false),
@@ -84,7 +88,7 @@ int main(int argc, char * argv[])
{
(*i)->perform_action(fetch_action);
}
- catch (const FetchActionError & e)
+ catch (const ActionFailedError & e)
{
exit_status |= 1;
@@ -92,7 +96,7 @@ int main(int argc, char * argv[])
/* We might get detailed information about individual fetch
* failures. */
- for (Sequence<FetchActionFailure>::ConstIterator f(e.failures()->begin()), f_end(e.failures()->end()) ;
+ for (Sequence<FetchActionFailure>::ConstIterator f(failures->begin()), f_end(failures->end()) ;
f != f_end ; ++f)
{
cout << " * File '" << f->target_file() << "': ";
diff --git a/paludis/action-fwd.hh b/paludis/action-fwd.hh
index e26dc79..2fc0aac 100644
--- a/paludis/action-fwd.hh
+++ b/paludis/action-fwd.hh
@@ -44,13 +44,8 @@ namespace paludis
class SupportsActionTestBase;
template <typename A_> class SupportsActionTest;
- class ActionError;
- class UnsupportedActionError;
- class InstallActionError;
- class FetchActionError;
- class UninstallActionError;
- class ConfigActionError;
- class InfoActionError;
+ class ActionFailedError;
+ class ActionAbortedError;
struct FetchActionOptions;
struct InstallActionOptions;
diff --git a/paludis/action.cc b/paludis/action.cc
index b40a1ce..03658db 100644
--- a/paludis/action.cc
+++ b/paludis/action.cc
@@ -219,11 +219,6 @@ SupportsActionTestBase::~SupportsActionTestBase()
{
}
-UnsupportedActionError::UnsupportedActionError(const PackageID & id, const Action & a) throw () :
- ActionError("Unsupported action '" + stringify(a) + "' on '" + stringify(id) + "'")
-{
-}
-
namespace
{
struct ActionStringifier
@@ -277,50 +272,13 @@ paludis::operator<< (std::ostream & s, const Action & a)
return s << a.accept_returning<std::string>(t);
}
-ActionError::ActionError(const std::string & msg) throw () :
+ActionFailedError::ActionFailedError(const std::string & msg) throw () :
Exception(msg)
{
}
-InstallActionError::InstallActionError(const std::string & msg) throw () :
- ActionError("Install error: " + msg)
-{
-}
-
-FetchActionError::FetchActionError(const std::string & msg,
- const std::tr1::shared_ptr<const Sequence<FetchActionFailure> > & e) throw () :
- ActionError("Fetch error: " + msg),
- _failures(e)
-{
-}
-
-FetchActionError::FetchActionError(const std::string & msg) throw () :
- ActionError("Fetch error: " + msg)
-{
-}
-
-FetchActionError::~FetchActionError() throw ()
-{
-}
-
-const std::tr1::shared_ptr<const Sequence<FetchActionFailure> >
-FetchActionError::failures() const
-{
- return _failures;
-}
-
-UninstallActionError::UninstallActionError(const std::string & msg) throw () :
- ActionError("Uninstall error: " + msg)
-{
-}
-
-ConfigActionError::ConfigActionError(const std::string & msg) throw () :
- ActionError("Configuration error: " + msg)
-{
-}
-
-InfoActionError::InfoActionError(const std::string & msg) throw () :
- ActionError("Info error: " + msg)
+ActionAbortedError::ActionAbortedError(const std::string & msg) throw () :
+ Exception(msg)
{
}
diff --git a/paludis/action.hh b/paludis/action.hh
index 9ab9062..814f464 100644
--- a/paludis/action.hh
+++ b/paludis/action.hh
@@ -50,6 +50,7 @@ namespace paludis
{
struct config_protect;
struct destination;
+ struct errors;
struct exclude_unmirrorable;
struct failed_automatic_fetching;
struct failed_integrity_checks;
@@ -77,6 +78,12 @@ namespace paludis
struct FetchActionOptions
{
/**
+ * Any errors that occur will be added to this list. Must not be null.
+ *
+ * \since 0.40
+ */
+ NamedValue<n::errors, std::tr1::shared_ptr<Sequence<FetchActionFailure> > > errors;
+ /**
* \since 0.32
*/
NamedValue<n::exclude_unmirrorable, bool> exclude_unmirrorable;
@@ -549,146 +556,39 @@ namespace paludis
std::ostream & operator<< (std::ostream &, const Action &) PALUDIS_VISIBLE;
/**
- * Parent class for Action related errors.
+ * Thrown if an action fails.
*
* \ingroup g_actions
* \ingroup g_exceptions
- * \since 0.26
- * \nosubgrouping
+ * \since 0.42
*/
- class PALUDIS_VISIBLE ActionError :
+ class PALUDIS_VISIBLE ActionFailedError :
public Exception
{
public:
///\name Basic operations
///\{
- ActionError(const std::string & msg) throw ();
-
- ///\}
- };
-
- /**
- * Thrown if a PackageID is asked to perform an Action that it does
- * not support.
- *
- * \ingroup g_exceptions
- * \ingroup g_actions
- * \since 0.26
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE UnsupportedActionError :
- public ActionError
- {
- public:
- ///\name Basic operations
- ///\{
-
- UnsupportedActionError(const PackageID &, const Action &) throw ();
-
- ///\}
- };
-
- /**
- * Thrown if a PackageID fails to perform an InstallAction.
- *
- * \ingroup g_exceptions
- * \ingroup g_actions
- * \since 0.26
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE InstallActionError : public ActionError
- {
- public:
- ///\name Basic operations
- ///\{
-
- InstallActionError(const std::string & msg) throw ();
-
- ///\}
- };
-
- /**
- * Thrown if a PackageID fails to perform a FetchAction.
- *
- * \ingroup g_exceptions
- * \ingroup g_actions
- * \since 0.26
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE FetchActionError :
- public ActionError
- {
- private:
- const std::tr1::shared_ptr<const Sequence<FetchActionFailure> > _failures;
-
- public:
- ///\name Basic operations
- ///\{
-
- FetchActionError(const std::string &) throw ();
- FetchActionError(const std::string &, const std::tr1::shared_ptr<const Sequence<FetchActionFailure> > &) throw ();
- ~FetchActionError() throw ();
+ ActionFailedError(const std::string & msg) throw ();
///\}
-
- /// More information about failed fetches.
- const std::tr1::shared_ptr<const Sequence<FetchActionFailure> > failures() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
/**
- * Thrown if a PackageID fails to perform an UninstallAction.
+ * Thrown if an action is aborted.
*
- * \ingroup g_exceptions
* \ingroup g_actions
- * \since 0.26
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE UninstallActionError : public ActionError
- {
- public:
- ///\name Basic operations
- ///\{
-
- UninstallActionError(const std::string & msg) throw ();
-
- ///\}
- };
-
- /**
- * Thrown if a PackageID fails to perform a ConfigAction.
- *
- * \ingroup g_exceptions
- * \ingroup g_actions
- * \since 0.26
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE ConfigActionError : public ActionError
- {
- public:
- ///\name Basic operations
- ///\{
-
- ConfigActionError(const std::string & msg) throw ();
-
- ///\}
- };
-
- /**
- * Thrown if a PackageID fails to perform an InfoAction.
- *
* \ingroup g_exceptions
- * \ingroup g_actions
- * \since 0.26
- * \nosubgrouping
+ * \since 0.42
*/
- class PALUDIS_VISIBLE InfoActionError : public ActionError
+ class PALUDIS_VISIBLE ActionAbortedError :
+ public Exception
{
public:
///\name Basic operations
///\{
- InfoActionError(const std::string & msg) throw ();
+ ActionAbortedError(const std::string &) throw ();
///\}
};
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index 8207d03..b57f101 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -574,7 +574,7 @@ InstallTask::_display_task_list()
_imp->raw_targets.begin(), _imp->raw_targets.end(), " "))
("DEPLIST_HAS_ERRORS", stringify(_imp->dep_list.has_errors()))
).max_exit_status())
- throw InstallActionError("Pretend install aborted by hook");
+ throw ActionAbortedError("Pretend install aborted by hook");
on_display_merge_list_pre();
@@ -586,7 +586,7 @@ InstallTask::_display_task_list()
0 != perform_hook(Hook("install_pretend_display_item_pre")
("TARGET", stringify(*dep->package_id()))
("KIND", stringify(dep->kind()))).max_exit_status())
- throw InstallActionError("Pretend install aborted by hook");
+ throw ActionAbortedError("Pretend install aborted by hook");
on_display_merge_list_entry(*dep);
@@ -594,7 +594,7 @@ InstallTask::_display_task_list()
0 != perform_hook(Hook("install_pretend_display_item_post")
("TARGET", stringify(*dep->package_id()))
("KIND", stringify(dep->kind()))).max_exit_status())
- throw InstallActionError("Pretend install aborted by hook");
+ throw ActionAbortedError("Pretend install aborted by hook");
}
/* we're done displaying our task list */
@@ -740,6 +740,7 @@ InstallTask::_pretend()
if (dep->package_id()->supports_action(fetch_action_query))
{
FetchActionOptions options(make_named_values<FetchActionOptions>(
+ value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(false),
value_for<n::fetch_unneeded>(false),
value_for<n::ignore_unfetched>(true),
@@ -751,14 +752,16 @@ InstallTask::_pretend()
{
dep->package_id()->perform_action(fetch_action);
}
- catch (const FetchActionError & e)
+ catch (const ActionFailedError & e)
{
pretend_failed = true;
success = false;
if (output_manager_holder.output_manager_if_constructed())
- on_fetch_action_error(output_manager_holder.output_manager_if_constructed(), e);
+ on_fetch_action_error(output_manager_holder.output_manager_if_constructed(), e,
+ options.errors());
else
- on_fetch_action_error(make_shared_ptr(new StandardOutputManager), e);
+ on_fetch_action_error(make_shared_ptr(new StandardOutputManager), e,
+ options.errors());
}
}
@@ -781,7 +784,7 @@ InstallTask::_pretend()
_imp->raw_targets.begin(), _imp->raw_targets.end(), " "))
("DEPLIST_HAS_ERRORS", stringify(_imp->dep_list.has_errors()))
).max_exit_status())
- throw InstallActionError("Pretend install aborted by hook");
+ throw ActionAbortedError("Pretend install aborted by hook");
}
return pretend_failed;
@@ -798,7 +801,7 @@ InstallTask::_clean(
/* clean one item */
if (0 != perform_hook(Hook("clean_pre")("TARGET", stringify(*id))
("X_OF_Y", stringify(x) + " of " + stringify(y))).max_exit_status())
- throw InstallActionError("Clean of '" + cpvr + "' aborted by hook");
+ throw ActionAbortedError("Clean of '" + cpvr + "' aborted by hook");
on_clean_pre(*dep, *id, x, y, s, f);
try
@@ -806,7 +809,7 @@ InstallTask::_clean(
UninstallAction uninstall_action(options);
id->perform_action(uninstall_action);
}
- catch (const UninstallActionError & e)
+ catch (const ActionFailedError & e)
{
on_clean_fail(*dep, *id, x, y, s, f);
HookResult PALUDIS_ATTRIBUTE((unused)) dummy(perform_hook(Hook("clean_fail")
@@ -817,7 +820,7 @@ InstallTask::_clean(
on_clean_post(*dep, *id, x, y, s, f);
if (0 != perform_hook(Hook("clean_post")("TARGET", stringify(*id))
("X_OF_Y", stringify(x) + " of " + stringify(y))).max_exit_status())
- throw InstallActionError("Clean of '" + cpvr + "' aborted by hook");
+ throw ActionAbortedError("Clean of '" + cpvr + "' aborted by hook");
}
void
@@ -843,7 +846,7 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
if (0 != perform_hook(Hook("fetch_pre")
("TARGET", cpvr)
("X_OF_Y", stringify(x) + " of " + stringify(y))).max_exit_status())
- throw InstallActionError("Fetch of '" + cpvr + "' aborted by hook");
+ throw ActionAbortedError("Fetch of '" + cpvr + "' aborted by hook");
on_fetch_pre(*dep, x, y, s, f);
}
else
@@ -852,7 +855,7 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
("TARGET", cpvr)
("X_OF_Y", stringify(x) + " of " + stringify(y))
("PALUDIS_NO_LIVE_DESTINATION", live_destination ? "" : "yes")).max_exit_status())
- throw InstallActionError("Install of '" + cpvr + "' aborted by hook");
+ throw ActionAbortedError("Install of '" + cpvr + "' aborted by hook");
on_install_pre(*dep, x, y, s, f);
}
@@ -926,7 +929,7 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
output_manager_holder.reset();
}
}
- catch (const InstallActionError & e)
+ catch (const ActionFailedError & e)
{
on_install_fail(*dep, x, y, s, f);
HookResult PALUDIS_ATTRIBUTE((unused)) dummy(perform_hook(Hook("install_fail")("TARGET", cpvr)("MESSAGE", e.message())));
@@ -940,7 +943,7 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
if (0 != perform_hook(Hook("fetch_post")
("TARGET", cpvr)
("X_OF_Y", stringify(x) + " of " + stringify(y))).max_exit_status())
- throw InstallActionError("Fetch of '" + cpvr + "' aborted by hook");
+ throw ActionAbortedError("Fetch of '" + cpvr + "' aborted by hook");
}
else
{
@@ -949,7 +952,7 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
("TARGET", cpvr)
("X_OF_Y", stringify(x) + " of " + stringify(y))
("PALUDIS_NO_LIVE_DESTINATION", live_destination ? "" : "yes")).max_exit_status())
- throw InstallActionError("Install of '" + cpvr + "' aborted by hook");
+ throw ActionAbortedError("Install of '" + cpvr + "' aborted by hook");
}
if (_imp->fetch_only || ! live_destination)
@@ -987,7 +990,7 @@ InstallTask::_main_actions_pre_hooks()
{
if (0 != perform_hook(Hook("fetch_all_pre")("TARGETS", join(
_imp->raw_targets.begin(), _imp->raw_targets.end(), " "))).max_exit_status())
- throw InstallActionError("Fetch aborted by hook");
+ throw ActionAbortedError("Fetch aborted by hook");
on_fetch_all_pre();
}
else
@@ -1002,7 +1005,7 @@ InstallTask::_main_actions_pre_hooks()
if (0 != perform_hook(Hook("install_all_pre")
("TARGETS", join(_imp->raw_targets.begin(), _imp->raw_targets.end(), " "))
("PALUDIS_NO_LIVE_DESTINATION", any_live_destination ? "" : "yes")).max_exit_status())
- throw InstallActionError("Install aborted by hook");
+ throw ActionAbortedError("Install aborted by hook");
on_install_all_pre();
}
}
@@ -1072,22 +1075,13 @@ InstallTask::_main_actions_all(const int y, const DepList::Iterator dep_last_pac
{
_one(dep, x, y, s, f, is_first, is_last, output_manager_holder);
}
- catch (const FetchActionError & e)
- {
- dep->handled().reset(new DepListEntryHandledFetchFailed);
- if (output_manager_holder && output_manager_holder->output_manager_if_constructed())
- on_fetch_action_error(output_manager_holder->output_manager_if_constructed(), e);
- else
- on_fetch_action_error(make_shared_ptr(new StandardOutputManager), e);
- ++f;
- }
- catch (const ActionError & e)
+ catch (const ActionFailedError & e)
{
dep->handled().reset(new DepListEntryHandledFailed);
if (output_manager_holder && output_manager_holder->output_manager_if_constructed())
- on_install_action_error(output_manager_holder->output_manager_if_constructed(), e);
+ on_non_fetch_action_error(output_manager_holder->output_manager_if_constructed(), e);
else
- on_install_action_error(make_shared_ptr(new StandardOutputManager), e);
+ on_non_fetch_action_error(make_shared_ptr(new StandardOutputManager), e);
++f;
}
@@ -1199,14 +1193,14 @@ InstallTask::_main_actions_post_hooks()
on_fetch_all_post();
if (0 != perform_hook(Hook("fetch_all_post")("TARGETS", join(
_imp->raw_targets.begin(), _imp->raw_targets.end(), " "))).max_exit_status())
- throw InstallActionError("Fetch aborted by hook");
+ throw ActionAbortedError("Fetch aborted by hook");
}
else
{
on_install_all_post();
if (0 != perform_hook(Hook("install_all_post")("TARGETS", join(
_imp->raw_targets.begin(), _imp->raw_targets.end(), " "))).max_exit_status())
- throw InstallActionError("Install aborted by hook");
+ throw ActionAbortedError("Install aborted by hook");
}
}
@@ -1244,7 +1238,7 @@ InstallTask::execute()
("FETCH_ONLY", stringify(_imp->fetch_only))
("DEPLIST_HAS_ERRORS", stringify(_imp->dep_list.has_errors()))
).max_exit_status())
- throw InstallActionError("Install task execute aborted by hook");
+ throw ActionAbortedError("Install task execute aborted by hook");
_execute();
success = true;
@@ -1293,7 +1287,7 @@ InstallTask::execute()
("SUCCESS", stringify(success))
("DEPLIST_HAS_ERRORS", stringify(_imp->dep_list.has_errors()))
).max_exit_status())
- throw InstallActionError("Install task execute aborted by hook");
+ throw ActionAbortedError("Install task execute aborted by hook");
}
const DepList &
@@ -1910,6 +1904,7 @@ FetchActionOptions
InstallTask::make_fetch_action_options(const DepListEntry &, OutputManagerFromEnvironment & o) const
{
return make_named_values<FetchActionOptions>(
+ value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(false),
value_for<n::fetch_unneeded>(false),
value_for<n::ignore_unfetched>(false),
diff --git a/paludis/install_task.hh b/paludis/install_task.hh
index d2fce11..37debab 100644
--- a/paludis/install_task.hh
+++ b/paludis/install_task.hh
@@ -210,8 +210,11 @@ namespace paludis
virtual void on_had_both_package_and_set_targets_error(const HadBothPackageAndSetTargets &) = 0;
virtual void on_multiple_set_targets_specified(const MultipleSetTargetsSpecified &) = 0;
- virtual void on_install_action_error(const std::tr1::shared_ptr<OutputManager> &, const ActionError &) = 0;
- virtual void on_fetch_action_error(const std::tr1::shared_ptr<OutputManager> &, const FetchActionError &) = 0;
+ virtual void on_non_fetch_action_error(const std::tr1::shared_ptr<OutputManager> &,
+ const ActionFailedError &) = 0;
+ virtual void on_fetch_action_error(const std::tr1::shared_ptr<OutputManager> &,
+ const ActionFailedError &,
+ const std::tr1::shared_ptr<const Sequence<FetchActionFailure> > &) = 0;
virtual void on_phase_skip(const std::tr1::shared_ptr<OutputManager> & output_manager, const std::string & phase) = 0;
virtual void on_phase_abort(const std::tr1::shared_ptr<OutputManager> & output_manager, const std::string & phase) = 0;
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index 8d4e6fd..c1fd160 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -468,10 +468,10 @@ AccountsID::perform_action(Action & action) const
{
const InstallAction * const install_action(simple_visitor_cast<const InstallAction>(action));
if (! install_action)
- throw UnsupportedActionError(*this, action);
+ throw ActionFailedError("Unsupported action: " + stringify(action));
if (! (*install_action->options.destination()).destination_interface())
- throw InstallActionError("Can't install '" + stringify(*this)
+ throw ActionFailedError("Can't install '" + stringify(*this)
+ "' to destination '" + stringify(install_action->options.destination()->name())
+ "' because destination does not provide destination_interface");
@@ -503,7 +503,7 @@ AccountsID::perform_action(Action & action) const
break;
case wp_abort:
- throw InstallActionError("Told to abort install");
+ throw ActionAbortedError("Told to abort install");
case last_wp:
throw InternalError(PALUDIS_HERE, "bad WantPhase");
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index 77e7689..b0e6a6e 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -414,7 +414,7 @@ void
AccountsRepository::merge(const MergeParams & m)
{
if (! _imp->handler_if_installed)
- throw InstallActionError("Can't merge to here");
+ throw ActionFailedError("Can't merge to here");
_imp->handler_if_installed->merge(m);
}
diff --git a/paludis/repositories/accounts/installed_accounts_id.cc b/paludis/repositories/accounts/installed_accounts_id.cc
index 38f5671..c239a07 100644
--- a/paludis/repositories/accounts/installed_accounts_id.cc
+++ b/paludis/repositories/accounts/installed_accounts_id.cc
@@ -362,6 +362,6 @@ InstalledAccountsID::supports_action(const SupportsActionTestBase &) const
void
InstalledAccountsID::perform_action(Action & action) const
{
- throw UnsupportedActionError(*this, action);
+ throw ActionFailedError("Unsupported action: " + stringify(action));
}
diff --git a/paludis/repositories/accounts/passwd_accounts_handler.cc b/paludis/repositories/accounts/passwd_accounts_handler.cc
index 6001331..3ed16c0 100644
--- a/paludis/repositories/accounts/passwd_accounts_handler.cc
+++ b/paludis/repositories/accounts/passwd_accounts_handler.cc
@@ -60,16 +60,16 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
{
PackageID::MetadataConstIterator m(params.package_id()->find_metadata("username"));
if (params.package_id()->end_metadata() == m)
- throw InstallActionError("Key 'username' for '" + stringify(*params.package_id()) + "' does not exist");
+ throw ActionFailedError("Key 'username' for '" + stringify(*params.package_id()) + "' does not exist");
const MetadataValueKey<std::string> * k(simple_visitor_cast<const MetadataValueKey<std::string> >(**m));
if (! k)
- throw InstallActionError("Key 'username' for '" + stringify(*params.package_id()) + "' is not a string key");
+ throw ActionFailedError("Key 'username' for '" + stringify(*params.package_id()) + "' is not a string key");
username = k->value();
if (0 != getpwnam(username.c_str()))
- throw InstallActionError("User '" + username + "' already exists");
+ throw ActionFailedError("User '" + username + "' already exists");
} while (false);
std::string gecos;
@@ -81,12 +81,12 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
const MetadataValueKey<std::string> * k(simple_visitor_cast<const MetadataValueKey<std::string> >(**m));
if (! k)
- throw InstallActionError("Key 'gecos' for '" + stringify(*params.package_id()) + "' is not a string key");
+ throw ActionFailedError("Key 'gecos' for '" + stringify(*params.package_id()) + "' is not a string key");
gecos = k->value();
if (std::string::npos != gecos.find('\''))
- throw InstallActionError("Value for key 'gecos' for '" + stringify(*params.package_id()) + "' must not contain a quote");
+ throw ActionFailedError("Value for key 'gecos' for '" + stringify(*params.package_id()) + "' must not contain a quote");
if (! gecos.empty())
gecos = " -c '" + gecos + "'";
@@ -101,12 +101,12 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
const MetadataValueKey<std::string> * k(simple_visitor_cast<const MetadataValueKey<std::string> >(**m));
if (! k)
- throw InstallActionError("Key 'preferred_uid' for '" + stringify(*params.package_id()) + "' is not a string key");
+ throw ActionFailedError("Key 'preferred_uid' for '" + stringify(*params.package_id()) + "' is not a string key");
preferred_uid = k->value();
if (std::string::npos != preferred_uid.find_first_not_of("0123456789"))
- throw InstallActionError("Value for key 'preferred_uid' for '" + stringify(*params.package_id()) + "' must be a number");
+ throw ActionFailedError("Value for key 'preferred_uid' for '" + stringify(*params.package_id()) + "' must be a number");
uid_t uid(destringify<uid_t>(preferred_uid));
if (getpwuid(uid))
@@ -128,12 +128,12 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
const MetadataValueKey<std::string> * k(simple_visitor_cast<const MetadataValueKey<std::string> >(**m));
if (! k)
- throw InstallActionError("Key 'primary_group' for '" + stringify(*params.package_id()) + "' is not a string key");
+ throw ActionFailedError("Key 'primary_group' for '" + stringify(*params.package_id()) + "' is not a string key");
primary_group = k->value();
if (std::string::npos != primary_group.find('\''))
- throw InstallActionError("Value for key 'primary_group' for '" + stringify(*params.package_id()) + "' must not contain a quote");
+ throw ActionFailedError("Value for key 'primary_group' for '" + stringify(*params.package_id()) + "' must not contain a quote");
if (! primary_group.empty())
primary_group = " -g '" + primary_group + "'";
@@ -148,12 +148,12 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
const MetadataCollectionKey<Set<std::string> > * k(simple_visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**m));
if (! k)
- throw InstallActionError("Key 'extra_groups' for '" + stringify(*params.package_id()) + "' is not a string set key");
+ throw ActionFailedError("Key 'extra_groups' for '" + stringify(*params.package_id()) + "' is not a string set key");
extra_groups = join(k->value()->begin(), k->value()->end(), ",");
if (std::string::npos != extra_groups.find('\''))
- throw InstallActionError("Value for key 'extra_groups' for '" + stringify(*params.package_id()) + "' must not contain a quote");
+ throw ActionFailedError("Value for key 'extra_groups' for '" + stringify(*params.package_id()) + "' must not contain a quote");
if (! extra_groups.empty())
extra_groups = " -G '" + extra_groups + "'";
@@ -168,12 +168,12 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
const MetadataValueKey<std::string> * k(simple_visitor_cast<const MetadataValueKey<std::string> >(**m));
if (! k)
- throw InstallActionError("Key 'shell' for '" + stringify(*params.package_id()) + "' is not a string key");
+ throw ActionFailedError("Key 'shell' for '" + stringify(*params.package_id()) + "' is not a string key");
shell = k->value();
if (std::string::npos != shell.find('\''))
- throw InstallActionError("Value for key 'shell' for '" + stringify(*params.package_id()) + "' must not contain a quote");
+ throw ActionFailedError("Value for key 'shell' for '" + stringify(*params.package_id()) + "' must not contain a quote");
if (! shell.empty())
shell = " -s '" + shell + "'";
@@ -188,12 +188,12 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
const MetadataValueKey<std::string> * k(simple_visitor_cast<const MetadataValueKey<std::string> >(**m));
if (! k)
- throw InstallActionError("Key 'home' for '" + stringify(*params.package_id()) + "' is not a string key");
+ throw ActionFailedError("Key 'home' for '" + stringify(*params.package_id()) + "' is not a string key");
home = k->value();
if (std::string::npos != home.find('\''))
- throw InstallActionError("Value for key 'home' for '" + stringify(*params.package_id()) + "' must not contain a quote");
+ throw ActionFailedError("Value for key 'home' for '" + stringify(*params.package_id()) + "' must not contain a quote");
if (! home.empty())
home = " -d '" + home + "'";
@@ -204,7 +204,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
int exit_status(run_command(cmd));
if (0 != exit_status)
- throw InstallActionError("Install of '" + stringify(*params.package_id()) + "' failed because useradd returned "
+ throw ActionFailedError("Install of '" + stringify(*params.package_id()) + "' failed because useradd returned "
+ stringify(exit_status));
}
@@ -216,16 +216,16 @@ PasswdAccountsHandler::merge_group(const MergeParams & params)
{
PackageID::MetadataConstIterator m(params.package_id()->find_metadata("groupname"));
if (params.package_id()->end_metadata() == m)
- throw InstallActionError("Key 'groupname' for '" + stringify(*params.package_id()) + "' does not exist");
+ throw ActionFailedError("Key 'groupname' for '" + stringify(*params.package_id()) + "' does not exist");
const MetadataValueKey<std::string> * k(simple_visitor_cast<const MetadataValueKey<std::string> >(**m));
if (! k)
- throw InstallActionError("Key 'groupname' for '" + stringify(*params.package_id()) + "' is not a string key");
+ throw ActionFailedError("Key 'groupname' for '" + stringify(*params.package_id()) + "' is not a string key");
groupname = k->value();
if (0 != getgrnam(groupname.c_str()))
- throw InstallActionError("Group '" + groupname + "' already exists");
+ throw ActionFailedError("Group '" + groupname + "' already exists");
} while (false);
std::string preferred_gid;
@@ -237,12 +237,12 @@ PasswdAccountsHandler::merge_group(const MergeParams & params)
const MetadataValueKey<std::string> * k(simple_visitor_cast<const MetadataValueKey<std::string> >(**m));
if (! k)
- throw InstallActionError("Key 'preferred_gid' for '" + stringify(*params.package_id()) + "' is not a string key");
+ throw ActionFailedError("Key 'preferred_gid' for '" + stringify(*params.package_id()) + "' is not a string key");
preferred_gid = k->value();
if (std::string::npos != preferred_gid.find_first_not_of("0123456789"))
- throw InstallActionError("Value for key 'preferred_gid' for '" + stringify(*params.package_id()) + "' must be a number");
+ throw ActionFailedError("Value for key 'preferred_gid' for '" + stringify(*params.package_id()) + "' must be a number");
uid_t gid(destringify<uid_t>(preferred_gid));
if (getgrgid(gid))
@@ -260,7 +260,7 @@ PasswdAccountsHandler::merge_group(const MergeParams & params)
int exit_status(run_command(cmd));
if (0 != exit_status)
- throw InstallActionError("Install of '" + stringify(*params.package_id()) + "' failed because groupadd returned "
+ throw ActionFailedError("Install of '" + stringify(*params.package_id()) + "' failed because groupadd returned "
+ stringify(exit_status));
}
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 884fb22..587f6ed 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -484,7 +484,7 @@ CRANInstalledRepository::merge(const MergeParams & m)
+ "' to repository '" + stringify(name()) + "':");
if (! is_suitable_destination_for(*m.package_id()))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
+ throw ActionFailedError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
}
diff --git a/paludis/repositories/cran/cran_package_id.cc b/paludis/repositories/cran/cran_package_id.cc
index d64527a..296e482 100644
--- a/paludis/repositories/cran/cran_package_id.cc
+++ b/paludis/repositories/cran/cran_package_id.cc
@@ -523,7 +523,7 @@ CRANPackageID::supports_action(const SupportsActionTestBase & b) const
void
CRANPackageID::perform_action(Action & a) const
{
- throw UnsupportedActionError(*this, a);
+ throw ActionFailedError("Unsupported action '" + stringify(a) + "'");
}
const std::tr1::shared_ptr<const MetadataCollectionKey<PackageIDSequence> >
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 33d7393..7d0227c 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -176,7 +176,7 @@ EInstalledRepository::get_environment_variable(
FSEntry ver_dir(id->fs_location_key()->value());
if (! ver_dir.is_directory_or_symlink_to_directory())
- throw ActionError("Could not find Exndbam entry for '" + stringify(*id) + "'");
+ throw ActionFailedError("Could not find Exndbam entry for '" + stringify(*id) + "'");
if ((ver_dir / var).is_regular_file_or_symlink_to_regular_file())
{
@@ -194,11 +194,11 @@ EInstalledRepository::get_environment_variable(
(std::istreambuf_iterator<char>(p)),
std::istreambuf_iterator<char>()), "\n"));
if (0 != exit_status)
- throw ActionError("Could not load environment.bz2");
+ throw ActionFailedError("Could not load environment.bz2");
return result;
}
else
- throw ActionError("Could not get variable '" + var + "' for '" + stringify(*id) + "'");
+ throw ActionFailedError("Could not get variable '" + var + "' for '" + stringify(*id) + "'");
}
void
@@ -209,7 +209,7 @@ EInstalledRepository::perform_config(
Context context("When configuring '" + stringify(*id) + "':");
if (! _imp->params.root().is_directory())
- throw InstallActionError("Couldn't configure '" + stringify(*id) +
+ throw ActionFailedError("Couldn't configure '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
std::tr1::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
@@ -262,7 +262,7 @@ EInstalledRepository::perform_info(
Context context("When infoing '" + stringify(*id) + "':");
if (! _imp->params.root().is_directory())
- throw InstallActionError("Couldn't info '" + stringify(*id) +
+ throw ActionFailedError("Couldn't info '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
std::tr1::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index f395d7f..966a053 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -944,22 +944,22 @@ namespace
void PerformAction::visit(const InstallAction & a)
{
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void PerformAction::visit(const PretendAction & a)
{
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void PerformAction::visit(const FetchAction & a)
{
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void PerformAction::visit(const PretendFetchAction & a)
{
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
}
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index a841fbe..92ac4aa 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -946,6 +946,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
FetchAction action(make_named_values<FetchActionOptions>(
+ value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(false),
value_for<n::fetch_unneeded>(false),
value_for<n::ignore_unfetched>(false),
@@ -1003,7 +1004,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/unfetchable-files",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(unfetchable_files_id);
- TEST_CHECK_THROWS(unfetchable_files_id->perform_action(action), FetchActionError);
+ TEST_CHECK_THROWS(unfetchable_files_id->perform_action(action), ActionFailedError);
}
{
@@ -1027,7 +1028,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/fetchable-files-restricted",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(fetchable_files_restricted_id);
- TEST_CHECK_THROWS(fetchable_files_restricted_id->perform_action(action), FetchActionError);
+ TEST_CHECK_THROWS(fetchable_files_restricted_id->perform_action(action), ActionFailedError);
}
}
} test_e_repository_fetch;
@@ -1052,6 +1053,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
FetchAction action(make_named_values<FetchActionOptions>(
+ value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(false),
value_for<n::fetch_unneeded>(false),
value_for<n::ignore_unfetched>(false),
@@ -1148,7 +1150,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/in-ebuild-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1157,7 +1159,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/in-subshell-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1175,7 +1177,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/unpack-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1184,7 +1186,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/econf-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1202,7 +1204,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/emake-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1211,7 +1213,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/einstall-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1220,7 +1222,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/keepdir-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1238,7 +1240,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/dobin-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1256,7 +1258,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/fperms-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1266,7 +1268,7 @@ namespace test_cases
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "0");
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1523,7 +1525,7 @@ namespace test_cases
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1533,7 +1535,7 @@ namespace test_cases
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1695,7 +1697,7 @@ namespace test_cases
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1725,7 +1727,7 @@ namespace test_cases
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1811,7 +1813,7 @@ namespace test_cases
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1840,7 +1842,7 @@ namespace test_cases
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -1933,7 +1935,7 @@ namespace test_cases
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
- TEST_CHECK_THROWS(id->perform_action(action), InfoActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
}
} test_e_repository_info_eapi_kdebuild_1;
@@ -2007,7 +2009,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/in-ebuild-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2016,7 +2018,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/in-subshell-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2052,7 +2054,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/expatch-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2079,7 +2081,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-expatch-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2088,7 +2090,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/unpack-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2106,7 +2108,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-unpack-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2115,7 +2117,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/econf-fail",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2133,7 +2135,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-econf-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2142,7 +2144,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/emake-fail",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2160,7 +2162,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-emake-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2169,7 +2171,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/einstall-fail",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2187,7 +2189,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-einstall-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2205,7 +2207,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/keepdir-fail",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2223,7 +2225,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-keepdir-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2241,7 +2243,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/dobin-fail",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2268,7 +2270,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-dobin-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2286,7 +2288,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/herebin-fail",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2304,7 +2306,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/hereconfd-fail",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2322,7 +2324,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/hereenvd-fail",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2340,7 +2342,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/hereinitd-fail",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2358,7 +2360,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/hereins-fail",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2376,7 +2378,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/heresbin-fail",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2394,7 +2396,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/fperms-fail",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2421,7 +2423,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-fperms-die",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2448,7 +2450,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("=cat/match-0",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2457,7 +2459,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-phase-0",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2502,7 +2504,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("=cat/doman-failure-0",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2511,7 +2513,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("=cat/change-globals-0",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
{
@@ -2529,7 +2531,7 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("=cat/install-s-0",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
}
} test_e_repository_install_exheres_0;
diff --git a/paludis/repositories/e/e_repository_TEST_exlibs.cc b/paludis/repositories/e/e_repository_TEST_exlibs.cc
index 1caa4db..41eb9a0 100644
--- a/paludis/repositories/e/e_repository_TEST_exlibs.cc
+++ b/paludis/repositories/e/e_repository_TEST_exlibs.cc
@@ -91,7 +91,7 @@ namespace
enum ExpectedResult
{
success,
- throws_UnsupportedActionError,
+ unsupported,
throws_InstallActionError
};
@@ -154,13 +154,15 @@ namespace
switch (expected_result)
{
case success:
+ TEST_CHECK(id->supports_action(SupportsActionTest<InstallAction>()));
id->perform_action(action);
break;
case throws_InstallActionError:
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK(id->supports_action(SupportsActionTest<InstallAction>()));
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
break;
- case throws_UnsupportedActionError:
- TEST_CHECK_THROWS(id->perform_action(action), UnsupportedActionError);
+ case unsupported:
+ TEST_CHECK(! id->supports_action(SupportsActionTest<InstallAction>()));
break;
}
}
@@ -170,18 +172,18 @@ namespace
namespace test_cases
{
ExlibsTest test_require_success("require-success", success);
- ExlibsTest test_require_fail("require-fail", throws_UnsupportedActionError);
+ ExlibsTest test_require_fail("require-fail", unsupported);
ExlibsTest test_require_param("require-param", success);
ExlibsTest test_require_param_empty("require-param-empty", success);
- ExlibsTest test_require_param_missing("require-param-missing", throws_UnsupportedActionError);
- ExlibsTest test_require_param_undeclared("require-param-undeclared", throws_UnsupportedActionError);
+ ExlibsTest test_require_param_missing("require-param-missing", unsupported);
+ ExlibsTest test_require_param_undeclared("require-param-undeclared", unsupported);
ExlibsTest test_require_params("require-params", success);
- ExlibsTest test_require_params_unaligned("require-params-unaligned", throws_UnsupportedActionError);
+ ExlibsTest test_require_params_unaligned("require-params-unaligned", unsupported);
ExlibsTest test_require_multiple_params("require-multiple-params", success);
ExlibsTest test_require_multiple_params_spaces("require-multiple-params-spaces", success);
ExlibsTest test_require_param_default("require-param-default", success);
ExlibsTest test_require_param_default_spaces("require-multiple-params-default-spaces", success);
- ExlibsTest test_exparam_banned("exparam-banned", throws_UnsupportedActionError);
+ ExlibsTest test_exparam_banned("exparam-banned", unsupported);
ExlibsTest test_exparam_undeclared("exparam-undeclared", throws_InstallActionError);
ExlibsTest test_exparam_subshell("exparam-subshell", throws_InstallActionError); // cookies to he who finds a way to make this test succeed :(
ExlibsTest test_exarray("exarray", success);
@@ -190,10 +192,10 @@ namespace test_cases
ExlibsTest test_exarray_default_spaces("exarray-default-spaces", success);
ExlibsTest test_exarray_empty("exarray-empty", success);
ExlibsTest test_noarray("noarray", success);
- ExlibsTest test_noarray_bad("noarray-bad", throws_UnsupportedActionError);
- ExlibsTest test_scalar_required("scalar-required", throws_UnsupportedActionError);
- ExlibsTest test_array_required("array-required", throws_UnsupportedActionError);
- ExlibsTest test_illegal_in_global_scope("illegal-in-global-scope", throws_UnsupportedActionError);
+ ExlibsTest test_noarray_bad("noarray-bad", unsupported);
+ ExlibsTest test_scalar_required("scalar-required", unsupported);
+ ExlibsTest test_array_required("array-required", unsupported);
+ ExlibsTest test_illegal_in_global_scope("illegal-in-global-scope", unsupported);
ExlibsTest test_illegal_in_global_scope_in_func("illegal-in-global-scope-in-func", success);
ExlibsTest test_called_cross_phase("called-cross-phase", throws_InstallActionError);
ExlibsTest test_called_cross_phase_default("called-cross-phase-default", throws_InstallActionError);
@@ -201,12 +203,12 @@ namespace test_cases
ExlibsTest test_called_cross_phase_exlib("called-cross-phase-exlib", throws_InstallActionError);
ExlibsTest test_called_cross_phase_exlib_exported("called-cross-phase-exlib-exported", throws_InstallActionError);
ExlibsTest test_boolean("boolean", success);
- ExlibsTest test_boolean_badvalue("boolean-badvalue", throws_UnsupportedActionError);
- ExlibsTest test_boolean_blankvalue("boolean-blankvalue", throws_UnsupportedActionError);
- ExlibsTest test_boolean_badvaluewithdefault("boolean-badvaluewithdefault", throws_UnsupportedActionError);
- ExlibsTest test_boolean_baddefault("boolean-baddefault", throws_UnsupportedActionError);
- ExlibsTest test_boolean_blankdefault("boolean-blankdefault", throws_UnsupportedActionError);
- ExlibsTest test_boolean_nodefault("boolean-nodefault", throws_UnsupportedActionError);
- ExlibsTest test_boolean_notreally("boolean-notreally", throws_UnsupportedActionError);
+ ExlibsTest test_boolean_badvalue("boolean-badvalue", unsupported);
+ ExlibsTest test_boolean_blankvalue("boolean-blankvalue", unsupported);
+ ExlibsTest test_boolean_badvaluewithdefault("boolean-badvaluewithdefault", unsupported);
+ ExlibsTest test_boolean_baddefault("boolean-baddefault", unsupported);
+ ExlibsTest test_boolean_blankdefault("boolean-blankdefault", unsupported);
+ ExlibsTest test_boolean_nodefault("boolean-nodefault", unsupported);
+ ExlibsTest test_boolean_notreally("boolean-notreally", unsupported);
}
diff --git a/paludis/repositories/e/e_repository_TEST_phases.cc b/paludis/repositories/e/e_repository_TEST_phases.cc
index 3c1e252..4b2d93d 100644
--- a/paludis/repositories/e/e_repository_TEST_phases.cc
+++ b/paludis/repositories/e/e_repository_TEST_phases.cc
@@ -173,7 +173,7 @@ namespace
if (expect_pass)
id->perform_action(action);
else
- TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
};
}
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index c586c67..ef6e020 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -139,7 +139,7 @@ EbuildCommand::operator() ()
{
if (0 == params.environment()->reduced_uid() || 0 == params.environment()->reduced_gid())
if (getenv_with_default("PALUDIS_BYPASS_USERPRIV_CHECKS", "").empty())
- throw ActionError("Need to be able to use non-0 user and group for userpriv for '" +
+ throw ActionFailedError("Need to be able to use non-0 user and group for userpriv for '" +
stringify(*params.package_id()) + "'");
}
cmd.with_uid_gid(params.environment()->reduced_uid(), params.environment()->reduced_gid());
@@ -725,7 +725,7 @@ EbuildNoFetchCommand::commands() const
bool
EbuildNoFetchCommand::failure()
{
- throw FetchActionError("Fetch failed for '" + stringify(*params.package_id()) + "'");
+ throw ActionFailedError("Fetch failed for '" + stringify(*params.package_id()) + "'");
}
Command
@@ -779,7 +779,7 @@ EbuildInstallCommand::commands() const
bool
EbuildInstallCommand::failure()
{
- throw InstallActionError("Install failed for '" + stringify(*params.package_id()) + "'");
+ throw ActionFailedError("Install failed for '" + stringify(*params.package_id()) + "'");
}
Command
@@ -864,7 +864,7 @@ EbuildUninstallCommand::ebuild_file() const
bool
EbuildUninstallCommand::failure()
{
- throw UninstallActionError("Uninstall failed for '" + stringify(*params.package_id()) + "'");
+ throw ActionFailedError("Uninstall failed for '" + stringify(*params.package_id()) + "'");
}
Command
@@ -915,7 +915,7 @@ EbuildConfigCommand::commands() const
bool
EbuildConfigCommand::failure()
{
- throw ConfigActionError("Configure failed for '" + stringify(*params.package_id()) + "'");
+ throw ActionFailedError("Configure failed for '" + stringify(*params.package_id()) + "'");
}
Command
@@ -1011,7 +1011,7 @@ WriteVDBEntryCommand::operator() ()
params.package_id()->defined_phases_key()->value()->end(), " "));
if (0 != (run_command(cmd)))
- throw InstallActionError("Write VDB Entry command failed");
+ throw ActionFailedError("Write VDB Entry command failed");
}
VDBPostMergeCommand::VDBPostMergeCommand(const VDBPostMergeCommandParams & p) :
@@ -1029,7 +1029,7 @@ VDBPostMergeCommand::operator() ()
"/utils/wrapped_ldconfig '" + stringify(params.root()) + "'");
if (0 != (run_command(cmd)))
- throw InstallActionError("VDB Entry post merge commands failed");
+ throw ActionFailedError("VDB Entry post merge commands failed");
}
std::string
@@ -1104,7 +1104,7 @@ EbuildInfoCommand::commands() const
bool
EbuildInfoCommand::failure()
{
- throw InfoActionError("Info command failed");
+ throw ActionFailedError("Info command failed");
}
Command
@@ -1167,7 +1167,7 @@ WriteBinaryEbuildCommand::operator() ()
using namespace std::tr1::placeholders;
if (! EAPIData::get_instance()->eapi_from_string("pbin-1+" + params.package_id()->eapi()->exported_name())->supported())
- throw InstallActionError("Don't know how to write binary ebuilds using EAPI 'pbin-1+" +
+ throw ActionFailedError("Don't know how to write binary ebuilds using EAPI 'pbin-1+" +
params.package_id()->eapi()->exported_name());
std::string bindistfile(stringify(params.destination_repository()->name()) + "--" + stringify(params.package_id()->name().category())
@@ -1225,7 +1225,7 @@ WriteBinaryEbuildCommand::operator() ()
);
if (0 != (run_command(cmd)))
- throw InstallActionError("Write binary command failed");
+ throw ActionFailedError("Write binary command failed");
}
std::string
@@ -1288,7 +1288,7 @@ EbuildFetchExtraCommand::commands() const
bool
EbuildFetchExtraCommand::failure()
{
- throw InstallActionError("Extra fetch failed for '" + stringify(*params.package_id()) + "'");
+ throw ActionFailedError("Extra fetch failed for '" + stringify(*params.package_id()) + "'");
}
Command
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index 83b724e..d186412 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -519,8 +519,7 @@ EbuildEntries::fetch(const std::tr1::shared_ptr<const ERepositoryID> & id,
));
if (! fetch_extra_cmd())
- throw FetchActionError("Fetch of '" + stringify(*id) + "' failed", make_shared_ptr(
- new Sequence<FetchActionFailure>));
+ throw ActionFailedError("Fetch of '" + stringify(*id) + "' failed");
}
}
@@ -565,13 +564,21 @@ EbuildEntries::fetch(const std::tr1::shared_ptr<const ERepositoryID> & id,
));
if (! nofetch_cmd())
- throw FetchActionError("Fetch of '" + stringify(*id) + "' failed", c.failures());
+ {
+ std::copy(c.failures()->begin(), c.failures()->end(),
+ fetch_action.options.errors()->back_inserter());
+ throw ActionFailedError("Fetch of '" + stringify(*id) + "' failed");
+ }
}
}
}
if (! c.failures()->empty())
- throw FetchActionError("Fetch of '" + stringify(*id) + "' failed", c.failures());
+ {
+ std::copy(c.failures()->begin(), c.failures()->end(),
+ fetch_action.options.errors()->back_inserter());
+ throw ActionFailedError("Fetch of '" + stringify(*id) + "' failed");
+ }
output_manager->succeeded();
}
@@ -746,7 +753,7 @@ EbuildEntries::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
continue;
case wp_abort:
- throw InstallActionError("Told to abort install");
+ throw ActionAbortedError("Told to abort install");
case last_wp:
break;
@@ -767,7 +774,7 @@ EbuildEntries::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
if (phase->option("merge"))
{
if (! (*install_action.options.destination()).destination_interface())
- throw InstallActionError("Can't install '" + stringify(*id)
+ throw ActionFailedError("Can't install '" + stringify(*id)
+ "' to destination '" + stringify(install_action.options.destination()->name())
+ "' because destination does not provide destination_interface");
@@ -1058,7 +1065,8 @@ EbuildEntries::get_environment_variable(
var);
if (! cmd())
- throw ActionError("Couldn't get environment variable '" + stringify(var) + "' for package '" + stringify(*id) + "'");
+ throw ActionFailedError("Couldn't get environment variable '" + stringify(var) +
+ "' for package '" + stringify(*id) + "'");
return cmd.result();
}
@@ -1077,7 +1085,7 @@ EbuildEntries::merge(const MergeParams & m)
+ "' to E repository '" + stringify(_imp->e_repository->name()) + "':");
if (! _imp->e_repository->is_suitable_destination_for(*m.package_id()))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
+ throw ActionFailedError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
FSEntry binary_ebuild_location(_imp->e_repository->layout()->binary_ebuild_location(
m.package_id()->name(), m.package_id()->version(),
@@ -1224,7 +1232,7 @@ EbuildEntries::pretend(
));
if (! bad_options_cmd())
- throw ActionError("Bad options phase died");
+ throw ActionFailedError("Bad options phase died");
}
result = false;
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index dd238aa..f75d5d9 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1171,12 +1171,12 @@ namespace
void PerformAction::visit(UninstallAction & a)
{
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void PerformAction::visit(ConfigAction & a)
{
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
}
@@ -1184,7 +1184,7 @@ void
EbuildID::perform_action(Action & a) const
{
if (! eapi()->supported())
- throw UnsupportedActionError(*this, a);
+ throw ActionFailedError("Unsupported EAPI");
PerformAction b(shared_from_this());
a.accept(b);
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 34a18c7..382e7dc 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -327,7 +327,7 @@ ExndbamRepository::merge(const MergeParams & m)
+ "' to Exndbam repository '" + stringify(name()) + "':");
if (! is_suitable_destination_for(*m.package_id()))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
+ throw ActionFailedError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
std::tr1::shared_ptr<const PackageID> if_overwritten_id, if_same_name_id;
{
@@ -360,7 +360,7 @@ ExndbamRepository::merge(const MergeParams & m)
target_ver_dir /= (stringify(m.package_id()->version()) + ":" + stringify(m.package_id()->slot_key()->value()) + ":" + cookie());
if (target_ver_dir.exists())
- throw InstallActionError("Temporary merge directory '" + stringify(target_ver_dir) + "' already exists, probably "
+ throw ActionFailedError("Temporary merge directory '" + stringify(target_ver_dir) + "' already exists, probably "
"due to a previous failed install. If it is safe to do so, please remove this directory and try again.");
target_ver_dir.mkdir();
@@ -420,7 +420,7 @@ ExndbamRepository::merge(const MergeParams & m)
; d != d_end ; ++d)
FSEntry(*d).unlink();
target_ver_dir.rmdir();
- throw InstallActionError("Not proceeding with install due to merge sanity check failing");
+ throw ActionFailedError("Not proceeding with install due to merge sanity check failing");
}
merger.merge();
@@ -477,7 +477,7 @@ ExndbamRepository::perform_uninstall(
Context context("When uninstalling '" + stringify(*id) + (a.options.is_overwrite() ? "' for an overwrite:" : "':"));
if (! _imp->params.root().is_directory())
- throw InstallActionError("Couldn't uninstall '" + stringify(*id) +
+ throw ActionFailedError("Couldn't uninstall '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
std::tr1::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
diff --git a/paludis/repositories/e/fetch_visitor.cc b/paludis/repositories/e/fetch_visitor.cc
index 0cb5c8d..8aeec28 100644
--- a/paludis/repositories/e/fetch_visitor.cc
+++ b/paludis/repositories/e/fetch_visitor.cc
@@ -148,7 +148,7 @@ FetchVisitor::visit(const FetchableURISpecTree::NodeType<FetchableURIDepSpec>::T
Context context("When visiting URI dep spec '" + stringify(node.spec()->text()) + "':");
if (! *_imp->labels.begin())
- throw FetchActionError("No fetch action label available");
+ throw ActionFailedError("No fetch action label available");
SourceURIFinder source_uri_finder(_imp->env, _imp->id->repository().get(),
node.spec()->original_url(), node.spec()->filename(), _imp->mirrors_name);
diff --git a/paludis/repositories/e/manifest2_reader.cc b/paludis/repositories/e/manifest2_reader.cc
index 10e7017..d791003 100644
--- a/paludis/repositories/e/manifest2_reader.cc
+++ b/paludis/repositories/e/manifest2_reader.cc
@@ -54,7 +54,7 @@ namespace paludis
}
Manifest2Error::Manifest2Error(const std::string & msg) throw () :
- ActionError("Manifest2 Error: " + msg)
+ Exception("Manifest2 Error: " + msg)
{
}
diff --git a/paludis/repositories/e/manifest2_reader.hh b/paludis/repositories/e/manifest2_reader.hh
index 621e0d3..239326b 100644
--- a/paludis/repositories/e/manifest2_reader.hh
+++ b/paludis/repositories/e/manifest2_reader.hh
@@ -65,7 +65,7 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE Manifest2Error :
- public ActionError
+ public Exception
{
public:
Manifest2Error(const std::string & msg) throw ();
diff --git a/paludis/repositories/e/source_uri_finder.cc b/paludis/repositories/e/source_uri_finder.cc
index 283171f..086ef97 100644
--- a/paludis/repositories/e/source_uri_finder.cc
+++ b/paludis/repositories/e/source_uri_finder.cc
@@ -182,7 +182,7 @@ SourceURIFinder::add_listed()
std::string mirror(_imp->url.substr(9));
std::string::size_type p(mirror.find("/"));
if (std::string::npos == p)
- throw FetchActionError("Broken URI component '" + _imp->url + "'");
+ throw ActionFailedError("Broken URI component '" + _imp->url + "'");
std::string original_name(mirror.substr(p + 1));
mirror.erase(p);
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index ee0a1bd..2cca557 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -398,7 +398,7 @@ VDBRepository::perform_uninstall(
Context context("When uninstalling '" + stringify(*id) + (a.options.is_overwrite() ? "' for an overwrite:" : "':"));
if (! _imp->params.root().is_directory())
- throw InstallActionError("Couldn't uninstall '" + stringify(*id) +
+ throw ActionFailedError("Couldn't uninstall '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
std::tr1::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
@@ -859,7 +859,7 @@ VDBRepository::merge(const MergeParams & m)
+ "' to VDB repository '" + stringify(name()) + "':");
if (! is_suitable_destination_for(*m.package_id()))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
+ throw ActionFailedError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
std::tr1::shared_ptr<const ERepositoryID> is_replace(package_id_if_exists(m.package_id()->name(), m.package_id()->version()));
@@ -927,7 +927,7 @@ VDBRepository::merge(const MergeParams & m)
for (DirIterator d(tmp_vdb_dir, DirIteratorOptions() + dio_include_dotfiles), d_end ; d != d_end ; ++d)
FSEntry(*d).unlink();
tmp_vdb_dir.rmdir();
- throw InstallActionError("Not proceeding with install due to merge sanity check failing");
+ throw ActionFailedError("Not proceeding with install due to merge sanity check failing");
}
if (is_replace)
@@ -940,7 +940,7 @@ VDBRepository::merge(const MergeParams & m)
old_vdb_dir /= (stringify(is_replace->name().package()) + "-" + stringify(is_replace->version()));
if ((old_vdb_dir.dirname() / ("-reinstalling-" + old_vdb_dir.basename())).exists())
- throw InstallActionError("Directory '" + stringify(old_vdb_dir.dirname() /
+ throw ActionFailedError("Directory '" + stringify(old_vdb_dir.dirname() /
("-reinstalling-" + old_vdb_dir.basename())) + "' already exists, probably due to "
"a previous failed upgrade. If it is safe to do so, remove this directory and try "
"again.");
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 74b4098..19be96b 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -1118,49 +1118,49 @@ namespace
{
SupportsActionTest<InstallAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(const UninstallAction & a)
{
SupportsActionTest<UninstallAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(const FetchAction & a)
{
SupportsActionTest<FetchAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(const ConfigAction & a)
{
SupportsActionTest<ConfigAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(const InfoAction & a)
{
SupportsActionTest<InfoAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(const PretendAction & a)
{
SupportsActionTest<PretendAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(const PretendFetchAction & a)
{
SupportsActionTest<PretendFetchAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
};
}
diff --git a/paludis/repositories/gems/gem_specification.cc b/paludis/repositories/gems/gem_specification.cc
index 526dc22..a05d457 100644
--- a/paludis/repositories/gems/gem_specification.cc
+++ b/paludis/repositories/gems/gem_specification.cc
@@ -527,49 +527,49 @@ namespace
{
SupportsActionTest<InstallAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action '" + stringify(a) + "'");
}
void visit(const UninstallAction & a)
{
SupportsActionTest<UninstallAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action '" + stringify(a) + "'");
}
void visit(const ConfigAction & a)
{
SupportsActionTest<ConfigAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action '" + stringify(a) + "'");
}
void visit(const FetchAction & a)
{
SupportsActionTest<FetchAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action '" + stringify(a) + "'");
}
void visit(const InfoAction & a)
{
SupportsActionTest<InfoAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action '" + stringify(a) + "'");
}
void visit(const PretendAction & a)
{
SupportsActionTest<PretendAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action '" + stringify(a) + "'");
}
void visit(const PretendFetchAction & a)
{
SupportsActionTest<PretendFetchAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action '" + stringify(a) + "'");
}
};
}
diff --git a/paludis/repositories/unavailable/unavailable_id.cc b/paludis/repositories/unavailable/unavailable_id.cc
index b9aa2a5..e0cdfe9 100644
--- a/paludis/repositories/unavailable/unavailable_id.cc
+++ b/paludis/repositories/unavailable/unavailable_id.cc
@@ -162,7 +162,7 @@ UnavailableID::supports_action(const SupportsActionTestBase & a) const
void
UnavailableID::perform_action(Action & a) const
{
- throw UnsupportedActionError(*this, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
std::tr1::shared_ptr<const Set<std::string> >
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index 7a821ad..f08f2f4 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -740,32 +740,32 @@ namespace
void visit(InstallAction & a) PALUDIS_ATTRIBUTE((noreturn))
{
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(FetchAction & a) PALUDIS_ATTRIBUTE((noreturn))
{
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(ConfigAction & a) PALUDIS_ATTRIBUTE((noreturn))
{
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(PretendAction & a) PALUDIS_ATTRIBUTE((noreturn))
{
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(PretendFetchAction & a) PALUDIS_ATTRIBUTE((noreturn))
{
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(InfoAction & a) PALUDIS_ATTRIBUTE((noreturn))
{
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(UninstallAction & a)
@@ -845,7 +845,7 @@ InstalledUnpackagedID::uninstall(const bool replace,
}
if (! _imp->root.is_directory())
- throw InstallActionError("Couldn't uninstall '" + stringify(*this) +
+ throw ActionFailedError("Couldn't uninstall '" + stringify(*this) +
"' because root ('" + stringify(_imp->root) + "') is not a directory");
FSEntry ver_dir(fs_location_key()->value());
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 0935090..ca0e0ca 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -260,16 +260,16 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
+ "' to InstalledUnpackagedRepository repository '" + stringify(name()) + "':");
if (! is_suitable_destination_for(*m.package_id()))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
+ throw ActionFailedError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
FSEntry install_under("/");
{
Repository::MetadataConstIterator k(m.package_id()->repository()->find_metadata("install_under"));
if (k == m.package_id()->repository()->end_metadata())
- throw InstallActionError("Could not fetch install_under key from owning repository");
+ throw ActionFailedError("Could not fetch install_under key from owning repository");
const MetadataValueKey<FSEntry> * kk(simple_visitor_cast<const MetadataValueKey<FSEntry> >(**k));
if (! kk)
- throw InstallActionError("Fetched install_under key but did not get an FSEntry key from owning repository");
+ throw ActionFailedError("Fetched install_under key but did not get an FSEntry key from owning repository");
install_under = kk->value();
}
@@ -277,10 +277,10 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
{
Repository::MetadataConstIterator k(m.package_id()->repository()->find_metadata("rewrite_ids_over_to_root"));
if (k == m.package_id()->repository()->end_metadata())
- throw InstallActionError("Could not fetch rewrite_ids_over_to_root key from owning repository");
+ throw ActionFailedError("Could not fetch rewrite_ids_over_to_root key from owning repository");
const MetadataValueKey<long> * kk(simple_visitor_cast<const MetadataValueKey<long> >(**k));
if (! kk)
- throw InstallActionError("Fetched rewrite_ids_over_to_root key but did not get a long key from owning repository");
+ throw ActionFailedError("Fetched rewrite_ids_over_to_root key but did not get a long key from owning repository");
rewrite_ids_over_to_root = kk->value();
}
@@ -315,7 +315,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
target_ver_dir /= (stringify(m.package_id()->version()) + ":" + stringify(m.package_id()->slot_key()->value()) + ":" + cookie());
if (target_ver_dir.exists())
- throw InstallActionError("Temporary merge directory '" + stringify(target_ver_dir) + "' already exists, probably "
+ throw ActionFailedError("Temporary merge directory '" + stringify(target_ver_dir) + "' already exists, probably "
"due to a previous failed install. If it is safe to do so, please remove this directory and try again.");
target_ver_dir.mkdir();
@@ -365,7 +365,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
for (DirIterator d(target_ver_dir, DirIteratorOptions() + dio_include_dotfiles), d_end ; d != d_end ; ++d)
FSEntry(*d).unlink();
target_ver_dir.rmdir();
- throw InstallActionError("Not proceeding with install due to merge sanity check failing");
+ throw ActionFailedError("Not proceeding with install due to merge sanity check failing");
}
merger.merge();
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index ca782bf..6be8da0 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -335,10 +335,10 @@ UnpackagedID::perform_action(Action & action) const
{
const InstallAction * const install_action(simple_visitor_cast<const InstallAction>(action));
if (! install_action)
- throw UnsupportedActionError(*this, action);
+ throw ActionFailedError("Unsupported action: " + stringify(action));
if (! (*install_action->options.destination()).destination_interface())
- throw InstallActionError("Can't install '" + stringify(*this)
+ throw ActionFailedError("Can't install '" + stringify(*this)
+ "' to destination '" + stringify(install_action->options.destination()->name())
+ "' because destination does not provide destination_interface");
@@ -384,7 +384,7 @@ UnpackagedID::perform_action(Action & action) const
break;
case wp_abort:
- throw InstallActionError("Told to abort install");
+ throw ActionAbortedError("Told to abort install");
case last_wp:
throw InternalError(PALUDIS_HERE, "bad WantPhase");
@@ -413,7 +413,7 @@ UnpackagedID::perform_action(Action & action) const
break;
case wp_abort:
- throw InstallActionError("Told to abort install");
+ throw ActionAbortedError("Told to abort install");
case last_wp:
throw InternalError(PALUDIS_HERE, "bad WantPhase");
diff --git a/paludis/repositories/unwritten/unwritten_id.cc b/paludis/repositories/unwritten/unwritten_id.cc
index de0b274..360ace9 100644
--- a/paludis/repositories/unwritten/unwritten_id.cc
+++ b/paludis/repositories/unwritten/unwritten_id.cc
@@ -168,7 +168,7 @@ UnwrittenID::supports_action(const SupportsActionTestBase & a) const
void
UnwrittenID::perform_action(Action & a) const
{
- throw UnsupportedActionError(*this, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
std::tr1::shared_ptr<const Set<std::string> >
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index adab544..722bf7c 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -389,49 +389,49 @@ namespace
{
SupportsActionTest<InstallAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(const UninstallAction & a)
{
SupportsActionTest<UninstallAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(const ConfigAction & a)
{
SupportsActionTest<ConfigAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(const FetchAction & a)
{
SupportsActionTest<FetchAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(const InfoAction & a)
{
SupportsActionTest<InfoAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(const PretendAction & a)
{
SupportsActionTest<PretendAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
void visit(const PretendFetchAction & a)
{
SupportsActionTest<PretendFetchAction> t;
if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
+ throw ActionFailedError("Unsupported action: " + stringify(a));
}
};
}
diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc
index be5fb60..d0bcfe3 100644
--- a/paludis/uninstall_task.cc
+++ b/paludis/uninstall_task.cc
@@ -349,7 +349,7 @@ UninstallTask::execute()
if (0 !=
_imp->env->perform_hook(Hook("uninstall_all_pre")("TARGETS", join(_imp->raw_targets.begin(),
_imp->raw_targets.end(), " "))).max_exit_status())
- throw UninstallActionError("Uninstall aborted by hook");
+ throw ActionAbortedError("Uninstall aborted by hook");
on_uninstall_all_pre();
int x(0), y(0);
@@ -368,7 +368,7 @@ UninstallTask::execute()
if (0 !=
_imp->env->perform_hook(Hook("uninstall_pre")("TARGET", cpvr)
("X_OF_Y", stringify(x) + " of " + stringify(y))).max_exit_status())
- throw UninstallActionError("Uninstall of '" + cpvr + "' aborted by hook");
+ throw ActionAbortedError("Uninstall of '" + cpvr + "' aborted by hook");
on_uninstall_pre(*i);
try
@@ -387,7 +387,7 @@ UninstallTask::execute()
if (output_manager_holder.output_manager_if_constructed())
output_manager_holder.output_manager_if_constructed()->succeeded();
}
- catch (const UninstallActionError & e)
+ catch (const ActionFailedError & e)
{
HookResult PALUDIS_ATTRIBUTE((unused)) dummy(_imp->env->perform_hook(Hook("uninstall_fail")("TARGET", cpvr)("MESSAGE", e.message())));
throw;
@@ -397,14 +397,14 @@ UninstallTask::execute()
if (0 !=
_imp->env->perform_hook(Hook("uninstall_post")("TARGET", cpvr)
("X_OF_Y", stringify(x) + " of " + stringify(y))).max_exit_status())
- throw UninstallActionError("Uninstall of '" + cpvr + "' aborted by hook");
+ throw ActionAbortedError("Uninstall of '" + cpvr + "' aborted by hook");
}
on_uninstall_all_post();
if (0 !=
_imp->env->perform_hook(Hook("uninstall_all_post")("TARGETS", join(_imp->raw_targets.begin(),
_imp->raw_targets.end(), " "))).max_exit_status())
- throw UninstallActionError("Uninstall aborted by hook");
+ throw ActionAbortedError("Uninstall aborted by hook");
}
void
diff --git a/python/action.cc b/python/action.cc
index dd30255..c3b4255 100644
--- a/python/action.cc
+++ b/python/action.cc
@@ -124,6 +124,7 @@ namespace
)
{
return new FetchActionOptions(make_named_values<FetchActionOptions>(
+ value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(exclude_unmirrorable),
value_for<n::fetch_unneeded>(fetch_unneeded),
value_for<n::ignore_unfetched>(false),
@@ -139,24 +140,12 @@ void expose_action()
/**
* Exceptions
*/
- ExceptionRegister::get_instance()->add_exception<ActionError>
- ("ActionError", "BaseException",
- "Parent class for action errors.");
- ExceptionRegister::get_instance()->add_exception<UnsupportedActionError>
- ("UnsupportedActionError", "ActionError",
- "Thrown if a PackageID is asked to perform an Action that it does not support.");
- ExceptionRegister::get_instance()->add_exception<InstallActionError>
- ("InstallActionError", "ActionError",
- "Thrown if an install fails.");
- ExceptionRegister::get_instance()->add_exception<FetchActionError>
- ("FetchActionError", "ActionError",
- "Thrown if a fetch fails.");
- ExceptionRegister::get_instance()->add_exception<UninstallActionError>
- ("UninstallActionError", "ActionError",
- "Thrown if an uninstall fails.");
- ExceptionRegister::get_instance()->add_exception<ConfigActionError>
- ("ConfigActionError", "ActionError",
- "Thrown if a configure fails.");
+ ExceptionRegister::get_instance()->add_exception<ActionFailedError>
+ ("ActionFailedError", "BaseException",
+ "Thrown if an action fails.");
+ ExceptionRegister::get_instance()->add_exception<ActionAbortedError>
+ ("ActionAbortedError", "BaseException",
+ "Thrown if an action is aborted.");
/**
* InstallActionOptions
diff --git a/ruby/action.cc b/ruby/action.cc
index dc51d55..8f1dbed 100644
--- a/ruby/action.cc
+++ b/ruby/action.cc
@@ -249,6 +249,7 @@ namespace
}
ptr = new FetchActionOptions(make_named_values<FetchActionOptions>(
+ value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(v_exclude_unmirrorable),
value_for<n::fetch_unneeded>(v_fetch_unneeded),
value_for<n::ignore_unfetched>(false),
diff --git a/ruby/paludis_ruby.cc b/ruby/paludis_ruby.cc
index 288d07b..0301fa4 100644
--- a/ruby/paludis_ruby.cc
+++ b/ruby/paludis_ruby.cc
@@ -65,12 +65,8 @@ namespace
static VALUE c_additional_requirements_not_met_error;
static VALUE c_downgrade_not_allowed_error;
static VALUE c_no_destination_error;
- static VALUE c_fetch_action_error;
- static VALUE c_info_action_error;
- static VALUE c_config_action_error;
- static VALUE c_install_action_error;
- static VALUE c_uninstall_action_error;
- static VALUE c_action_error;
+ static VALUE c_action_failed_error;
+ static VALUE c_action_aborted_error;
static VALUE c_bad_version_operator_error;
static VALUE c_got_a_set_not_a_package_dep_spec;
@@ -236,28 +232,10 @@ void paludis::ruby::exception_to_ruby_exception(const std::exception & ee)
rb_raise(c_config_file_error, dynamic_cast<const paludis::ConfigFileError *>(&ee)->message().c_str());
else if (0 != dynamic_cast<const paludis::ConfigurationError *>(&ee))
rb_raise(c_configuration_error, dynamic_cast<const paludis::ConfigurationError *>(&ee)->message().c_str());
- else if (0 != dynamic_cast<const paludis::FetchActionError *>(&ee))
- {
- VALUE ex_args[2];
- ex_args[0] = rb_str_new2(dynamic_cast<const paludis::FetchActionError *>(&ee)->message().c_str());
- ex_args[1] = rb_ary_new();
- const FetchActionError * e = dynamic_cast<const paludis::FetchActionError *>(&ee);
- for (Sequence<FetchActionFailure>::ConstIterator f(e->failures()->begin()), f_end(e->failures()->end()) ;
- f != f_end ; ++f)
- rb_ary_unshift(ex_args[1], fetch_action_failure_to_value(*f));
- rb_exc_raise(rb_class_new_instance(2, ex_args, c_fetch_action_error));
-
- }
- else if (0 != dynamic_cast<const paludis::InfoActionError *>(&ee))
- rb_raise(c_info_action_error, dynamic_cast<const paludis::InfoActionError *>(&ee)->message().c_str());
- else if (0 != dynamic_cast<const paludis::ConfigActionError *>(&ee))
- rb_raise(c_config_action_error, dynamic_cast<const paludis::ConfigActionError *>(&ee)->message().c_str());
- else if (0 != dynamic_cast<const paludis::InstallActionError *>(&ee))
- rb_raise(c_install_action_error, dynamic_cast<const paludis::InstallActionError *>(&ee)->message().c_str());
- else if (0 != dynamic_cast<const paludis::UninstallActionError *>(&ee))
- rb_raise(c_uninstall_action_error, dynamic_cast<const paludis::UninstallActionError *>(&ee)->message().c_str());
- else if (0 != dynamic_cast<const paludis::ActionError *>(&ee))
- rb_raise(c_action_error, dynamic_cast<const paludis::ActionError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::ActionFailedError *>(&ee))
+ rb_raise(c_action_failed_error, dynamic_cast<const paludis::ActionFailedError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::ActionAbortedError *>(&ee))
+ rb_raise(c_action_aborted_error, dynamic_cast<const paludis::ActionAbortedError *>(&ee)->message().c_str());
else if (0 != dynamic_cast<const paludis::BadVersionOperatorError *>(&ee))
rb_raise(c_bad_version_operator_error, dynamic_cast<const paludis::BadVersionOperatorError *>(&ee)->message().c_str());
@@ -321,17 +299,6 @@ has_query_property_error_query(VALUE self)
return rb_attr_get(self, rb_intern("query"));
}
-static VALUE
-fetch_action_error_init(int argc, VALUE* argv, VALUE self)
-{
- VALUE failures;
-
- failures = (argc > 1) ? argv[--argc] : Qnil;
- rb_call_super(argc, argv);
- rb_iv_set(self, "failures", failures);
- return self;
-}
-
/*
* call-seq:
* failures -> Array
@@ -422,20 +389,14 @@ void PALUDIS_VISIBLE paludis::ruby::init()
c_no_destination_error = rb_define_class_under(c_paludis_module, "NoDestinationError", c_dep_list_error);
/*
- * Document-class: Paludis::ActionError
- *
- * Base class for Action related errors
+ * Document-class: Paludis::ActionFailedError
*/
- c_action_error = rb_define_class_under(c_paludis_module, "ActionError", rb_eRuntimeError);
+ c_action_failed_error = rb_define_class_under(c_paludis_module, "ActionFailedError", rb_eRuntimeError);
/*
- * Document-class: Paludis::FetchActionError
- *
- * Thrown if a PackageID fails to perform a FetchAction.
+ * Document-class: Paludis::ActionAbortedError
*/
- c_fetch_action_error = rb_define_class_under(c_paludis_module, "FetchActionError", c_action_error);
- rb_define_method(c_fetch_action_error, "initialize", RUBY_FUNC_CAST(&fetch_action_error_init), -1);
- rb_define_method(c_fetch_action_error, "failures", RUBY_FUNC_CAST(&fetch_action_error_failures), 0);
+ c_action_aborted_error = rb_define_class_under(c_paludis_module, "ActionAbortedError", rb_eRuntimeError);
/*
* Document-class: Paludis::AmbiguousPackageNameError
@@ -447,34 +408,6 @@ void PALUDIS_VISIBLE paludis::ruby::init()
rb_define_method(c_ambiguous_package_name_error, "options", RUBY_FUNC_CAST(&ambiguous_package_name_error_failures), 0);
/*
- * Document-class: Paludis::InfoActionError
- *
- * Thrown if a PackageID fails to perform a InfoAction.
- */
- c_info_action_error = rb_define_class_under(c_paludis_module, "InfoActionError", c_action_error);
-
- /*
- * Document-class: Paludis::ConfigActionError
- *
- * Thrown if a PackageID fails to perform a ConfigAction.
- */
- c_config_action_error = rb_define_class_under(c_paludis_module, "ConfigActionError", c_action_error);
-
- /*
- * Document-class: Paludis::InstallActionError
- *
- * Thrown if a PackageID fails to perform a InstallAction.
- */
- c_install_action_error = rb_define_class_under(c_paludis_module, "InstallActionError", c_action_error);
-
- /*
- * Document-class: Paludis::UninstallActionError
- *
- * Thrown if a PackageID fails to perform a InstallAction.
- */
- c_uninstall_action_error = rb_define_class_under(c_paludis_module, "UninstallActionError", c_action_error);
-
- /*
* Document-class: Paludis::GotASetNotAPackageDepSpec
*
* Thrown if parse_user_package_dep_spec gets a set.
diff --git a/src/clients/accerso/accerso.cc b/src/clients/accerso/accerso.cc
index 5de028a..8a03bf3 100644
--- a/src/clients/accerso/accerso.cc
+++ b/src/clients/accerso/accerso.cc
@@ -139,18 +139,20 @@ main(int argc, char *argv[])
cout << "Processing " << colour(cl_package_name, stringify(**i)) << "..." << endl;
++total;
+ OutputManagerFromEnvironment output_manager_holder(&env, *i, oe_exclusive);
+ FetchAction a(make_named_values<FetchActionOptions>(
+ value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
+ value_for<n::exclude_unmirrorable>(true),
+ value_for<n::fetch_unneeded>(true),
+ value_for<n::ignore_unfetched>(false),
+ value_for<n::make_output_manager>(std::tr1::ref(output_manager_holder)),
+ value_for<n::safe_resume>(true)
+ ));
+
try
{
if ((*i)->supports_action(SupportsActionTest<FetchAction>()))
{
- OutputManagerFromEnvironment output_manager_holder(&env, *i, oe_exclusive);
- FetchAction a(make_named_values<FetchActionOptions>(
- value_for<n::exclude_unmirrorable>(true),
- value_for<n::fetch_unneeded>(true),
- value_for<n::ignore_unfetched>(false),
- value_for<n::make_output_manager>(std::tr1::ref(output_manager_holder)),
- value_for<n::safe_resume>(true)
- ));
(*i)->perform_action(a);
++success;
if (output_manager_holder.output_manager_if_constructed())
@@ -159,35 +161,34 @@ main(int argc, char *argv[])
else
results.insert(std::make_pair(*i, "Does not support fetching"));
}
- catch (const FetchActionError & e)
+ catch (const ActionFailedError & e)
{
- if (e.failures())
+ if (a.options.errors()->empty())
+ results.insert(std::make_pair(*i, "Unknown fetch error"));
+
+ for (Sequence<FetchActionFailure>::ConstIterator f(a.options.errors()->begin()),
+ f_end(a.options.errors()->end()) ; f != f_end ; ++f)
{
- for (Sequence<FetchActionFailure>::ConstIterator f(e.failures()->begin()), f_end(e.failures()->end()) ; f != f_end ; ++f)
+ std::string r;
+ if ((*f).requires_manual_fetching())
+ r = "manual";
+
+ if ((*f).failed_automatic_fetching())
+ {
+ if (! r.empty())
+ r.append(", ");
+ r.append("could not fetch");
+ }
+
+ if (! (*f).failed_integrity_checks().empty())
{
- std::string r;
- if ((*f).requires_manual_fetching())
- r = "manual";
-
- if ((*f).failed_automatic_fetching())
- {
- if (! r.empty())
- r.append(", ");
- r.append("could not fetch");
- }
-
- if (! (*f).failed_integrity_checks().empty())
- {
- if (! r.empty())
- r.append(", ");
- r.append((*f).failed_integrity_checks());
- }
-
- results.insert(std::make_pair(*i, (*f).target_file() + ": " + r));
+ if (! r.empty())
+ r.append(", ");
+ r.append((*f).failed_integrity_checks());
}
+
+ results.insert(std::make_pair(*i, (*f).target_file() + ": " + r));
}
- else
- results.insert(std::make_pair(*i, "Unknown fetch error"));
}
catch (const InternalError &)
{
diff --git a/src/clients/appareo/appareo.cc b/src/clients/appareo/appareo.cc
index 2e5dcf5..44b77de 100644
--- a/src/clients/appareo/appareo.cc
+++ b/src/clients/appareo/appareo.cc
@@ -97,51 +97,53 @@ namespace
cout << "Processing " << colour(cl_package_name, stringify(**i)) << "..." << endl;
++total;
+ const std::tr1::shared_ptr<Sequence<FetchActionFailure> > failures(new Sequence<FetchActionFailure>);
try
{
if ((*i)->supports_action(SupportsActionTest<FetchAction>()))
{
FetchAction a(make_named_values<FetchActionOptions>(
- value_for<n::exclude_unmirrorable>(false),
- value_for<n::fetch_unneeded>(true),
- value_for<n::ignore_unfetched>(false),
- value_for<n::make_output_manager>(&make_standard_output_manager),
- value_for<n::safe_resume>(true)
- ));
+ value_for<n::errors>(failures),
+ value_for<n::exclude_unmirrorable>(false),
+ value_for<n::fetch_unneeded>(true),
+ value_for<n::ignore_unfetched>(false),
+ value_for<n::make_output_manager>(&make_standard_output_manager),
+ value_for<n::safe_resume>(true)
+ ));
(*i)->perform_action(a);
++success;
}
else
results.insert(std::make_pair(*i, "Does not support fetching"));
}
- catch (const FetchActionError & e)
+ catch (const ActionFailedError & e)
{
- if (e.failures())
+ for (Sequence<FetchActionFailure>::ConstIterator f(failures->begin()),
+ f_end(failures->end()) ;
+ f != f_end ; ++f)
{
- for (Sequence<FetchActionFailure>::ConstIterator f(e.failures()->begin()), f_end(e.failures()->end()) ; f != f_end ; ++f)
+ std::string r;
+ if (f->requires_manual_fetching())
+ r = "manual";
+
+ if (f->failed_automatic_fetching())
+ {
+ if (! r.empty())
+ r.append(", ");
+ r.append("could not fetch");
+ }
+
+ if (! f->failed_integrity_checks().empty())
{
- std::string r;
- if (f->requires_manual_fetching())
- r = "manual";
-
- if (f->failed_automatic_fetching())
- {
- if (! r.empty())
- r.append(", ");
- r.append("could not fetch");
- }
-
- if (! f->failed_integrity_checks().empty())
- {
- if (! r.empty())
- r.append(", ");
- r.append(f->failed_integrity_checks());
- }
-
- results.insert(std::make_pair(*i, f->target_file() + ": " + r));
+ if (! r.empty())
+ r.append(", ");
+ r.append(f->failed_integrity_checks());
}
+
+ results.insert(std::make_pair(*i, f->target_file() + ": " + r));
}
- else
+
+ if (failures->empty())
results.insert(std::make_pair(*i, "Unknown fetch error"));
}
catch (const InternalError &)
diff --git a/src/clients/cave/cave.cc b/src/clients/cave/cave.cc
index f406b0f..63a1b9a 100644
--- a/src/clients/cave/cave.cc
+++ b/src/clients/cave/cave.cc
@@ -24,6 +24,7 @@
#include <paludis/args/do_help.hh>
#include <paludis/environment_factory.hh>
#include <paludis/environment.hh>
+#include <paludis/action.hh>
#include <iostream>
#include <cstdlib>
#include <string>
@@ -77,6 +78,14 @@ int main(int argc, char * argv[])
return EXIT_FAILURE;
}
+ catch (const ActionAbortedError & e)
+ {
+ cout << endl;
+ cerr << "Action aborted:" << endl
+ << " * " << e.backtrace("\n * ")
+ << e.message() << " (" << e.what() << ")" << endl;
+ return 42;
+ }
catch (const Exception & e)
{
cerr << endl;
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 236ebe8..f996cec 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -277,14 +277,14 @@ namespace
if (0 != env->perform_hook(Hook("install_task_execute_pre")
("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
).max_exit_status())
- throw ActionError("Aborted by hook");
+ throw ActionAbortedError("Aborted by hook");
try
{
if (0 != env->perform_hook(Hook("pretend_all_pre")
("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
).max_exit_status())
- throw ActionError("Aborted by hook");
+ throw ActionAbortedError("Aborted by hook");
std::cout << "Executing pretend actions: " << std::flush;
@@ -303,7 +303,7 @@ namespace
if (0 != env->perform_hook(Hook("pretend_all_post")
("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
).max_exit_status())
- throw ActionError("Aborted by hook");
+ throw ActionAbortedError("Aborted by hook");
if (0 != retcode || cmdline.a_pretend.specified())
return retcode;
@@ -313,7 +313,7 @@ namespace
if (0 != env->perform_hook(Hook("install_all_pre")
("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
).max_exit_status())
- throw ActionError("Aborted by hook");
+ throw ActionAbortedError("Aborted by hook");
for (Resolutions::ConstIterator c(lists.ordered()->begin()), c_end(lists.ordered()->end()) ;
c != c_end ; ++c)
@@ -337,7 +337,7 @@ namespace
if (0 != env->perform_hook(Hook("install_all_post")
("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
).max_exit_status())
- throw ActionError("Aborted by hook");
+ throw ActionAbortedError("Aborted by hook");
if (! cmdline.execution_options.a_preserve_world.specified())
{
@@ -403,7 +403,7 @@ namespace
{
paludis::Command cmd(command);
if (0 != run_command(cmd))
- throw ActionError("Updating world failed");
+ throw ActionAbortedError("Updating world failed");
}
}
}
@@ -414,7 +414,7 @@ namespace
("PRETEND", stringify(cmdline.a_pretend.specified()))
("SUCCESS", stringify(false))
).max_exit_status())
- throw ActionError("Aborted by hook");
+ throw ActionAbortedError("Aborted by hook");
throw;
}
@@ -423,7 +423,7 @@ namespace
("PRETEND", stringify(cmdline.a_pretend.specified()))
("SUCCESS", stringify(true))
).max_exit_status())
- throw ActionError("Aborted by hook");
+ throw ActionAbortedError("Aborted by hook");
return retcode;
}
diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc
index f0ad4f7..94bb1c8 100644
--- a/src/clients/cave/cmd_perform.cc
+++ b/src/clients/cave/cmd_perform.cc
@@ -159,7 +159,7 @@ namespace
("TARGET", stringify(*id))
("X_OF_Y", cmdline.a_x_of_y.argument())
).max_exit_status())
- throw ActionError("Aborted by hook");
+ throw ActionAbortedError("Aborted by hook");
id->perform_action(action);
@@ -168,7 +168,7 @@ namespace
("TARGET", stringify(*id))
("X_OF_Y", cmdline.a_x_of_y.argument())
).max_exit_status())
- throw ActionError("Aborted by hook");
+ throw ActionAbortedError("Aborted by hook");
}
bool ignore_nothing(const FSEntry &)
@@ -321,6 +321,7 @@ PerformCommand::run(
OutputManagerFromEnvironment output_manager_holder(env.get(), id, exclusivity);
FetchActionOptions options(make_named_values<FetchActionOptions>(
+ value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(cmdline.a_exclude_unmirrorable.specified()),
value_for<n::fetch_unneeded>(cmdline.a_fetch_unneeded.specified()),
value_for<n::ignore_unfetched>(cmdline.a_ignore_unfetched.specified()),
@@ -337,6 +338,7 @@ PerformCommand::run(
OutputManagerFromEnvironment output_manager_holder(env.get(), id, exclusivity);
FetchActionOptions options(make_named_values<FetchActionOptions>(
+ value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(cmdline.a_exclude_unmirrorable.specified()),
value_for<n::fetch_unneeded>(cmdline.a_fetch_unneeded.specified()),
value_for<n::ignore_unfetched>(cmdline.a_ignore_unfetched.specified()),
diff --git a/src/clients/paludis/do_config.cc b/src/clients/paludis/do_config.cc
index fbd24d4..0544e62 100644
--- a/src/clients/paludis/do_config.cc
+++ b/src/clients/paludis/do_config.cc
@@ -62,9 +62,9 @@ namespace
if (output_manager_holder.output_manager_if_constructed())
output_manager_holder.output_manager_if_constructed()->succeeded();
}
- catch (const UnsupportedActionError &)
+ catch (const ActionFailedError &)
{
- std::cerr << "Package '" << *p << "' does not support post-install configuration" << std::endl;
+ std::cerr << "Package '" << *p << "' failed post-install configuration" << std::endl;
return_code |= 1;
}
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index 3019f0e..2a77180 100644
--- a/src/clients/paludis/info.cc
+++ b/src/clients/paludis/info.cc
@@ -261,7 +261,7 @@ int do_one_info(
if (output_manager_holder.output_manager_if_constructed())
output_manager_holder.output_manager_if_constructed()->succeeded();
}
- catch (const UnsupportedActionError &)
+ catch (const ActionFailedError &)
{
cout << " No extra information available for '" << **p << "'" << endl;
cout << endl;
diff --git a/src/clients/paludis/paludis.cc b/src/clients/paludis/paludis.cc
index 18397c3..2a646fd 100644
--- a/src/clients/paludis/paludis.cc
+++ b/src/clients/paludis/paludis.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, 2009 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
@@ -416,6 +416,14 @@ main(int argc, char *argv[])
return EXIT_FAILURE;
}
}
+ catch (const ActionAbortedError & e)
+ {
+ cout << endl;
+ cerr << "Action aborted:" << endl
+ << " * " << e.backtrace("\n * ")
+ << e.message() << " (" << e.what() << ")" << endl;
+ return 42;
+ }
catch (const Exception & e)
{
cout << endl;
diff --git a/src/clients/paludis/uninstall.cc b/src/clients/paludis/uninstall.cc
index 82732bb..60f9ff3 100644
--- a/src/clients/paludis/uninstall.cc
+++ b/src/clients/paludis/uninstall.cc
@@ -263,10 +263,10 @@ namespace
cerr << endl;
return 1;
}
- catch (const UninstallActionError & e)
+ catch (const ActionFailedError & e)
{
cout << endl;
- cerr << "Uninstall error:" << endl;
+ cerr << "Action failed error:" << endl;
cerr << " * " << e.backtrace("\n * ");
cerr << e.message() << endl;
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index cc8def6..aac492b 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -1583,7 +1583,8 @@ ConsoleInstallTask::on_ambiguous_package_name_error(const AmbiguousPackageNameEr
}
void
-ConsoleInstallTask::on_install_action_error(const std::tr1::shared_ptr<OutputManager> & output_manager, const ActionError & e)
+ConsoleInstallTask::on_non_fetch_action_error(
+ const std::tr1::shared_ptr<OutputManager> & output_manager, const ActionFailedError & e)
{
output_manager->stdout_stream() << endl;
output_manager->stdout_stream() << "Install error:" << endl;
@@ -1594,7 +1595,9 @@ ConsoleInstallTask::on_install_action_error(const std::tr1::shared_ptr<OutputMan
}
void
-ConsoleInstallTask::on_fetch_action_error(const std::tr1::shared_ptr<OutputManager> & output_manager, const FetchActionError & e)
+ConsoleInstallTask::on_fetch_action_error(
+ const std::tr1::shared_ptr<OutputManager> & output_manager, const ActionFailedError & e,
+ const std::tr1::shared_ptr<const Sequence<FetchActionFailure> > & failures)
{
output_manager->stdout_stream() << endl;
output_manager->stdout_stream() << "Fetch error:" << endl;
@@ -1602,9 +1605,9 @@ ConsoleInstallTask::on_fetch_action_error(const std::tr1::shared_ptr<OutputManag
output_manager->stdout_stream() << e.message() << endl;
output_manager->stdout_stream() << endl;
- if (e.failures())
+ if (failures)
{
- for (Sequence<FetchActionFailure>::ConstIterator f(e.failures()->begin()), f_end(e.failures()->end()) ;
+ for (Sequence<FetchActionFailure>::ConstIterator f(failures->begin()), f_end(failures->end()) ;
f != f_end ; ++f)
{
output_manager->stdout_stream() << " * File '" << (*f).target_file() << "': ";
diff --git a/src/output/console_install_task.hh b/src/output/console_install_task.hh
index 6228002..f36d933 100644
--- a/src/output/console_install_task.hh
+++ b/src/output/console_install_task.hh
@@ -183,8 +183,11 @@ namespace paludis
virtual void on_had_both_package_and_set_targets_error(const HadBothPackageAndSetTargets &);
virtual void on_multiple_set_targets_specified(const MultipleSetTargetsSpecified &);
- virtual void on_install_action_error(const std::tr1::shared_ptr<OutputManager> &, const ActionError &);
- virtual void on_fetch_action_error(const std::tr1::shared_ptr<OutputManager> &, const FetchActionError &);
+ virtual void on_non_fetch_action_error(const std::tr1::shared_ptr<OutputManager> &,
+ const ActionFailedError &);
+ virtual void on_fetch_action_error(const std::tr1::shared_ptr<OutputManager> &,
+ const ActionFailedError &,
+ const std::tr1::shared_ptr<const Sequence<FetchActionFailure> > &);
virtual void on_display_failure_summary_pre();
virtual void on_display_failure_summary_success(const DepListEntry &);