summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-05-27 12:17:06 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2011-05-27 12:17:06 +0100
commit0789c270868aef8676bc5e1c389f6051c48b8b00 (patch)
treebb1ba9f8564b2c5f3b3f5304c37b088f109bdd1d
parente42b14f7a1378cada2ca6994472be83b5411446f (diff)
downloadrabbitmq-server-bug24079.tar.gz
In light of bug21782, solve the asymmetry problem the other way.bug24079
-rw-r--r--Makefile2
-rw-r--r--generate_app6
2 files changed, 4 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 3a40f606..c5d754ca 100644
--- a/Makefile
+++ b/Makefile
@@ -94,7 +94,7 @@ $(DEPS_FILE): $(SOURCES) $(INCLUDES)
echo $(subst : ,:,$(foreach FILE,$^,$(FILE):)) | escript generate_deps $@ $(EBIN_DIR)
$(EBIN_DIR)/rabbit.app: $(EBIN_DIR)/rabbit_app.in $(SOURCES) generate_app
- escript generate_app $@ $(SOURCE_DIR) < $<
+ escript generate_app $< $@ $(SOURCE_DIR)
$(EBIN_DIR)/%.beam: $(SOURCE_DIR)/%.erl | $(DEPS_FILE)
erlc $(ERLC_OPTS) -pa $(EBIN_DIR) $<
diff --git a/generate_app b/generate_app
index d8813542..fb0eb1ea 100644
--- a/generate_app
+++ b/generate_app
@@ -1,16 +1,16 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-main([TargetFile | SrcDirs]) ->
+main([InFile, OutFile | SrcDirs]) ->
Modules = [list_to_atom(filename:basename(F, ".erl")) ||
SrcDir <- SrcDirs,
F <- filelib:wildcard("*.erl", SrcDir)],
- {ok, {application, Application, Properties}} = io:read(''),
+ {ok, [{application, Application, Properties}]} = file:consult(InFile),
NewProperties =
case proplists:get_value(modules, Properties) of
[] -> lists:keyreplace(modules, 1, Properties, {modules, Modules});
_ -> Properties
end,
file:write_file(
- TargetFile,
+ OutFile,
io_lib:format("~p.~n", [{application, Application, NewProperties}])).