summaryrefslogtreecommitdiff
path: root/src/rebar_prv_update.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_prv_update.erl')
-rw-r--r--src/rebar_prv_update.erl11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl
index 64fe65e..55c70e2 100644
--- a/src/rebar_prv_update.erl
+++ b/src/rebar_prv_update.erl
@@ -15,6 +15,15 @@
-define(PROVIDER, update).
-define(DEPS, []).
+%% Ignore warning of digraph opaque type when running dialyzer
+-dialyzer({no_opaque, do/1}).
+-dialyzer({no_opaque, write_registry/3}).
+
+%% Ignoring the opaque type warning won't stop dialyzer from warning of
+%% no return for functions that had the opaque type warnings
+-dialyzer({no_return, do/1}).
+-dialyzer({no_return, write_registry/3}).
+
%% ===================================================================
%% Public API
%% ===================================================================
@@ -50,6 +59,7 @@ do(State) ->
ok = file:write_file(HexFile, Unzipped),
{Dict, Graph} = hex_to_graph(HexFile),
write_registry(Dict, Graph, State),
+ true = digraph:delete(Graph),
ok
catch
_E:C ->
@@ -63,6 +73,7 @@ do(State) ->
format_error(package_index_write) ->
"Failed to write package index.".
+-spec write_registry(rebar_dict(), {digraph, ets:tid(), ets:tid(), ets:tid(), any()}, rebar_state:t()) -> ok | {error, atom()}.
write_registry(Dict, {digraph, Edges, Vertices, Neighbors, _}, State) ->
RegistryDir = rebar_packages:package_dir(State),
filelib:ensure_dir(filename:join(RegistryDir, "dummy")),