summaryrefslogtreecommitdiff
path: root/src/rebar_packages.erl
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2014-11-22 09:13:10 -0600
committerTristan Sloughter <t@crashfast.com>2014-11-22 20:24:21 -0600
commitaf35d5f0a2c91319fc86c5bb4a9d018658519c4c (patch)
tree81513a265a2710a36a83b69e0758c3fcd0d5b61a /src/rebar_packages.erl
parentf22db1302d710fbf017108852991cd6ac538de17 (diff)
replace rlx_depsolver use with new rebar_digraph
Diffstat (limited to 'src/rebar_packages.erl')
-rw-r--r--src/rebar_packages.erl21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/rebar_packages.erl b/src/rebar_packages.erl
index 7334365..7308611 100644
--- a/src/rebar_packages.erl
+++ b/src/rebar_packages.erl
@@ -2,9 +2,26 @@
-export([get_packages/1]).
+-export_type([constraint/0]).
+
-include("rebar.hrl").
--spec get_packages(rebar_state:t()) -> {rebar_dict(), rlx_depsolver:t()}.
+-type pkg_name() :: string() | binary() | atom().
+
+-type vsn() :: 'NO_VSN'
+ | ec_semver:semver().
+
+-type constraint_op() ::
+ '=' | gte | '>=' | lte | '<='
+ | gt | '>' | lt | '<' | pes | '~>' | between.
+
+-type constraint() :: pkg_name()
+ | {pkg_name(), vsn()}
+ | {pkg_name(), vsn(), constraint_op()}
+ | {pkg_name(), vsn(), vsn(), between}.
+
+
+-spec get_packages(rebar_state:t()) -> {rebar_dict(), rebar_digraph()}.
get_packages(State) ->
Home = rebar_utils:home_dir(),
RebarDir = rebar_state:get(State, global_rebar_dir, filename:join(Home, ?CONFIG_DIR)),
@@ -17,7 +34,7 @@ get_packages(State) ->
{Dict, rebar_digraph:restore_graph(Graph)}
catch
_:_ ->
- ?ERROR("Bad packages index, try to fix with `rebar update`~n", []),
+ ?ERROR("Bad packages index, try to fix with `rebar update`", []),
{dict:new(), digraph:new()}
end;
false ->