summaryrefslogtreecommitdiff
path: root/src/rebar_prv_update.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_prv_update.erl')
-rw-r--r--src/rebar_prv_update.erl21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl
index ef6270a..f48b507 100644
--- a/src/rebar_prv_update.erl
+++ b/src/rebar_prv_update.erl
@@ -17,9 +17,9 @@
%% Public API
%% ===================================================================
--spec init(rebar_config:config()) -> {ok, rebar_config:config()}.
+-spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
init(State) ->
- State1 = rebar_config:add_provider(State, #provider{name = ?PROVIDER,
+ State1 = rebar_state:add_provider(State, #provider{name = ?PROVIDER,
provider_impl = ?MODULE,
bare = false,
deps = ?DEPS,
@@ -29,13 +29,13 @@ init(State) ->
opts = []}),
{ok, State1}.
--spec do(rebar_config:config()) -> {ok, rebar_config:config()} | relx:error().
+-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | relx:error().
do(Config) ->
- [Name] = rebar_config:command_args(Config),
+ [Name] = rebar_state:command_args(Config),
?INFO("Updating ~s~n", [Name]),
DepsDir = rebar_deps:get_deps_dir(Config),
- Deps = rebar_config:get_local(Config, deps, []),
+ Deps = rebar_state:get_local(Config, deps, []),
{_, _, Source} = lists:keyfind(list_to_atom(Name), 1, Deps),
TargetDir = rebar_deps:get_deps_dir(DepsDir, Name),
rebar_fetch:update_source1(TargetDir, Source),
@@ -43,14 +43,9 @@ do(Config) ->
[App] = rebar_app_discover:find_apps([TargetDir]),
{ok, AppInfo1} = rebar_otp_app:compile(Config, App),
- Config1 = rebar_config:replace_app(Config, rebar_app_info:name(AppInfo1), AppInfo1),
+ Config1 = rebar_state:replace_app(Config, rebar_app_info:name(AppInfo1), AppInfo1),
rebar_erlc_compiler:compile(Config, rebar_app_info:dir(AppInfo1)),
- update_lock_file(Config, AppInfo1, Source),
- {ok, Config}.
+ %update_lock_file(Config, AppInfo1, Source),
-update_lock_file(Config, App, Source) ->
- New = rebar_fetch:new(rebar_app_info:dir(App), rebar_app_info:name(App), rebar_app_info:original_vsn(App), Source),
- {ok, [Terms]} = file:consult("./rebar.lock"),
- LockDeps = lists:keyreplace(rebar_app_info:name(App), 1, Terms, New),
- ok = file:write_file("./rebar.lock", io_lib:format("~p.~n", [LockDeps])).
+ {ok, Config}.