aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric <[email protected]>2012-09-17 12:08:10 -0500
committerEric <[email protected]>2012-09-18 10:05:08 -0700
commit8281dac892b5986e66d33b7ecad27b7a60216c29 (patch)
treeecad39e87c3548a665021f1d1d371efe6e2e381e /src
parentd084ff5556a67c1f93deddc50969362b2f2a5e6c (diff)
downloadrelx-8281dac892b5986e66d33b7ecad27b7a60216c29.tar.gz
relx-8281dac892b5986e66d33b7ecad27b7a60216c29.tar.bz2
relx-8281dac892b5986e66d33b7ecad27b7a60216c29.zip
suport the ability to update releases in the system
Diffstat (limited to 'src')
-rw-r--r--src/rcl_state.erl8
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).