diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2012-08-08 05:12:35 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-08-08 05:12:35 +0100 |
| commit | a9e9cfdf6cadfe4b8e996bb4db5a919c91f0b1ff (patch) | |
| tree | 55406b9721e5be7a5543796c6121b47b003cb7f5 /src | |
| parent | 62dcf279ab6c4d2453d4bf0e9afec6e787025180 (diff) | |
| download | rabbitmq-server-git-a9e9cfdf6cadfe4b8e996bb4db5a919c91f0b1ff.tar.gz | |
cosmetic
Diffstat (limited to 'src')
| -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]), |
