summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2015-04-08 23:08:18 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2015-04-08 23:08:18 +0200
commitbad3a795c82d22ee968f166088fafd5a4b349ad6 (patch)
treed206d9853c11250e0a114d9ad19b293f31618ae0 /bootstrap
parentb557e5fedcd95d9dc20ba1e0034b9bb7a6e41849 (diff)
downloadrebar-bad3a795c82d22ee968f166088fafd5a4b349ad6.tar.gz
Adapt to 18.x time api changes
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap13
1 files changed, 12 insertions, 1 deletions
diff --git a/bootstrap b/bootstrap
index 7d9a1c1..f58d562 100755
--- a/bootstrap
+++ b/bootstrap
@@ -121,10 +121,21 @@ rm(Path) ->
ok.
build_time() ->
- {{Y, M, D}, {H, Min, S}} = calendar:now_to_universal_time(now()),
+ {{Y, M, D}, {H, Min, S}} = calendar:now_to_universal_time(rebar_now()),
lists:flatten(io_lib:format("~4..0w~2..0w~2..0w_~2..0w~2..0w~2..0w",
[Y, M, D, H, Min, S])).
+%% Even though we don't have -mode(compile), erl_lint:module/1 is run in
+%% escript, so we still have to silence the deprecation warning.
+-compile({nowarn_deprecated_function, [{erlang, now, 0}]}).
+rebar_now() ->
+ case erlang:function_exported(erlang, timestamp, 0) of
+ true ->
+ erlang:timestamp();
+ false ->
+ now()
+ end.
+
vcs_info([]) ->
"No VCS info available.";
vcs_info([{Id, Dir, VsnCmd, StatusCmd} | Rest]) ->