aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Kim Højgaard-Hansen <kimrhh@exherbo.org> 2010-07-07 18:24:59 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-08 08:40:04 +0100
commitf15c642919a51e6b7e118ff8fe96437a5b61010c (patch)
tree59c726fe51a1cc85f48804b4f787b7bd321c8a2a
parent1b9c641880263a4c293f665a868bc1bb4c5f2b7a (diff)
downloadpaludis-f15c642919a51e6b7e118ff8fe96437a5b61010c.tar.gz
paludis-f15c642919a51e6b7e118ff8fe96437a5b61010c.tar.xz
add PALUDIS_IGNORE_HOOKS_NAMED to be able to avoid running specified hooks
-rw-r--r--paludis/hooker.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/paludis/hooker.cc b/paludis/hooker.cc
index 7628378..e6062a8 100644
--- a/paludis/hooker.cc
+++ b/paludis/hooker.cc
@@ -551,6 +551,9 @@ std::tr1::shared_ptr<Sequence<std::tr1::shared_ptr<HookFile> > >
Hooker::_find_hooks(const Hook & hook) const
{
std::map<std::string, std::tr1::shared_ptr<HookFile> > hook_files;
+ std::set<std::string> ignore_hooks;
+ tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(getenv_with_default("PALUDIS_IGNORE_HOOKS_NAMED", ""),
+ ":", "", std::inserter(ignore_hooks, ignore_hooks.begin()));
{
_imp->need_auto_hook_files();
@@ -569,6 +572,9 @@ Hooker::_find_hooks(const Hook & hook) const
for (DirIterator e(d->first / hook.name()), e_end ; e != e_end ; ++e)
{
+ if (ignore_hooks.find(e->basename()) != ignore_hooks.end())
+ continue;
+
if (is_file_with_extension(*e, ".bash", IsFileWithOptions()))
if (! hook_files.insert(std::make_pair(strip_trailing_string(e->basename(), ".bash"),
std::tr1::shared_ptr<HookFile>(new BashHookFile(*e, d->second, _imp->env)))).second)