diff options
author | Peter Lemenkov <peter@fedoraproject.org> | 2010-04-14 09:57:54 +0000 |
---|---|---|
committer | Peter Lemenkov <peter@fedoraproject.org> | 2010-04-14 09:57:54 +0000 |
commit | 5ae82a9a22183221a4647d0f735ad1a59baabcfc (patch) | |
tree | 2f54ee04bac02449b541af60c61833a5e5eb1a31 /erlang-find-requires.escript | |
parent | 7bd9f6ffbe0d54b929432b5717fdb26aff1cd030 (diff) | |
download | erlang-5ae82a9a22183221a4647d0f735ad1a59baabcfc.tar.gz erlang-5ae82a9a22183221a4647d0f735ad1a59baabcfc.tar.xz erlang-5ae82a9a22183221a4647d0f735ad1a59baabcfc.zip |
Added rpm macros and more cleanups
Diffstat (limited to 'erlang-find-requires.escript')
-rwxr-xr-x | erlang-find-requires.escript | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/erlang-find-requires.escript b/erlang-find-requires.escript new file mode 100755 index 0000000..1a16f76 --- /dev/null +++ b/erlang-find-requires.escript @@ -0,0 +1,19 @@ +#!/usr/bin/escript +%% -*- erlang -*- + +main(EbinFiles) -> + lists:foreach( + fun(BeamFile) -> + try + {ok, {_Module, [{imports,Imports}]}} = beam_lib:chunks(BeamFile, [imports]), + lists:foreach( fun({ModName,ModFun,Arity})->io:format("erlang(~s:~s/~p)~n", [ModName,ModFun,Arity]) end, Imports) + catch + _:_ -> + ok + end + end, + EbinFiles); + +main(_) -> + halt(1). + |