diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-02-03 15:03:23 +0000 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-02-11 21:57:58 +0000 |
commit | 9fb35fe6defb07dde99ba4442a66e3e6719c4d49 (patch) | |
tree | bb9b177652e420f5fe031f897df51a66f8b398e2 /src/rebar_prv_install_deps.erl | |
parent | b94afdfa2d44b0cb1489234c7746cd72f85a167d (diff) |
Alternative attempt
Diffstat (limited to 'src/rebar_prv_install_deps.erl')
-rw-r--r-- | src/rebar_prv_install_deps.erl | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index 49aa65c..094fae0 100644 --- a/src/rebar_prv_install_deps.erl +++ b/src/rebar_prv_install_deps.erl @@ -254,10 +254,9 @@ update_src_deps(Profile, Level, SrcDeps, PkgDeps, SrcApps, State, Update, Seen, {SeenAcc1, StateAcc1} = maybe_lock(Profile, AppInfo, SeenAcc, StateAcc, Level), {SrcDepsAcc1, PkgDepsAcc1, SrcAppsAcc1, StateAcc2, LocksAcc1} = case Update of - {true, UpdateName, UpdateLevel} -> + true -> + %{true, UpdateName, UpdateLevel} -> handle_update(AppInfo - ,UpdateName - ,UpdateLevel ,SrcDepsAcc ,PkgDepsAcc ,SrcAppsAcc @@ -285,14 +284,15 @@ update_src_deps(Profile, Level, SrcDeps, PkgDeps, SrcApps, State, Update, Seen, update_src_deps(Profile, Level+1, NewSrcDeps, NewPkgDeps, NewSrcApps, State1, Update, Seen1, NewLocks) end. -handle_update(AppInfo, UpdateName, UpdateLevel, SrcDeps, PkgDeps, SrcApps, Level, State, Locks) -> +handle_update(AppInfo, SrcDeps, PkgDeps, SrcApps, Level, State, Locks) -> Name = rebar_app_info:name(AppInfo), - {_, _, DepLevel} = lists:keyfind(Name, 1, Locks), - case UpdateLevel < DepLevel - orelse Name =:= UpdateName of - true -> + ct:pal("update ~p", [Name]), + case lists:keyfind(Name, 1, Locks) of + false -> + ct:pal("in lock"), case maybe_fetch(AppInfo, true, []) of true -> + ct:pal("fetch!"), handle_dep(AppInfo ,SrcDeps ,PkgDeps @@ -302,9 +302,11 @@ handle_update(AppInfo, UpdateName, UpdateLevel, SrcDeps, PkgDeps, SrcApps, Level ,Locks); false -> + ct:pal("nofetch"), {SrcDeps, PkgDeps, SrcApps, State, Locks} end; - false -> + _StillLocked -> + ct:pal("stillocked"), {SrcDeps, PkgDeps, SrcApps, State, Locks} end. |