diff options
author | Jordan Wilberding <[email protected]> | 2013-01-25 15:52:50 -0800 |
---|---|---|
committer | Jordan Wilberding <[email protected]> | 2013-01-25 15:52:50 -0800 |
commit | 82fb9025b27af157ea046b59bb7450ca3b07ba8d (patch) | |
tree | 83043d60e0569dee2aff2fe76d9b8d91684f23ee | |
parent | e29f7fa585670f2bb1aad6060bfa2fe0aeba1cd8 (diff) | |
parent | 4025eca47e6f80316e7f4c63efc93e7195f419e4 (diff) | |
download | relx-82fb9025b27af157ea046b59bb7450ca3b07ba8d.tar.gz relx-82fb9025b27af157ea046b59bb7450ca3b07ba8d.tar.bz2 relx-82fb9025b27af157ea046b59bb7450ca3b07ba8d.zip |
Merge pull request #22 from ericbmerritt/next
support the discover task searching the output dir
-rw-r--r-- | src/rcl_prv_assembler.erl | 10 | ||||
-rw-r--r-- | src/rcl_prv_discover.erl | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/rcl_prv_assembler.erl b/src/rcl_prv_assembler.erl index 5488617..63bd167 100644 --- a/src/rcl_prv_assembler.erl +++ b/src/rcl_prv_assembler.erl @@ -127,6 +127,16 @@ copy_app(LibDir, App) -> AppVsn = rcl_app_info:vsn_as_string(App), AppDir = rcl_app_info:dir(App), TargetDir = filename:join([LibDir, AppName ++ "-" ++ AppVsn]), + if + AppDir == TargetDir -> + %% No need to do anything here, discover found something already in + %% a release dir + ok; + true -> + copy_app(App, AppDir, TargetDir) + end. + +copy_app(App, AppDir, TargetDir) -> remove_symlink_or_directory(TargetDir), case rcl_app_info:link(App) of true -> diff --git a/src/rcl_prv_discover.erl b/src/rcl_prv_discover.erl index 595902a..862bd6e 100644 --- a/src/rcl_prv_discover.erl +++ b/src/rcl_prv_discover.erl @@ -42,14 +42,13 @@ init(State) -> %% looking for OTP Applications -spec do(rcl_state:t()) -> {ok, rcl_state:t()} | relcool:error(). do(State) -> - OutputDir = rcl_state:output_dir(State), LibDirs = get_lib_dirs(State), rcl_log:info(rcl_state:log(State), fun() -> ["Resolving OTP Applications from directories:\n", [[rcl_util:indent(1), LibDir, "\n"] || LibDir <- LibDirs]] end), - resolve_app_metadata(State, LibDirs, OutputDir). + resolve_app_metadata(State, LibDirs). -spec format_error([ErrorDetail::term()]) -> iolist(). format_error(ErrorDetails) @@ -59,10 +58,9 @@ format_error(ErrorDetails) %%%=================================================================== %%% Internal Functions %%%=================================================================== -resolve_app_metadata(State, LibDirs, OutputDir) -> +resolve_app_metadata(State, LibDirs) -> AppMeta0 = lists:flatten(ec_plists:map(fun(LibDir) -> - discover_dir([OutputDir], - LibDir) + discover_dir([], LibDir) end, LibDirs)), AppMeta1 = setup_overrides(State, AppMeta0), |