2017-08-02 13:14:59 +00:00
|
|
|
From: Peter Lemenkov <lemenkov@gmail.com>
|
|
|
|
Date: Wed, 2 Aug 2017 16:12:19 +0300
|
|
|
|
Subject: [PATCH] Add extra search directory
|
|
|
|
|
|
|
|
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
|
|
|
|
|
|
|
|
diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl
|
2022-07-13 18:52:50 +00:00
|
|
|
index af8531271f..66050d6cdb 100644
|
2017-08-02 13:14:59 +00:00
|
|
|
--- a/lib/kernel/src/code_server.erl
|
|
|
|
+++ b/lib/kernel/src/code_server.erl
|
2017-08-09 07:17:03 +00:00
|
|
|
@@ -79,11 +79,17 @@ init(Ref, Parent, [Root,Mode]) ->
|
2017-08-02 13:14:59 +00:00
|
|
|
IPath =
|
|
|
|
case Mode of
|
|
|
|
interactive ->
|
|
|
|
- LibDir = filename:append(Root, "lib"),
|
|
|
|
- {ok,Dirs} = erl_prim_loader:list_dir(LibDir),
|
|
|
|
- Paths = make_path(LibDir, Dirs),
|
|
|
|
+ F = fun(R) ->
|
|
|
|
+ LD = filename:append(R, "lib"),
|
2017-08-09 07:17:03 +00:00
|
|
|
+ case erl_prim_loader:list_dir(LD) of
|
|
|
|
+ error -> [];
|
|
|
|
+ {ok, D} -> make_path(LD, D)
|
|
|
|
+ end
|
2017-08-02 13:14:59 +00:00
|
|
|
+ end,
|
|
|
|
+ Paths = F(Root),
|
|
|
|
+ SharedPaths = F("/usr/share/erlang"),
|
|
|
|
UserLibPaths = get_user_lib_dirs(),
|
|
|
|
- ["."] ++ UserLibPaths ++ Paths;
|
|
|
|
+ ["."] ++ UserLibPaths ++ Paths ++ SharedPaths;
|
|
|
|
_ ->
|
|
|
|
[]
|
|
|
|
end,
|