diff options
-rw-r--r-- | src/rcl_state.erl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rcl_state.erl b/src/rcl_state.erl index 97d4e3d..298e60d 100644 --- a/src/rcl_state.erl +++ b/src/rcl_state.erl @@ -33,6 +33,7 @@ providers/2, add_release/2, get_release/3, + update_release/2, releases/1, default_release/1, default_release/3, @@ -126,6 +127,13 @@ add_release(M=#state_t{releases=Releases}, Release) -> Release, Releases)}. +-spec update_release(t(), rcl_release:t()) -> t(). +update_release(M=#state_t{releases=Releases}, Release) -> + M#state_t{releases=ec_dictionary:add({rcl_release:name(Release), + rcl_release:vsn(Release)}, + Release, + Releases)}. + -spec get_release(t(), rcl_release:name(), rcl_release:vsn()) -> rcl_release:t(). get_release(#state_t{releases=Releases}, Name, Vsn) -> ec_dictionary:get({Name, Vsn}, Releases). |