aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorZandra Hird <[email protected]>2015-02-18 12:41:18 +0100
committerZandra Hird <[email protected]>2015-02-18 12:41:48 +0100
commitf473c64efaf61cb89b35934725e14b5a026f264c (patch)
treee86413117b5af9e7fe0cd10c5ae04f96b1082206 /lib/stdlib
parent2f0b4e88c1d91ee4c722b8e20e50a7170646fc33 (diff)
parent333c95a2df63a476896f410b84bc154785bd7ad1 (diff)
downloadotp-f473c64efaf61cb89b35934725e14b5a026f264c.tar.gz
otp-f473c64efaf61cb89b35934725e14b5a026f264c.tar.bz2
otp-f473c64efaf61cb89b35934725e14b5a026f264c.zip
Merge branch 'richcarl/shell-module-md5-info' into maint
* richcarl/shell-module-md5-info: make c:m/1 show module MD5 OTP-12500
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/src/c.erl17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/stdlib/src/c.erl b/lib/stdlib/src/c.erl
index c2256c0cf9..9860adf04d 100644
--- a/lib/stdlib/src/c.erl
+++ b/lib/stdlib/src/c.erl
@@ -509,9 +509,12 @@ m(M) ->
{exports,E} = lists:keyfind(exports, 1, L),
Time = get_compile_time(L),
COpts = get_compile_options(L),
- format("Module ~w compiled: ",[M]), print_time(Time),
- format("Compiler options: ~p~n", [COpts]),
+ format("Module: ~w~n", [M]),
+ print_md5(L),
+ format("Compiled: "),
+ print_time(Time),
print_object_file(M),
+ format("Compiler options: ~p~n", [COpts]),
format("Exports: ~n",[]), print_exports(keysort(1, E)).
print_object_file(Mod) ->
@@ -522,6 +525,12 @@ print_object_file(Mod) ->
ignore
end.
+print_md5(L) ->
+ case lists:keyfind(md5, 1, L) of
+ {md5,<<MD5:128>>} -> io:format("MD5: ~.16b~n",[MD5]);
+ _ -> ok
+ end.
+
get_compile_time(L) ->
case get_compile_info(L, time) of
{ok,Val} -> Val;
@@ -569,8 +578,8 @@ split_print_exports([{F1, A1}|T1], [{F2, A2} | T2]) ->
split_print_exports([], []) -> ok.
print_time({Year,Month,Day,Hour,Min,_Secs}) ->
- format("Date: ~s ~w ~w, ", [month(Month),Day,Year]),
- format("Time: ~.2.0w.~.2.0w~n", [Hour,Min]);
+ format("~s ~w ~w, ", [month(Month),Day,Year]),
+ format("~.2.0w:~.2.0w~n", [Hour,Min]);
print_time(notime) ->
format("No compile time info available~n",[]).