diff options
author | Eric <[email protected]> | 2013-01-31 15:25:59 -0800 |
---|---|---|
committer | Eric <[email protected]> | 2013-01-31 15:25:59 -0800 |
commit | 367d9fdf1d577dd67990cdd4ad4480ba1130bc92 (patch) | |
tree | 2c2da7b7490e97c504985a1c984d0100a5760ef5 | |
parent | a7e6f77f4450cb5bef8c7da594449ff053123876 (diff) | |
download | relx-367d9fdf1d577dd67990cdd4ad4480ba1130bc92.tar.gz relx-367d9fdf1d577dd67990cdd4ad4480ba1130bc92.tar.bz2 relx-367d9fdf1d577dd67990cdd4ad4480ba1130bc92.zip |
fix release processing bugs in rcl_prv_release
-rw-r--r-- | src/rcl_prv_release.erl | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/rcl_prv_release.erl b/src/rcl_prv_release.erl index a98048f..4574a0e 100644 --- a/src/rcl_prv_release.erl +++ b/src/rcl_prv_release.erl @@ -101,36 +101,25 @@ find_default_release(State, DepGraph) -> end. resolve_default_release(State0, DepGraph) -> - %% Here we will just get the lastest version and run that. + %% Here we will just get the highest versioned release and run that. case lists:sort(fun release_sort/2, ec_dictionary:to_list(rcl_state:releases(State0))) of - All = [{{RelName, RelVsn}, _} | _] -> + [{{RelName, RelVsn}, _} | _] -> State1 = rcl_state:default_release(State0, RelName, RelVsn), - lists:foldl(fun({{RN, RV}, _}, {ok, State2}) -> - solve_release(State2, - DepGraph, RN, RV); - (_, E) -> - E - end, {ok, State1}, All); + solve_release(State1, DepGraph, RelName, RelVsn); [] -> ?RCL_ERROR(no_releases_in_system) end. - resolve_default_version(State0, DepGraph, RelName) -> %% Here we will just get the lastest version and run that. AllReleases = ec_dictionary:to_list(rcl_state:releases(State0)), SpecificReleases = [Rel || Rel={{PossibleRelName, _}, _} <- AllReleases, PossibleRelName =:= RelName], case lists:sort(fun release_sort/2, SpecificReleases) of - All = [{{RelName, RelVsn}, _} | _] -> + [{{RelName, RelVsn}, _} | _] -> State1 = rcl_state:default_release(State0, RelName, RelVsn), - lists:foldl(fun({RN, RV}, {ok, State2}) -> - solve_release(State2, - DepGraph, RN, RV); - (_, E) -> - E - end, {ok, State1}, All); + solve_release(State1, DepGraph, RelName, RelVsn); [] -> ?RCL_ERROR({no_releases_for, RelName}) end. @@ -150,7 +139,11 @@ release_sort({{RelNameA, RelVsnA}, _}, {{RelNameB, RelVsnB}, _}) -> ec_semver:lte(RelVsnA, RelVsnB). solve_release(State0, DepGraph, RelName, RelVsn) -> + rcl_log:debug(rcl_state:log(State0), + "Solving Release ~p-~s~n", + [RelName, RelVsn]), try + io:format("Solving ~p ~p", [RelName, RelVsn]), Release = rcl_state:get_release(State0, RelName, RelVsn), Goals = rcl_release:goals(Release), case Goals of @@ -176,7 +169,7 @@ set_resolved(State, Release0, Pkgs) -> "Resolved ~p-~s~n", [rcl_release:name(Release1), rcl_release:vsn(Release1)]), - rcl_log:info(rcl_state:log(State), + rcl_log:debug(rcl_state:log(State), fun() -> rcl_release:format(1, Release1) end), |