From e7575ab63f7fa9117b87e980e5b3728805bdd9e5 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 21 Aug 2020 17:33:44 +0200 Subject: [PATCH] For mod_vcard_* modules, redirect options to mod_vcard --- tools/opt_types.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/opt_types.sh b/tools/opt_types.sh index 658357cb2..8de6d8945 100755 --- a/tools/opt_types.sh +++ b/tools/opt_types.sh @@ -106,15 +106,23 @@ emit_funs(Fd, _Mod, Specs, Globals) -> emit_funs(Fd, Mod, Specs) -> lists:foreach( fun({Opt, Type}) -> + Mod2 = strip_db_type(Mod), log(Fd, "-spec ~s(gen_mod:opts() | global | binary()) -> ~s.~n" "~s(Opts) when is_map(Opts) ->~n" " gen_mod:get_opt(~s, Opts);~n" "~s(Host) ->~n" " gen_mod:get_module_opt(Host, ~s, ~s).~n", - [Opt, t_to_string(Type), Opt, Opt, Opt, Mod, Opt]) + [Opt, t_to_string(Type), Opt, Opt, Opt, Mod2, Opt]) end, Specs). +strip_db_type(mod_vcard_ldap) -> + mod_vcard; +strip_db_type(mod_vcard_mnesia) -> + mod_vcard; +strip_db_type(Mod) -> + Mod. + append({globals, Form}, _File, State) -> [Clause] = erl_syntax:function_clauses(Form), Body = lists:last(erl_syntax:clause_body(Clause)),