diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2012-08-08 13:35:45 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-08-08 13:35:45 +0100 |
| commit | 21bcf2bbd44573a0326b7b0141aa6cdd5e2eae89 (patch) | |
| tree | 74805e55298768d77acfd093eb7d7f33145ae784 /src | |
| parent | 348e3a4a099c4d415e18946cd181f225af2fd98b (diff) | |
| parent | b288959293063a16a249bfa3b39b2ad32bb8452a (diff) | |
| download | rabbitmq-server-git-21bcf2bbd44573a0326b7b0141aa6cdd5e2eae89.tar.gz | |
merge heads
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_plugins.erl | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl index 4b70a2a54d..0320c69fc2 100644 --- a/src/rabbit_plugins.erl +++ b/src/rabbit_plugins.erl @@ -51,8 +51,8 @@ setup() -> {ok, ExpandDir} = application:get_env(rabbit, plugins_expand_dir), {ok, EnabledFile} = application:get_env(rabbit, enabled_plugins_file), prepare_plugins(EnabledFile, PluginDir, ExpandDir), - [prepare_dir_plugin(PluginName) || - PluginName <- filelib:wildcard("*/ebin/*.app", ExpandDir)]. + [prepare_dir_plugin(PluginAppDescPath) || + PluginAppDescPath <- filelib:wildcard(ExpandDir ++ "/*/ebin/*.app")]. %% @doc Lists the plugins which are currently running. active() -> @@ -137,15 +137,11 @@ prepare_plugins(EnabledFile, PluginsDistDir, ExpandDir) -> [prepare_plugin(Plugin, ExpandDir) || Plugin <- ToUnpackPlugins]. -prepare_dir_plugin(PluginAppDescFn) -> - %% Add the plugin ebin directory to the load path - PluginEBinDirN = filename:dirname(PluginAppDescFn), - code:add_path(PluginEBinDirN), - - %% We want the second-last token - NameTokens = string:tokens(PluginAppDescFn,"/."), - PluginNameString = lists:nth(length(NameTokens) - 1, NameTokens), - list_to_atom(PluginNameString). +prepare_dir_plugin(PluginAppDescPath) -> + PluginEBinDir = filename:dirname(PluginAppDescPath), + code:add_path(PluginEBinDir), + NameTokens = string:tokens(PluginAppDescPath, "/."), + list_to_atom(lists:nth(length(NameTokens) - 1, NameTokens)). %%---------------------------------------------------------------------------- |
