aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Carlsson <[email protected]>2016-11-21 15:31:16 +0100
committerRichard Carlsson <[email protected]>2016-11-21 15:32:47 +0100
commit65c4401c1cd1094da5d8f35137532a22054a8517 (patch)
tree2a7982186ebe7b75ee711c4cc566553de032e8ad
parent9491f6727f12e37241863bd5becbd1f336ff7659 (diff)
downloadotp-65c4401c1cd1094da5d8f35137532a22054a8517.tar.gz
otp-65c4401c1cd1094da5d8f35137532a22054a8517.tar.bz2
otp-65c4401c1cd1094da5d8f35137532a22054a8517.zip
Remove remnants of module package support
-rw-r--r--lib/kernel/src/code.erl27
1 files changed, 9 insertions, 18 deletions
diff --git a/lib/kernel/src/code.erl b/lib/kernel/src/code.erl
index 622b27080c..1b149bbb4e 100644
--- a/lib/kernel/src/code.erl
+++ b/lib/kernel/src/code.erl
@@ -719,37 +719,28 @@ start_get_mode() ->
which(Module) when is_atom(Module) ->
case is_loaded(Module) of
false ->
- which2(Module);
+ File = atom_to_list(Module) ++ objfile_extension(),
+ which(File, get_path());
{file, File} ->
File
end.
-which2(Module) ->
- Base = atom_to_list(Module),
- File = filename:basename(Base) ++ objfile_extension(),
- Path = get_path(),
- which(File, filename:dirname(Base), Path).
-
--spec which(file:filename(), file:filename(), [file:filename()]) ->
+-spec which(file:filename(), [file:filename()]) ->
'non_existing' | file:filename().
-which(_, _, []) ->
+which(_, []) ->
non_existing;
-which(File, Base, [Directory|Tail]) ->
- Path = if
- Base =:= "." -> Directory;
- true -> filename:join(Directory, Base)
- end,
+which(File, [Path|Tail]) ->
case erl_prim_loader:list_dir(Path) of
{ok,Files} ->
case lists:member(File,Files) of
true ->
filename:append(Path, File);
false ->
- which(File, Base, Tail)
+ which(File, Tail)
end;
_Error ->
- which(File, Base, Tail)
+ which(File, Tail)
end.
%% Search the code path for a specific file. Try to locate
@@ -760,13 +751,13 @@ which(File, Base, [Directory|Tail]) ->
Absname :: file:filename().
where_is_file(File) when is_list(File) ->
Path = get_path(),
- which(File, ".", Path).
+ which(File, Path).
-spec where_is_file(Path :: file:filename(), Filename :: file:filename()) ->
file:filename() | 'non_existing'.
where_is_file(Path, File) when is_list(Path), is_list(File) ->
- which(File, ".", Path).
+ which(File, Path).
-spec set_primary_archive(ArchiveFile :: file:filename(),
ArchiveBin :: binary(),