From c19b8ac0031877101d162294b1009a9d3e7829ec Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Wed, 28 Apr 2010 08:44:06 -0600 Subject: Refactoring app file access to be via rebar_app_utils in prep for supporting .app.src --- src/rebar_deps.erl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/rebar_deps.erl') diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl index 0ccd7ce..ec74e27 100644 --- a/src/rebar_deps.erl +++ b/src/rebar_deps.erl @@ -195,9 +195,9 @@ is_app_available(App, VsnRegex) -> is_app_available(App, VsnRegex, Path) -> case rebar_app_utils:is_app_dir(Path) of {true, AppFile} -> - case rebar_app_utils:load_app_file(AppFile) of - {ok, App, AppData} -> - {vsn, Vsn} = lists:keyfind(vsn, 1, AppData), + case rebar_app_utils:app_name(AppFile) of + App -> + Vsn = rebar_app_utils:app_vsn(AppFile), ?INFO("Looking for ~s-~s ; found ~s-~s at ~s\n", [App, VsnRegex, App, Vsn, Path]), case re:run(Vsn, VsnRegex, [{capture, none}]) of @@ -208,11 +208,9 @@ is_app_available(App, VsnRegex, Path) -> [AppFile, Vsn, VsnRegex]), false end; - {ok, OtherApp, _} -> + OtherApp -> ?WARN("~s has application id ~p; expected ~p\n", [AppFile, OtherApp, App]), - false; - {error, Reason} -> - ?ABORT("Failed to parse ~s: ~p\n", [AppFile, Reason]) + false end; false -> ?WARN("Expected ~s to be an app dir (containing ebin/*.app), but no .app found.\n", -- cgit v1.1