diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2015-06-03 21:42:11 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2015-06-08 01:05:12 +0200 |
commit | ded3be6e519b3192bc19671f2b44efe2dc004573 (patch) | |
tree | cbb22d45eb0d17072eb73f69ecc4746950a1556a /src | |
parent | a3713879b401a39b37505499e1a43ab164420354 (diff) | |
download | rebar-ded3be6e519b3192bc19671f2b44efe2dc004573.tar.gz |
erlc: do not crash if dep file cannot be found
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_erlc_compiler.erl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl index 937fe5f..5c33239 100644 --- a/src/rebar_erlc_compiler.erl +++ b/src/rebar_erlc_compiler.erl @@ -410,6 +410,8 @@ update_erlcinfo(G, Dirs, Source) -> %% The file doesn't exist anymore, %% erase it from the graph. %% All the edges will be erased automatically. + ?WARN("File missing. Remove from dep graph:~n~s~n", + [Source]), digraph:del_vertex(G, Source), modified; LastModified when LastUpdated < LastModified -> @@ -439,6 +441,9 @@ update_max_modified_deps(G, Source) -> digraph:add_vertex(G, Source, MaxModified), MaxModified. +modify_erlcinfo(_G, Source, 0, _Dirs) -> + ?WARN("modify_erlcinfo: failed to open file:~n~s~n", [Source]), + unmodified; modify_erlcinfo(G, Source, LastModified, Dirs) -> {ok, Fd} = file:open(Source, [read]), Incls = parse_attrs(Fd, []), |