diff options
| -rw-r--r-- | src/rabbit_plugin_activator.erl | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/rabbit_plugin_activator.erl b/src/rabbit_plugin_activator.erl index a731188259..2769d3c4bd 100644 --- a/src/rabbit_plugin_activator.erl +++ b/src/rabbit_plugin_activator.erl @@ -131,14 +131,23 @@ delete_dir(Dir) -> true -> case file:list_dir(Dir) of {ok, Files} -> - Paths = [Dir ++ "/" ++ F || F <- Files], - [delete_dir(F) || F <- Paths, filelib:is_dir(F)], - [file:delete(F) || F <- Paths, filelib:is_file(F)] + [case Dir ++ "/" ++ F of + Fn -> + case filelib:is_dir(Fn) and not(is_symlink(Fn)) of + true -> delete_dir(Fn); + false -> file:delete(Fn) + end + end || F <- Files] end, ok = file:del_dir(Dir); false -> ok end. +is_symlink(Name) -> + case file:read_link(Name) of + {ok, _} -> true; + _ -> false + end. unpack_ez_plugins(PluginSrcDir, PluginDestDir) -> %% Eliminate the contents of the destination directory |
