Blame otp-0007-Add-extra-search-directory.patch

205359
From: Peter Lemenkov <lemenkov@gmail.com>
205359
Date: Wed, 2 Aug 2017 16:12:19 +0300
205359
Subject: [PATCH] Add extra search directory
205359
205359
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
205359
205359
diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl
d8da3b
index 3ab50cafe0..f510535714 100644
205359
--- a/lib/kernel/src/code_server.erl
205359
+++ b/lib/kernel/src/code_server.erl
c76a75
@@ -79,11 +79,17 @@ init(Ref, Parent, [Root,Mode]) ->
205359
     IPath =
205359
 	case Mode of
205359
 	    interactive ->
205359
-		LibDir = filename:append(Root, "lib"),
205359
-		{ok,Dirs} = erl_prim_loader:list_dir(LibDir),
205359
-		Paths = make_path(LibDir, Dirs),
205359
+		F = fun(R) ->
205359
+			LD = filename:append(R, "lib"),
c76a75
+			case erl_prim_loader:list_dir(LD) of
c76a75
+				    error -> [];
c76a75
+				    {ok, D} -> make_path(LD, D)
c76a75
+			end
205359
+		    end,
205359
+		Paths = F(Root),
205359
+		SharedPaths = F("/usr/share/erlang"),
205359
 		UserLibPaths = get_user_lib_dirs(),
205359
-		["."] ++ UserLibPaths ++ Paths;
205359
+		["."] ++ UserLibPaths ++ Paths ++ SharedPaths;
205359
 	    _ ->
205359
 		[]
205359
 	end,