summaryrefslogtreecommitdiffstats
path: root/erlang-find-provides.escript
diff options
context:
space:
mode:
authorPeter Lemenkov <peter@fedoraproject.org>2010-04-14 09:57:54 +0000
committerPeter Lemenkov <peter@fedoraproject.org>2010-04-14 09:57:54 +0000
commit5ae82a9a22183221a4647d0f735ad1a59baabcfc (patch)
tree2f54ee04bac02449b541af60c61833a5e5eb1a31 /erlang-find-provides.escript
parent7bd9f6ffbe0d54b929432b5717fdb26aff1cd030 (diff)
downloaderlang-5ae82a9a22183221a4647d0f735ad1a59baabcfc.tar.gz
erlang-5ae82a9a22183221a4647d0f735ad1a59baabcfc.tar.xz
erlang-5ae82a9a22183221a4647d0f735ad1a59baabcfc.zip
Added rpm macros and more cleanups
Diffstat (limited to 'erlang-find-provides.escript')
-rwxr-xr-xerlang-find-provides.escript24
1 files changed, 24 insertions, 0 deletions
diff --git a/erlang-find-provides.escript b/erlang-find-provides.escript
new file mode 100755
index 0000000..4433337
--- /dev/null
+++ b/erlang-find-provides.escript
@@ -0,0 +1,24 @@
+#!/usr/bin/escript
+%% -*- erlang -*-
+
+main(EbinFiles) ->
+ lists:foreach(
+ fun(BeamFile) ->
+ try
+ {ok, {Module, [{exports,Exports}]}} = beam_lib:chunks(BeamFile, [exports]),
+ case Module of
+ eunit_test -> io:format ("erlang(eunit_test:nonexisting_function/0)~n");
+ wx -> io:format ("erlang(demo:start/0)~n");
+ _ -> ok
+ end,
+ lists:foreach( fun({ModFun,Arity})->io:format("erlang(~p:~s/~p)~n", [Module, ModFun,Arity]) end, Exports)
+ catch
+ _:_ ->
+ ok
+ end
+ end,
+ EbinFiles);
+
+main(_) ->
+ halt(1).
+