From: Jérémie Astor Date: Fri, 22 Apr 2022 12:07:22 +0000 (+0200) Subject: :art: Improve plugin deps message X-Git-Tag: nightly~281^2~1 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=bcf58ec737521d8af9b57baa1b076ec71b8965ef;p=gwion.git :art: Improve plugin deps message --- diff --git a/src/plug.c b/src/plug.c index cd643762..caebf3f9 100644 --- a/src/plug.c +++ b/src/plug.c @@ -139,15 +139,19 @@ ANN void plug_run(const struct Gwion_ *gwion, const Map mod) { ANN static m_bool dependencies(struct Gwion_ *gwion, const Plug plug, const loc_t loc) { const gwdeps dep = DLSYM(plug->dl, gwdeps, GWDEPEND_NAME); + bool ret = true; if (dep) { m_str *const base = dep(); m_str * deps = base; while (*deps) { - CHECK_BB(plugin_ini(gwion, *deps, loc)); + if(plugin_ini(gwion, *deps, loc) < 0) { + gw_err("{-}[{0}{R+}missing plugin dependency{0}{-}]{0} missing {Y-}%s{0} plugin\n", *deps); + ret = false; + } ++deps; } } - return GW_OK; + return ret ? GW_OK : GW_ERROR; } ANN static m_bool _plugin_ini(struct Gwion_ *gwion, const m_str iname, const loc_t loc) { @@ -189,7 +193,8 @@ ANN m_bool plugin_ini(struct Gwion_ *gwion, const m_str iname, const loc_t loc) const m_bool ret = _plugin_ini(gwion, iname, loc); gwion->env->context = ctx; if(ret > 0) return GW_OK; - env_err(env, loc, "no such plugin\n"); + if(gwion->env->context && !gwion->env->context->error) + env_err(env, loc, "no such plugin\n"); return GW_ERROR; }