From d880e6e385ac49ecfe67449a25c1fd95b4e1f882 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 23 Oct 2012 09:49:06 -0500 Subject: fix bug in goal parsing and handling Signed-off-by: Jordan Wilberding --- src/rcl_goal.peg | 9 +++++---- src/rcl_release.erl | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/rcl_goal.peg b/src/rcl_goal.peg index 24e78a8..bfac607 100644 --- a/src/rcl_goal.peg +++ b/src/rcl_goal.peg @@ -6,15 +6,15 @@ constraint <- ws? app_name ws? between_op ws? version ws? "," ws? version ws? ` case Node of [_,AppName,_, _] -> - {ok, erlang:iolist_to_binary(AppName)}; + {ok, AppName}; [_,AppName,_,Op,_,Vsn,_, _] -> {ok, - {erlang:iolist_to_binary(AppName), + {AppName, rcl_goal_utils:to_vsn(Vsn), rcl_goal_utils:to_op(Op)}}; [_,AppName,_,Op,_,Vsn1,_,_,_,Vsn2,_,_] -> {ok, - {erlang:iolist_to_binary(AppName), + {AppName, rcl_goal_utils:to_vsn(Vsn1), rcl_goal_utils:to_vsn(Vsn2), rcl_goal_utils:to_op(Op)}}; @@ -25,7 +25,8 @@ constraint <- ws? app_name ws? between_op ws? version ws? "," ws? version ws? ws <- [ \t\n\s\r] ; -app_name <- [a-zA-Z0-9_]+ ; +app_name <- [a-zA-Z0-9_]+ + ` erlang:list_to_atom(erlang:binary_to_list(erlang:iolist_to_binary(Node))) ` ; between_op <- ":" ws? ( "btwn" / "between" ) ws? ":" diff --git a/src/rcl_release.erl b/src/rcl_release.erl index f1a439c..dd3e479 100644 --- a/src/rcl_release.erl +++ b/src/rcl_release.erl @@ -288,9 +288,9 @@ parse_goal0(Constraint0, {ok, Release = #release_t{goals=Goals}}) parse_goal0(Constraint0, {ok, Release = #release_t{goals=Goals}}) when erlang:is_list(Constraint0) -> case rcl_goal:parse(Constraint0) of - {error, _Detail} -> + {fail, _Detail} -> ?RCL_ERROR({failed_to_parse, Constraint0}); - Constraint1 -> + {ok, Constraint1} -> {ok, Release#release_t{goals = [Constraint1 | Goals]}} end; parse_goal0(_, E = {error, _}) -> -- cgit v1.2.3