summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2014-08-23 14:18:22 -0500
committerTristan Sloughter <t@crashfast.com>2014-08-23 14:18:22 -0500
commit5bb99b81db5f0b153282409d1fcf635b290e979f (patch)
tree7939b1f7cb6fda230f4707bc44292c8958757e3f /src
parentb37fe2c4bbe0e47399408f8feb59b5b0ab98a592 (diff)
switched package index to dict
Diffstat (limited to 'src')
-rw-r--r--src/rebar_base_compiler.erl12
-rw-r--r--src/rebar_deps.erl9
-rw-r--r--src/rebar_prv_update.erl6
3 files changed, 12 insertions, 15 deletions
diff --git a/src/rebar_base_compiler.erl b/src/rebar_base_compiler.erl
index 0536c06..e8fb26f 100644
--- a/src/rebar_base_compiler.erl
+++ b/src/rebar_base_compiler.erl
@@ -135,12 +135,12 @@ compile_each([], _Config, _CompileFn) ->
compile_each([Source | Rest], Config, CompileFn) ->
case compile(Source, Config, CompileFn) of
ok ->
- ?INFO("~sCompiled ~s\n", [rebar_utils:indent(1), Source]);
+ ?INFO("~sCompiled ~s\n", [rebar_utils:indent(1), filename:basename(Source)]);
{ok, Warnings} ->
report(Warnings),
- ?INFO("~sCompiled ~s\n", [rebar_utils:indent(1), Source]);
+ ?INFO("~sCompiled ~s\n", [rebar_utils:indent(1), filename:basename(Source)]);
skipped ->
- ?DEBUG("~sSkipped ~s\n", [rebar_utils:indent(1), Source]);
+ ?DEBUG("~sSkipped ~s\n", [rebar_utils:indent(1), filename:basename(Source)]);
Error ->
?INFO("Compiling ~s failed:\n",
[maybe_absname(Config, Source)]),
@@ -173,14 +173,14 @@ compile_queue(Config, Pids, Targets) ->
{compiled, Source, Warnings} ->
report(Warnings),
- ?INFO("~sCompiled ~s\n", [rebar_utils:indent(1), Source]),
+ ?INFO("~sCompiled ~s\n", [rebar_utils:indent(1), filename:basename(Source)]),
compile_queue(Config, Pids, Targets);
{compiled, Source} ->
- ?INFO("~sCompiled ~s\n", [rebar_utils:indent(1), Source]),
+ ?INFO("~sCompiled ~s\n", [rebar_utils:indent(1), filename:basename(Source)]),
compile_queue(Config, Pids, Targets);
{skipped, Source} ->
- ?DEBUG("~sSkipped ~s~n", [rebar_utils:indent(1), Source]),
+ ?DEBUG("~sSkipped ~s~n", [rebar_utils:indent(1), filename:basename(Source)]),
compile_queue(Config, Pids, Targets);
{'DOWN', Mref, _, Pid, normal} ->
?DEBUG("Worker exited cleanly\n", []),
diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl
index e050952..5165950 100644
--- a/src/rebar_deps.erl
+++ b/src/rebar_deps.erl
@@ -75,15 +75,12 @@ do(State) ->
atom_to_binary(Name, utf8)
end, Deps),
{ok, Solved} = rlx_depsolver:solve(Graph, Goals),
-
M = lists:map(fun({Name, Vsn}) ->
- {ok, P} = ec_lists:find(fun(App) ->
- Name =:= proplists:get_value(<<"name">>, App)
- andalso to_binary(rlx_depsolver:format_version(Vsn)) =:= proplists:get_value(<<"vsn">>, App)
- end, Packages),
+ FmtVsn = to_binary(rlx_depsolver:format_version(Vsn)),
+ {ok, P} = dict:find({Name, FmtVsn}, Packages),
Link = proplists:get_value(<<"link">>, P),
{Name, Vsn, {Name
- ,to_binary(rlx_depsolver:format_version(Vsn))
+ ,FmtVsn
,Link}}
end, Solved),
diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl
index 78c7c34..a12f5b0 100644
--- a/src/rebar_prv_update.erl
+++ b/src/rebar_prv_update.erl
@@ -47,12 +47,12 @@ do(State) ->
State1 = rebar_state:replace_app(State, rebar_app_info:name(AppInfo1), AppInfo1),
rebar_erlc_compiler:compile(State, rebar_app_info:dir(AppInfo1)),
- %update_lock_file(State, AppInfo1, Source),
+ %update_lock_file(State, AppInfo1, Source),
- {ok, State};
+ {ok, State1};
[] ->
?INFO("Updating package index...", []),
- Url = rebar_state:get(State, rebar_packages_url, ""),
+ Url = rebar_state:get(State, rebar_packages_url, "http://localhost:8080"),
ec_file:mkdir_p(filename:join([os:getenv("HOME"), ".rebar"])),
PackagesFile = filename:join([os:getenv("HOME"), ".rebar", "packages"]),
{ok, RequestId} = httpc:request(get, {Url, []}, [], [{stream, PackagesFile}, {sync, false}]),