aboutsummaryrefslogtreecommitdiff
path: root/paludis/python_hooks.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-05 22:40:00 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-05 22:40:00 +0000
commit52132956b5ffb54aeb99a72e375e48e3fa18ff36 (patch)
tree3ef028f347e96f39f4ee76581417fdf59bfa6497 /paludis/python_hooks.cc
parent79e482a013061ab2e9fd4f87eeb3babb4d1ba1e2 (diff)
downloadpaludis-52132956b5ffb54aeb99a72e375e48e3fa18ff36.tar.gz
paludis-52132956b5ffb54aeb99a72e375e48e3fa18ff36.tar.xz
kill some sr
Diffstat (limited to 'paludis/python_hooks.cc')
-rw-r--r--paludis/python_hooks.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/paludis/python_hooks.cc b/paludis/python_hooks.cc
index e70723496..0dd23caa6 100644
--- a/paludis/python_hooks.cc
+++ b/paludis/python_hooks.cc
@@ -14,6 +14,7 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_named_values.hh>
#include <set>
@@ -156,7 +157,7 @@ PyHookFile::run(const Hook & hook) const
Context c("When running hook '" + stringify(file_name()) + "' for hook '" + hook.name() + "':");
if (! _loaded)
- return HookResult(0, "");
+ return make_named_values<HookResult>(value_for<n::max_exit_status>(0), value_for<n::output>(""));
Lock l(_mutex);
@@ -182,7 +183,7 @@ PyHookFile::run(const Hook & hook) const
<< _get_traceback() << "'";
}
- return HookResult(1, "");
+ return make_named_values<HookResult>(value_for<n::max_exit_status>(1), value_for<n::output>(""));
}
Prefix p(this, _run_prefixed ? strip_trailing_string(file_name().basename(), ".py") + "> " : "");
@@ -207,7 +208,7 @@ PyHookFile::run(const Hook & hook) const
Log::get_instance()->message("hook.python.failure", ll_warning, lc_no_context) <<
"Hook '" << file_name() << "': running hook_run_" << hook.name()
<< " function failed: '" << _get_traceback() << "'";
- return HookResult(1, "");
+ return make_named_values<HookResult>(value_for<n::max_exit_status>(1), value_for<n::output>(""));
}
if (hook.output_dest == hod_grab)
@@ -220,18 +221,18 @@ PyHookFile::run(const Hook & hook) const
<< "Hook '" << file_name() << "': hook_run_" << hook.name()
<< " function returned '" << result_s << "'";
- return HookResult(0, result_s);
+ return make_named_values<HookResult>(value_for<n::max_exit_status>(0), value_for<n::output>(result_s));
}
else
{
Log::get_instance()->message("hook.python.bad_output", ll_warning, lc_no_context)
<< "Hook '" << file_name() << "': hook_run_" << hook.name()
<< " function returned not a string.";
- return HookResult(1, "");
+ return make_named_values<HookResult>(value_for<n::max_exit_status>(1), value_for<n::output>(""));
}
}
else
- return HookResult(0, "");
+ return make_named_values<HookResult>(value_for<n::max_exit_status>(0), value_for<n::output>(""));
}
void