Browse Source

fix external build

Maxim Sokhatsky 11 years ago
parent
commit
a314891590
4 changed files with 8 additions and 4 deletions
  1. BIN
      mad
  2. 4 3
      rebar.config
  3. 1 0
      src/mad.erl
  4. 3 1
      src/mad_deps.erl

BIN
mad


+ 4 - 3
rebar.config

@@ -1,5 +1,6 @@
-{cache,"~/.mad/repos2"}.
+{cache,"~/.mad/repos"}.
+{deps_dir,"../../mad-deps"}.
 {deps, [
-        {getopt, ".*",   {git, "git@github.com:jcomellas/getopt.git", {tag, "v0.8.2"}}}
-%        {n2o, ".*",   {git, "git@github.com:5HT/n2o.git", master}}
+        {getopt, ".*",   {git, "git@github.com:jcomellas/getopt.git", {tag, "v0.8.2"}}},
+        {n2o, ".*",   {git, "git@github.com:5HT/n2o.git", master}}
        ]}.

+ 1 - 0
src/mad.erl

@@ -42,6 +42,7 @@ main(Args) ->
                 deps_fetch -> skip;
                 Dir -> file:make_dir(Dir) end,
             FetchDir = mad_utils:get_value(deps_dir, Conf, ["deps"]),
+            io:format("Make Fetch Dir: ~p",[FetchDir]),
             file:make_dir(FetchDir),
             mad_deps:fetch(Cwd, Conf, ConfigFile, Deps)
     end.

+ 3 - 1
src/mad_deps.erl

@@ -57,7 +57,9 @@ fetch_dep(Cwd, Config, ConfigFile, Name, Cmd, Uri, Co, Cache) ->
 -spec build_dep(directory(), any(), string(), string(), string(), string(), string(), string()) -> ok.
 build_dep(Cwd, Conf, _ConfFile, Publisher, Name, Cmd, Co, Dir) ->
     TrunkPath = filename:join([Dir, Publisher, Name]),
-    DepsDir = mad_utils:get_value(deps_dir, Conf, ["deps"]),
+    io:format("Cache Dir: ~p~n",[TrunkPath]),
+    DepsDir = filename:join([mad_utils:get_value(deps_dir, Conf, ["deps"]),Name]),
+    io:format("Deps Dir: ~p~n",[DepsDir]),
     mad_utils:exec("cp", ["-r", TrunkPath, DepsDir]),
     ok = file:set_cwd(DepsDir),
     mad_utils:exec(Cmd, ["checkout", lists:concat([Co])]),