1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-05 02:29:34 +02:00

Rename aux.erl as misc.erl

Thanks Microsoft Windows to not support some filenames
This commit is contained in:
Christophe Romain 2017-04-11 12:13:58 +02:00
parent 265aa54bc2
commit b1acd1183f
57 changed files with 221 additions and 221 deletions

View file

@ -160,9 +160,9 @@ available() ->
lists:keystore(Key, 1, Acc, {Key, Val})
end, Jungle, Standalone)).
available(Module) when is_atom(Module) ->
available(aux:atom_to_binary(Module));
available(misc:atom_to_binary(Module));
available(Package) when is_binary(Package) ->
Available = [aux:atom_to_binary(K) || K<-proplists:get_keys(available())],
Available = [misc:atom_to_binary(K) || K<-proplists:get_keys(available())],
lists:member(Package, Available).
available_command() ->
@ -171,18 +171,18 @@ available_command() ->
installed() ->
modules_spec(modules_dir(), "*").
installed(Module) when is_atom(Module) ->
installed(aux:atom_to_binary(Module));
installed(misc:atom_to_binary(Module));
installed(Package) when is_binary(Package) ->
Installed = [aux:atom_to_binary(K) || K<-proplists:get_keys(installed())],
Installed = [misc:atom_to_binary(K) || K<-proplists:get_keys(installed())],
lists:member(Package, Installed).
installed_command() ->
[short_spec(Item) || Item <- installed()].
install(Module) when is_atom(Module) ->
install(aux:atom_to_binary(Module));
install(misc:atom_to_binary(Module));
install(Package) when is_binary(Package) ->
Spec = [S || {Mod, S} <- available(), aux:atom_to_binary(Mod)==Package],
Spec = [S || {Mod, S} <- available(), misc:atom_to_binary(Mod)==Package],
case {Spec, installed(Package), is_contrib_allowed()} of
{_, _, false} ->
{error, not_allowed};
@ -191,7 +191,7 @@ install(Package) when is_binary(Package) ->
{_, true, _} ->
{error, conflict};
{[Attrs], _, _} ->
Module = aux:binary_to_atom(Package),
Module = misc:binary_to_atom(Package),
case compile_and_install(Module, Attrs) of
ok ->
code:add_patha(module_ebin_dir(Module)),
@ -207,11 +207,11 @@ install(Package) when is_binary(Package) ->
end.
uninstall(Module) when is_atom(Module) ->
uninstall(aux:atom_to_binary(Module));
uninstall(misc:atom_to_binary(Module));
uninstall(Package) when is_binary(Package) ->
case installed(Package) of
true ->
Module = aux:binary_to_atom(Package),
Module = misc:binary_to_atom(Package),
case erlang:function_exported(Module, pre_uninstall, 0) of
true -> Module:pre_uninstall();
_ -> ok
@ -230,7 +230,7 @@ uninstall(Package) when is_binary(Package) ->
upgrade() ->
[{Package, upgrade(Package)} || {Package, _Spec} <- installed()].
upgrade(Module) when is_atom(Module) ->
upgrade(aux:atom_to_binary(Module));
upgrade(misc:atom_to_binary(Module));
upgrade(Package) when is_binary(Package) ->
uninstall(Package),
install(Package).
@ -240,7 +240,7 @@ add_sources(Path) when is_list(Path) ->
add_sources(_, "") ->
{error, no_url};
add_sources(Module, Path) when is_atom(Module), is_list(Path) ->
add_sources(aux:atom_to_binary(Module), Path);
add_sources(misc:atom_to_binary(Module), Path);
add_sources(Package, Path) when is_binary(Package), is_list(Path) ->
DestDir = sources_dir(),
RepDir = filename:join(DestDir, module_name(Path)),
@ -261,18 +261,18 @@ add_sources(Package, Path) when is_binary(Package), is_list(Path) ->
end.
del_sources(Module) when is_atom(Module) ->
del_sources(aux:atom_to_binary(Module));
del_sources(misc:atom_to_binary(Module));
del_sources(Package) when is_binary(Package) ->
case uninstall(Package) of
ok ->
SrcDir = module_src_dir(aux:binary_to_atom(Package)),
SrcDir = module_src_dir(misc:binary_to_atom(Package)),
delete_path(SrcDir);
Error ->
Error
end.
check(Module) when is_atom(Module) ->
check(aux:atom_to_binary(Module));
check(misc:atom_to_binary(Module));
check(Package) when is_binary(Package) ->
case {available(Package), installed(Package)} of
{false, _} ->
@ -281,11 +281,11 @@ check(Package) when is_binary(Package) ->
Status = install(Package),
uninstall(Package),
case Status of
ok -> check_sources(aux:binary_to_atom(Package));
ok -> check_sources(misc:binary_to_atom(Package));
Error -> Error
end;
_ ->
check_sources(aux:binary_to_atom(Package))
check_sources(misc:binary_to_atom(Package))
end.
%% -- archives and variables functions
@ -420,7 +420,7 @@ module_name(Id) ->
filename:basename(filename:rootname(Id)).
module(Id) ->
aux:binary_to_atom(iolist_to_binary(module_name(Id))).
misc:binary_to_atom(iolist_to_binary(module_name(Id))).
module_spec(Spec) ->
[{path, filename:dirname(Spec)}