From e89d0d0644deb5f2851c05bbe157c663977efcff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 23 May 2015 15:24:31 +0300 Subject: Patch all rebar hook commands, not just the regex ones --- core/deps.mk | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'core/deps.mk') diff --git a/core/deps.mk b/core/deps.mk index 5f000ac..66936c1 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -253,28 +253,28 @@ define dep_autopatch_rebar.erl Write("\npreprocess::\n"), Write("\npre-deps::\n"), Write("\npre-app::\n"), + PatchHook = fun(Cmd) -> + case Cmd of + "make -C" ++ _ -> Escape(Cmd); + "gmake -C" ++ _ -> Escape(Cmd); + "make " ++ Cmd1 -> "make -f Makefile.orig.mk " ++ Escape(Cmd1); + "gmake " ++ Cmd1 -> "gmake -f Makefile.orig.mk " ++ Escape(Cmd1); + _ -> Escape(Cmd) + end + end, fun() -> case lists:keyfind(pre_hooks, 1, Conf) of false -> ok; {_, Hooks} -> [case H of - {'get-deps', Command} -> - Write("\npre-deps::\n\t" ++ Escape(Command) ++ "\n"); - {compile, Command} -> - Write("\npre-app::\n\t" ++ Escape(Command) ++ "\n"); - {Regex, compile, Command0} -> + {'get-deps', Cmd} -> + Write("\npre-deps::\n\t" ++ PatchHook(Cmd) ++ "\n"); + {compile, Cmd} -> + Write("\npre-app::\n\t" ++ PatchHook(Cmd) ++ "\n"); + {Regex, compile, Cmd} -> case rebar_utils:is_arch(Regex) of - true -> - Command = case Command0 of - "make -C" ++ _ -> Escape(Command0); - "gmake -C" ++ _ -> Escape(Command0); - "make " ++ Command1 -> "make -f Makefile.orig.mk " ++ Escape(Command1); - "gmake " ++ Command1 -> "gmake -f Makefile.orig.mk " ++ Escape(Command1); - _ -> Command0 - end, - Write("\npre-app::\n\t" ++ Command ++ "\n"); - false -> - ok + true -> Write("\npre-app::\n\t" ++ PatchHook(Cmd) ++ "\n"); + false -> ok end; _ -> ok end || H <- Hooks] -- cgit v1.2.3