From 793b15f9f18b32a45a4a1a92b632cb363234bff2 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 23 Aug 2014 15:10:07 -0500 Subject: rename deps provider --- src/rebar_deps.erl | 252 ------------------------------------------------ src/rebar_prv_deps.erl | 252 ++++++++++++++++++++++++++++++++++++++++++++++++ src/rebar_templater.erl | 62 ++++++------ 3 files changed, 283 insertions(+), 283 deletions(-) delete mode 100644 src/rebar_deps.erl create mode 100644 src/rebar_prv_deps.erl (limited to 'src') diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl deleted file mode 100644 index 5165950..0000000 --- a/src/rebar_deps.erl +++ /dev/null @@ -1,252 +0,0 @@ -%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- -%% ex: ts=4 sw=4 et -%% ------------------------------------------------------------------- -%% -%% rebar: Erlang Build Tools -%% -%% Copyright (c) 2009 Dave Smith (dizzyd@dizzyd.com) -%% -%% Permission is hereby granted, free of charge, to any person obtaining a copy -%% of this software and associated documentation files (the "Software"), to deal -%% in the Software without restriction, including without limitation the rights -%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -%% copies of the Software, and to permit persons to whom the Software is -%% furnished to do so, subject to the following conditions: -%% -%% The above copyright notice and this permission notice shall be included in -%% all copies or substantial portions of the Software. -%% -%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -%% THE SOFTWARE. -%% ------------------------------------------------------------------- --module(rebar_deps). - --behaviour(rebar_provider). - --export([init/1, - do/1]). - --include("rebar.hrl"). - --export([setup_env/1]). - -%% for internal use only --export([get_deps_dir/1]). --export([get_deps_dir/2]). - --define(PROVIDER, deps). --define(DEPS, [app_discovery]). - -%% =================================================================== -%% Public API -%% =================================================================== - --spec init(rebar_state:t()) -> {ok, rebar_state:t()}. -init(State) -> - State1 = rebar_state:add_provider(State, #provider{name = ?PROVIDER, - provider_impl = ?MODULE, - bare = false, - deps = ?DEPS, - example = "rebar deps", - short_desc = "Install dependencies", - desc = info_help("Install dependencies"), - opts = []}), - {ok, State1}. - --spec do(rebar_state:t()) -> {ok, rebar_state:t()}. -do(State) -> - %% Read in package index and dep graph - {Packages, Graph} = get_packages(State), - SrcDeps = rebar_state:get(State, src_deps, []), - {State1, SrcDeps1} = update_deps(State, SrcDeps), - - case rebar_state:get(State1, deps, []) of - [] -> - {ok, rebar_state:set(State1, deps, SrcDeps1)}; - Deps -> - Goals = lists:map(fun({Name, Vsn}) -> - {atom_to_binary(Name, utf8), Vsn}; - (Name) -> - atom_to_binary(Name, utf8) - end, Deps), - {ok, Solved} = rlx_depsolver:solve(Graph, Goals), - M = lists:map(fun({Name, Vsn}) -> - FmtVsn = to_binary(rlx_depsolver:format_version(Vsn)), - {ok, P} = dict:find({Name, FmtVsn}, Packages), - Link = proplists:get_value(<<"link">>, P), - {Name, Vsn, {Name - ,FmtVsn - ,Link}} - end, Solved), - - {State2, Deps1} = update_deps(State1, M), - State3 = rebar_state:set(State2, deps, Deps1), - - {ok, rebar_state:set(State3, goals, Goals)} - end. - -update_deps(State, Deps) -> - DepsDir = get_deps_dir(State), - - %% Find available apps to fulfill dependencies - %% Should only have to do this once, not every iteration - UnbuiltApps = rebar_app_discover:find_unbuilt_apps([DepsDir]), - FoundApps = rebar_app_discover:find_apps([DepsDir]), - - %% Resolve deps and their dependencies - Deps1 = handle_deps(Deps, UnbuiltApps++FoundApps), - - case download_missing_deps(State, DepsDir, FoundApps, UnbuiltApps, Deps1) of - {State1, []} -> - {State1, Deps1}; - {State1, _} -> - update_deps(State1, Deps1) - end. - -handle_deps(Deps, Found) -> - NewDeps = - lists:foldl(fun(X, DepsAcc) -> - C = rebar_config:consult(rebar_app_info:dir(X)), - S = rebar_state:new(rebar_state:new(), C, rebar_app_info:dir(X)), - LocalDeps = rebar_state:get(S, deps, []), - [LocalDeps | DepsAcc] - end, [], Found), - NewDeps1 = lists:flatten(NewDeps), - - %% Weed out duplicates - lists:umerge(fun(A, B) -> - dep_name(A) =:= dep_name(B) - end, lists:usort(Deps), lists:usort(NewDeps1)). - -dep_name({Name, _, _}) -> - Name; -dep_name({Name, _}) -> - Name; -dep_name(Name) -> - Name. - - -to_binary(X) when is_binary(X) -> - X; -to_binary(X) when is_atom(X) -> - atom_to_binary(X, utf8); -to_binary(X) when is_list(X) -> - iolist_to_binary(X). - -download_missing_deps(State, DepsDir, Found, Unbuilt, Deps) -> - Missing = lists:filter(fun(X) -> - not lists:any(fun(F) -> - to_binary(dep_name(X)) =:= to_binary(rebar_app_info:name(F)) - end, Found++Unbuilt) - end, Deps), - lists:foreach(fun({DepName, _DepVsn, DepSource}) -> - TargetDir = get_deps_dir(DepsDir, DepName), - case filelib:is_dir(TargetDir) of - true -> - ok; - false -> - ?INFO("Fetching ~s ~s~n", [element(1, DepSource) - ,element(2, DepSource)]), - rebar_fetch:download_source(TargetDir, DepSource) - end - end, Missing), - - State1 = lists:foldl(fun(X, StateAcc) -> - TargetDir = get_deps_dir(DepsDir, dep_name(X)), - case rebar_app_discover:find_unbuilt_apps([TargetDir]) of - [AppSrc] -> - {_AppInfo1, StateAcc1} = rebar_prv_app_builder:build(StateAcc, AppSrc), - StateAcc1; - [] -> - StateAcc - end - end, State, Missing), - - {State1, []}. - -%% set REBAR_DEPS_DIR and ERL_LIBS environment variables -setup_env(State) -> - DepsDir = get_deps_dir(State), - %% include rebar's DepsDir in ERL_LIBS - Separator = case os:type() of - {win32, nt} -> - ";"; - _ -> - ":" - end, - ERL_LIBS = case os:getenv("ERL_LIBS") of - false -> - {"ERL_LIBS", DepsDir}; - PrevValue -> - {"ERL_LIBS", DepsDir ++ Separator ++ PrevValue} - end, - [{"REBAR_DEPS_DIR", DepsDir}, ERL_LIBS]. - - -get_deps_dir(State) -> - BaseDir = rebar_state:get(State, base_dir, ""), - get_deps_dir(BaseDir, "deps"). - -get_deps_dir(DepsDir, App) -> - filename:join(DepsDir, App). - -%% =================================================================== -%% Internal functions -%% =================================================================== - -get_packages(State) -> - RebarDir = rebar_state:get(State, global_rebar_dir, filename:join(os:getenv("HOME"), ".rebar")), - PackagesFile = filename:join(RebarDir, "packages"), - case ec_file:exists(PackagesFile) of - true -> - try - {ok, Binary} = file:read_file(PackagesFile), - binary_to_term(Binary) - catch - _:_ -> - ?ERROR("Bad packages index, try to fix with `rebar update`~n", []), - {[], rlx_depsolver:new()} - end; - false -> - {[], rlx_depsolver:new()} - end. - -info_help(Description) -> - io_lib:format("~s.~n" - "~n" - "Valid rebar.config options:~n" - " ~p~n" - " ~p~n" - "Valid command line options:~n" - " deps_dir=\"deps\" (override default or rebar.config deps_dir)~n", - [ - Description, - {deps_dir, "deps"}, - {deps, - [app_name, - {rebar, "1.0.*"}, - {rebar, ".*", - {git, "git://github.com/rebar/rebar.git"}}, - {rebar, ".*", - {git, "git://github.com/rebar/rebar.git", "Rev"}}, - {rebar, "1.0.*", - {git, "git://github.com/rebar/rebar.git", {branch, "master"}}}, - {rebar, "1.0.0", - {git, "git://github.com/rebar/rebar.git", {tag, "1.0.0"}}}, - {rebar, "", - {git, "git://github.com/rebar/rebar.git", {branch, "master"}}, - [raw]}, - {app_name, ".*", {hg, "https://www.example.org/url"}}, - {app_name, ".*", {rsync, "Url"}}, - {app_name, ".*", {svn, "https://www.example.org/url"}}, - {app_name, ".*", {svn, "svn://svn.example.org/url"}}, - {app_name, ".*", {bzr, "https://www.example.org/url", "Rev"}}, - {app_name, ".*", {fossil, "https://www.example.org/url"}}, - {app_name, ".*", {fossil, "https://www.example.org/url", "Vsn"}}, - {app_name, ".*", {p4, "//depot/subdir/app_dir"}}]} - ]). diff --git a/src/rebar_prv_deps.erl b/src/rebar_prv_deps.erl new file mode 100644 index 0000000..0efc39d --- /dev/null +++ b/src/rebar_prv_deps.erl @@ -0,0 +1,252 @@ +%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- +%% ex: ts=4 sw=4 et +%% ------------------------------------------------------------------- +%% +%% rebar: Erlang Build Tools +%% +%% Copyright (c) 2009 Dave Smith (dizzyd@dizzyd.com) +%% +%% Permission is hereby granted, free of charge, to any person obtaining a copy +%% of this software and associated documentation files (the "Software"), to deal +%% in the Software without restriction, including without limitation the rights +%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +%% copies of the Software, and to permit persons to whom the Software is +%% furnished to do so, subject to the following conditions: +%% +%% The above copyright notice and this permission notice shall be included in +%% all copies or substantial portions of the Software. +%% +%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +%% THE SOFTWARE. +%% ------------------------------------------------------------------- +-module(rebar_prv_deps). + +-behaviour(rebar_provider). + +-export([init/1, + do/1]). + +-include("rebar.hrl"). + +-export([setup_env/1]). + +%% for internal use only +-export([get_deps_dir/1]). +-export([get_deps_dir/2]). + +-define(PROVIDER, deps). +-define(DEPS, [app_discovery]). + +%% =================================================================== +%% Public API +%% =================================================================== + +-spec init(rebar_state:t()) -> {ok, rebar_state:t()}. +init(State) -> + State1 = rebar_state:add_provider(State, #provider{name = ?PROVIDER, + provider_impl = ?MODULE, + bare = false, + deps = ?DEPS, + example = "rebar deps", + short_desc = "Install dependencies", + desc = info_help("Install dependencies"), + opts = []}), + {ok, State1}. + +-spec do(rebar_state:t()) -> {ok, rebar_state:t()}. +do(State) -> + %% Read in package index and dep graph + {Packages, Graph} = get_packages(State), + SrcDeps = rebar_state:get(State, src_deps, []), + {State1, SrcDeps1} = update_deps(State, SrcDeps), + + case rebar_state:get(State1, deps, []) of + [] -> + {ok, rebar_state:set(State1, deps, SrcDeps1)}; + Deps -> + Goals = lists:map(fun({Name, Vsn}) -> + {atom_to_binary(Name, utf8), Vsn}; + (Name) -> + atom_to_binary(Name, utf8) + end, Deps), + {ok, Solved} = rlx_depsolver:solve(Graph, Goals), + M = lists:map(fun({Name, Vsn}) -> + FmtVsn = to_binary(rlx_depsolver:format_version(Vsn)), + {ok, P} = dict:find({Name, FmtVsn}, Packages), + Link = proplists:get_value(<<"link">>, P), + {Name, Vsn, {Name + ,FmtVsn + ,Link}} + end, Solved), + + {State2, Deps1} = update_deps(State1, M), + State3 = rebar_state:set(State2, deps, Deps1), + + {ok, rebar_state:set(State3, goals, Goals)} + end. + +update_deps(State, Deps) -> + DepsDir = get_deps_dir(State), + + %% Find available apps to fulfill dependencies + %% Should only have to do this once, not every iteration + UnbuiltApps = rebar_app_discover:find_unbuilt_apps([DepsDir]), + FoundApps = rebar_app_discover:find_apps([DepsDir]), + + %% Resolve deps and their dependencies + Deps1 = handle_deps(Deps, UnbuiltApps++FoundApps), + + case download_missing_deps(State, DepsDir, FoundApps, UnbuiltApps, Deps1) of + {State1, []} -> + {State1, Deps1}; + {State1, _} -> + update_deps(State1, Deps1) + end. + +handle_deps(Deps, Found) -> + NewDeps = + lists:foldl(fun(X, DepsAcc) -> + C = rebar_config:consult(rebar_app_info:dir(X)), + S = rebar_state:new(rebar_state:new(), C, rebar_app_info:dir(X)), + LocalDeps = rebar_state:get(S, deps, []), + [LocalDeps | DepsAcc] + end, [], Found), + NewDeps1 = lists:flatten(NewDeps), + + %% Weed out duplicates + lists:umerge(fun(A, B) -> + dep_name(A) =:= dep_name(B) + end, lists:usort(Deps), lists:usort(NewDeps1)). + +dep_name({Name, _, _}) -> + Name; +dep_name({Name, _}) -> + Name; +dep_name(Name) -> + Name. + + +to_binary(X) when is_binary(X) -> + X; +to_binary(X) when is_atom(X) -> + atom_to_binary(X, utf8); +to_binary(X) when is_list(X) -> + iolist_to_binary(X). + +download_missing_deps(State, DepsDir, Found, Unbuilt, Deps) -> + Missing = lists:filter(fun(X) -> + not lists:any(fun(F) -> + to_binary(dep_name(X)) =:= to_binary(rebar_app_info:name(F)) + end, Found++Unbuilt) + end, Deps), + lists:foreach(fun({DepName, _DepVsn, DepSource}) -> + TargetDir = get_deps_dir(DepsDir, DepName), + case filelib:is_dir(TargetDir) of + true -> + ok; + false -> + ?INFO("Fetching ~s ~s~n", [element(1, DepSource) + ,element(2, DepSource)]), + rebar_fetch:download_source(TargetDir, DepSource) + end + end, Missing), + + State1 = lists:foldl(fun(X, StateAcc) -> + TargetDir = get_deps_dir(DepsDir, dep_name(X)), + case rebar_app_discover:find_unbuilt_apps([TargetDir]) of + [AppSrc] -> + {_AppInfo1, StateAcc1} = rebar_prv_app_builder:build(StateAcc, AppSrc), + StateAcc1; + [] -> + StateAcc + end + end, State, Missing), + + {State1, []}. + +%% set REBAR_DEPS_DIR and ERL_LIBS environment variables +setup_env(State) -> + DepsDir = get_deps_dir(State), + %% include rebar's DepsDir in ERL_LIBS + Separator = case os:type() of + {win32, nt} -> + ";"; + _ -> + ":" + end, + ERL_LIBS = case os:getenv("ERL_LIBS") of + false -> + {"ERL_LIBS", DepsDir}; + PrevValue -> + {"ERL_LIBS", DepsDir ++ Separator ++ PrevValue} + end, + [{"REBAR_DEPS_DIR", DepsDir}, ERL_LIBS]. + + +get_deps_dir(State) -> + BaseDir = rebar_state:get(State, base_dir, ""), + get_deps_dir(BaseDir, "deps"). + +get_deps_dir(DepsDir, App) -> + filename:join(DepsDir, App). + +%% =================================================================== +%% Internal functions +%% =================================================================== + +get_packages(State) -> + RebarDir = rebar_state:get(State, global_rebar_dir, filename:join(os:getenv("HOME"), ".rebar")), + PackagesFile = filename:join(RebarDir, "packages"), + case ec_file:exists(PackagesFile) of + true -> + try + {ok, Binary} = file:read_file(PackagesFile), + binary_to_term(Binary) + catch + _:_ -> + ?ERROR("Bad packages index, try to fix with `rebar update`~n", []), + {[], rlx_depsolver:new()} + end; + false -> + {[], rlx_depsolver:new()} + end. + +info_help(Description) -> + io_lib:format("~s.~n" + "~n" + "Valid rebar.config options:~n" + " ~p~n" + " ~p~n" + "Valid command line options:~n" + " deps_dir=\"deps\" (override default or rebar.config deps_dir)~n", + [ + Description, + {deps_dir, "deps"}, + {deps, + [app_name, + {rebar, "1.0.*"}, + {rebar, ".*", + {git, "git://github.com/rebar/rebar.git"}}, + {rebar, ".*", + {git, "git://github.com/rebar/rebar.git", "Rev"}}, + {rebar, "1.0.*", + {git, "git://github.com/rebar/rebar.git", {branch, "master"}}}, + {rebar, "1.0.0", + {git, "git://github.com/rebar/rebar.git", {tag, "1.0.0"}}}, + {rebar, "", + {git, "git://github.com/rebar/rebar.git", {branch, "master"}}, + [raw]}, + {app_name, ".*", {hg, "https://www.example.org/url"}}, + {app_name, ".*", {rsync, "Url"}}, + {app_name, ".*", {svn, "https://www.example.org/url"}}, + {app_name, ".*", {svn, "svn://svn.example.org/url"}}, + {app_name, ".*", {bzr, "https://www.example.org/url", "Rev"}}, + {app_name, ".*", {fossil, "https://www.example.org/url"}}, + {app_name, ".*", {fossil, "https://www.example.org/url", "Vsn"}}, + {app_name, ".*", {p4, "//depot/subdir/app_dir"}}]} + ]). diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl index 820bd0c..9664b2e 100644 --- a/src/rebar_templater.erl +++ b/src/rebar_templater.erl @@ -42,16 +42,16 @@ %% Public API %% =================================================================== -new(app, DirName, Config) -> - create1(Config, DirName, "simpleapp"); -new(lib, DirName, Config) -> - create1(Config, DirName, "simplelib"); -new(node, DirName, Config) -> +new(app, DirName, State) -> + create1(State, DirName, "simpleapp"); +new(lib, DirName, State) -> + create1(State, DirName, "simplelib"); +new(node, DirName, State) -> %% Alias for create w/ template=simplenode - create1(Config, DirName, "simplenode"). + create1(State, DirName, "simplenode"). -list_templates(Config) -> - {AvailTemplates, Files} = find_templates(Config), +list_templates(State) -> + {AvailTemplates, Files} = find_templates(State), ?DEBUG("Available templates: ~p\n", [AvailTemplates]), lists:foreach( @@ -67,9 +67,9 @@ list_templates(Config) -> end, AvailTemplates), ok. -create(Config) -> - TemplateId = template_id(Config), - create1(Config, "", TemplateId). +create(State) -> + TemplateId = template_id(State), + create1(State, "", TemplateId). %% %% Given a list of key value pairs, for each string value attempt to @@ -100,10 +100,10 @@ render(Bin, Context) -> %% Internal functions %% =================================================================== -create1(Config, AppDir, TemplateId) -> +create1(State, AppDir, TemplateId) -> ec_file:mkdir_p(AppDir), file:set_cwd(AppDir), - {AvailTemplates, Files} = find_templates(Config), + {AvailTemplates, Files} = find_templates(State), ?DEBUG("Available templates: ~p\n", [AvailTemplates]), %% Using the specified template id, find the matching template file/type. @@ -134,7 +134,7 @@ create1(Config, AppDir, TemplateId) -> end, %% Load variables from disk file, if provided - Context1 = case rebar_state:get(Config, template_vars, undefined) of + Context1 = case rebar_state:get(State, template_vars, undefined) of undefined -> Context0; File -> @@ -151,7 +151,7 @@ create1(Config, AppDir, TemplateId) -> %% For each variable, see if it's defined in global vars -- if it is, %% prefer that value over the defaults - Context2 = update_vars(Config, dict:fetch_keys(Context1), Context1), + Context2 = update_vars(State, dict:fetch_keys(Context1), Context1), ?DEBUG("Template ~p context: ~p\n", [TemplateId, dict:to_list(Context1)]), %% Handle variables that possibly include other variables in their @@ -167,17 +167,17 @@ create1(Config, AppDir, TemplateId) -> ?DEBUG("Final template def ~p: ~p\n", [TemplateId, FinalTemplate]), %% Execute the instructions in the finalized template - Force = rebar_state:get(Config, force, "0"), + Force = rebar_state:get(State, force, "0"), execute_template(Files, FinalTemplate, Type, Template, Context, Force, []). -find_templates(Config) -> +find_templates(State) -> %% Load a list of all the files in the escript -- cache them since %% we'll potentially need to walk it several times over the course of %% a run. - Files = cache_escript_files(Config), + Files = cache_escript_files(State), %% Build a list of available templates - AvailTemplates = find_disk_templates(Config) + AvailTemplates = find_disk_templates(State) ++ find_escript_templates(Files), {AvailTemplates, Files}. @@ -185,16 +185,16 @@ find_templates(Config) -> %% %% Scan the current escript for available files %% -cache_escript_files(Config) -> +cache_escript_files(State) -> {ok, Files} = rebar_utils:escript_foldl( fun(Name, _, GetBin, Acc) -> [{Name, GetBin()} | Acc] end, - [], rebar_state:get(Config, escript)), + [], rebar_state:get(State, escript)), Files. -template_id(Config) -> - case rebar_state:get(Config, template, undefined) of +template_id(State) -> + case rebar_state:get(State, template, undefined) of undefined -> ?ABORT("No template specified.\n", []); TemplateId -> @@ -206,16 +206,16 @@ find_escript_templates(Files) -> || {Name, _Bin} <- Files, re:run(Name, ?TEMPLATE_RE, [{capture, none}]) == match]. -find_disk_templates(Config) -> - OtherTemplates = find_other_templates(Config), +find_disk_templates(State) -> + OtherTemplates = find_other_templates(State), HomeFiles = rebar_utils:find_files(filename:join([os:getenv("HOME"), ".rebar", "templates"]), ?TEMPLATE_RE), LocalFiles = rebar_utils:find_files(".", ?TEMPLATE_RE, true), [{file, F} || F <- OtherTemplates ++ HomeFiles ++ LocalFiles]. -find_other_templates(Config) -> - case rebar_state:get(Config, template_dir, undefined) of +find_other_templates(State) -> + case rebar_state:get(State, template_dir, undefined) of undefined -> []; TemplateDir -> @@ -258,11 +258,11 @@ parse_vars(Other, _Dict) -> %% Given a list of keys in Dict, see if there is a corresponding value defined %% in the global config; if there is, update the key in Dict with it %% -update_vars(_Config, [], Dict) -> +update_vars(_State, [], Dict) -> Dict; -update_vars(Config, [Key | Rest], Dict) -> - Value = rebar_state:get(Config, Key, dict:fetch(Key, Dict)), - update_vars(Config, Rest, dict:store(Key, Value, Dict)). +update_vars(State, [Key | Rest], Dict) -> + Value = rebar_state:get(State, Key, dict:fetch(Key, Dict)), + update_vars(State, Rest, dict:store(Key, Value, Dict)). %% -- cgit v1.1