diff options
| -rw-r--r-- | src/rabbit_plugins.erl | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl index 72d1696cd8..3caa13d73f 100644 --- a/src/rabbit_plugins.erl +++ b/src/rabbit_plugins.erl @@ -111,7 +111,7 @@ dependencies(Reverse, Sources, AllPlugins) -> %%---------------------------------------------------------------------------- -prepare_plugins(EnabledFile, PluginsDistDir, DestDir) -> +prepare_plugins(EnabledFile, PluginsDistDir, ExpandDir) -> AllPlugins = list(PluginsDistDir), Enabled = read_enabled(EnabledFile), ToUnpack = dependencies(false, Enabled, AllPlugins), @@ -124,18 +124,18 @@ prepare_plugins(EnabledFile, PluginsDistDir, DestDir) -> end, %% Eliminate the contents of the destination directory - case delete_recursively(DestDir) of + case delete_recursively(ExpandDir) of ok -> ok; {error, E} -> rabbit_misc:quit("Could not delete dir ~s (~p)", - [DestDir, E]) + [ExpandDir, E]) end, - case filelib:ensure_dir(DestDir ++ "/") of + case filelib:ensure_dir(ExpandDir ++ "/") of ok -> ok; {error, E2} -> rabbit_misc:quit("Could not create dir ~s (~p)", - [DestDir, E2]) + [ExpandDir, E2]) end, - [prepare_plugin(Plugin, DestDir) || Plugin <- ToUnpackPlugins]. + [prepare_plugin(Plugin, ExpandDir) || Plugin <- ToUnpackPlugins]. prepare_dir_plugin(PluginAppDescFn) -> %% Add the plugin ebin directory to the load path @@ -156,12 +156,11 @@ delete_recursively(Fn) -> Error -> Error end. -prepare_plugin(#plugin{type = ez, location = Location}, PluginDestDir) -> - zip:unzip(Location, [{cwd, PluginDestDir}]); +prepare_plugin(#plugin{type = ez, location = Location}, ExpandDir) -> + zip:unzip(Location, [{cwd, ExpandDir}]); prepare_plugin(#plugin{type = dir, name = Name, location = Location}, - PluginsDestDir) -> - rabbit_file:recursive_copy(Location, - filename:join([PluginsDestDir, Name])). + ExpandDir) -> + rabbit_file:recursive_copy(Location, filename:join([ExpandDir, Name])). get_plugin_info(Base, {ez, EZ0}) -> EZ = filename:join([Base, EZ0]), |
