summaryrefslogtreecommitdiff
path: root/src/rebar_appups.erl
diff options
context:
space:
mode:
authorjoewilliams <joe@joetify.com>2011-02-16 09:46:40 -0800
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2011-02-17 17:13:19 +0100
commit4e8dcfbfade08b48fe38bfe041459960b0ff74c3 (patch)
tree0692a946e174c73ea94d4bd1bd69633c7b72e3b0 /src/rebar_appups.erl
parent377c9e86d5f8e8cf24cc2b2feab54bda067f569b (diff)
downloadrebar-4e8dcfbfade08b48fe38bfe041459960b0ff74c3.tar.gz
Clean up rebar_appups and rebar_upgrade
Diffstat (limited to 'src/rebar_appups.erl')
-rw-r--r--src/rebar_appups.erl22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/rebar_appups.erl b/src/rebar_appups.erl
index b3a730e..dbc1561 100644
--- a/src/rebar_appups.erl
+++ b/src/rebar_appups.erl
@@ -40,13 +40,13 @@
'generate-appups'(_Config, ReltoolFile) ->
%% Get the old release path
- OldVerPath = rebar_utils:get_previous_release_path(),
+ OldVerPath = rebar_rel_utils:get_previous_release_path(),
%% Get the new and old release name and versions
- {Name, _Ver} = rebar_utils:get_reltool_release_info(ReltoolFile),
+ {Name, _Ver} = rebar_rel_utils:get_reltool_release_info(ReltoolFile),
NewVerPath = filename:join([".", Name]),
- {NewName, NewVer} = rebar_utils:get_rel_release_info(Name, NewVerPath),
- {OldName, OldVer} = rebar_utils:get_rel_release_info(Name, OldVerPath),
+ {NewName, NewVer} = rebar_rel_utils:get_rel_release_info(Name, NewVerPath),
+ {OldName, OldVer} = rebar_rel_utils:get_rel_release_info(Name, OldVerPath),
%% Run some simple checks
true = rebar_utils:prop_check(NewVer =/= OldVer,
@@ -86,8 +86,10 @@
%% ===================================================================
get_upgraded_apps(OldAppFiles, NewAppFiles) ->
- OldAppsVer = [get_app_version(AppFile) || AppFile <- OldAppFiles],
- NewAppsVer = [get_app_version(AppFile) || AppFile <- NewAppFiles],
+ OldAppsVer = [{rebar_app_utils:app_name(AppFile),
+ rebar_app_utils:app_vsn(AppFile)} || AppFile <- OldAppFiles],
+ NewAppsVer = [{rebar_app_utils:app_name(AppFile),
+ rebar_app_utils:app_vsn(AppFile)} || AppFile <- NewAppFiles],
UpgradedApps = lists:subtract(NewAppsVer, OldAppsVer),
lists:map(
fun({App, NewVer}) ->
@@ -96,14 +98,6 @@ get_upgraded_apps(OldAppFiles, NewAppFiles) ->
end,
UpgradedApps).
-get_app_version(File) ->
- case file:consult(File) of
- {ok,[{application, Name,[_,{vsn,Ver}|_]}]} ->
- {Name, Ver};
- _ ->
- ?ABORT("Failed to parse ~s~n", [File])
- end.
-
file_to_name(File) ->
filename:rootname(filename:basename(File)).