erlang-rebar/rebar-0005-Check-system-wide-libdir-in-case-of-source-based-dep.patch
Peter Lemenkov 9339c89dc5 Fix dependency issues mentioned by automatic dependency checker
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2016-03-02 15:40:32 +03:00

25 lines
972 B
Diff

From: Peter Lemenkov <lemenkov@gmail.com>
Date: Sat, 2 Mar 2013 10:39:15 +0400
Subject: [PATCH] Check system-wide libdir in case of source-based dependency
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl
index a6e5b27..ba2b4e8 100644
--- a/src/rebar_deps.erl
+++ b/src/rebar_deps.erl
@@ -393,7 +393,12 @@ find_dep(Config, Dep, _Source) ->
%% _Source is defined. Regardless of what it is, we must find it
%% locally satisfied or fetch it from the original source
%% into the project's deps
- find_dep_in_dir(Config, Dep, get_deps_dir(Config, Dep#dep.app)).
+ case find_dep_in_dir(Config, Dep, get_deps_dir(Config, Dep#dep.app)) of
+ {_Config1, {avail, _Dir}} = Avail ->
+ Avail;
+ {Config1, {missing, _}} ->
+ find_dep_in_dir(Config1, Dep, get_lib_dir(Dep#dep.app))
+ end.
find_dep_in_dir(Config, _Dep, {false, Dir}) ->
{Config, {missing, Dir}};