diff --git a/src/component_handler.erl b/src/component_handler.erl index 10a7b18..5430d9a 100644 --- a/src/component_handler.erl +++ b/src/component_handler.erl @@ -88,25 +88,6 @@ handle_post(Req, _State=#state{}) -> end, {ok, Req3}. -find_latest_tag([]) -> - <<"">>; -find_latest_tag(Tags) -> - NumericTags = lists:filter(fun(X) -> - case re:run(X, "^\\d+(\\.\\d){0,2}$") of - nomatch -> false; _ -> true - end - end, Tags), - case NumericTags of - [] -> <<"HEAD">>; - _ -> - SortFun = fun(Tag1, Tag2) -> - Tag1Parts = binary:split(Tag1, <<".">>), - Tag2Parts = binary:split(Tag2, <<".">>), - lists:all(fun({Tag1Part, Tag2Part}) -> Tag1Part =< Tag2Part end, lists:zip(Tag1Parts, Tag2Parts)) - end, - lists:last(lists:sort(SortFun, NumericTags)) - end. - find_latest_patch(PrefixTag, Tags) -> lists:foldl(fun(Tag, LatestPatch) -> case binary:longest_common_prefix([Tag, PrefixTag])of