aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-04-04 09:40:05 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-04-04 09:40:05 +0000
commit106062d132c496b805c85344fca1b7d2a199f53d (patch)
tree204305ee67d251405bf83a510af5240f1a930ea1
parentdd43d7ec985d005568d45b2502819cb9b2544696 (diff)
downloadpaludis-106062d132c496b805c85344fca1b7d2a199f53d.tar.gz
paludis-106062d132c496b805c85344fca1b7d2a199f53d.tar.xz
Don't barf when a hook has been removed.
-rw-r--r--paludis/hooker.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/paludis/hooker.cc b/paludis/hooker.cc
index b84c0ea..da3e3ef 100644
--- a/paludis/hooker.cc
+++ b/paludis/hooker.cc
@@ -753,13 +753,24 @@ Hooker::perform_hook(const Hook & hook) const
case hod_stdout:
for (Sequence<tr1::shared_ptr<HookFile> >::ConstIterator f(h->second->begin()),
f_end(h->second->end()) ; f != f_end ; ++f)
- result.max_exit_status = std::max(result.max_exit_status, (*f)->run(hook).max_exit_status);
+ if ((*f)->file_name().is_regular_file_or_symlink_to_regular_file())
+ result.max_exit_status = std::max(result.max_exit_status, (*f)->run(hook).max_exit_status);
+ else
+ Log::get_instance()->message(ll_warning, lc_context, "Hook file '" +
+ stringify((*f)->file_name()) + "' is not a regular file or has been removed");
continue;
case hod_grab:
for (Sequence<tr1::shared_ptr<HookFile> >::ConstIterator f(h->second->begin()),
f_end(h->second->end()) ; f != f_end ; ++f)
{
+ if (! (*f)->file_name().is_regular_file_or_symlink_to_regular_file())
+ {
+ Log::get_instance()->message(ll_warning, lc_context, "Hook file '" +
+ stringify((*f)->file_name()) + "' is not a regular file or has been removed");
+ continue;
+ }
+
HookResult tmp((*f)->run(hook));
if (tmp > result)
result = tmp;