Blame otp-0009-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
205359
index 59b26176bf..5f3d68db2a 100644
205359
--- a/lib/kernel/src/code_server.erl
205359
+++ b/lib/kernel/src/code_server.erl
205359
@@ -79,11 +79,15 @@ 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"),
205359
+			{ok,D} = erl_prim_loader:list_dir(LD),
205359
+			make_path(LD, D)
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,