summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rebar_git_resource.erl10
-rw-r--r--src/rebar_prv_install_deps.erl2
2 files changed, 9 insertions, 3 deletions
diff --git a/src/rebar_git_resource.erl b/src/rebar_git_resource.erl
index 5a24d1a..97e951e 100644
--- a/src/rebar_git_resource.erl
+++ b/src/rebar_git_resource.erl
@@ -194,10 +194,16 @@ parse_tags(Dir) ->
{error, _} ->
{undefined, "0.0.0"};
{ok, Line} ->
- case re:run(Line, "(\\(|\\s)tag:\\s(v?([^,\\)]+))", [{capture, [2, 3], list}]) of
+ case re:run(Line, "(\\(|\\s)(HEAD,\\s)tag:\\s(v?([^,\\)]+))", [{capture, [3, 4], list}]) of
{match,[Tag, Vsn]} ->
{Tag, Vsn};
nomatch ->
- {undefined, "0.0.0"}
+ case rebar_utils:sh("git describe --tags --abbrev=0",
+ [{use_stdout, false}, return_on_error, {cd, Dir}]) of
+ {error, _} ->
+ {undefined, "0.0.0"};
+ {ok, LatestVsn} ->
+ {undefined, string:strip(LatestVsn, both, $\n)}
+ end
end
end.
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl
index b6b36e2..118d799 100644
--- a/src/rebar_prv_install_deps.erl
+++ b/src/rebar_prv_install_deps.erl
@@ -370,7 +370,7 @@ maybe_upgrade(AppInfo, AppDir, Upgrade, State) ->
true ->
case rebar_fetch:needs_update(AppDir, Source, State) of
true ->
- ?INFO("Upgrading ~s", [rebar_app_info:name(AppInfo)]),
+ ?INFO("Upgrading ~s (~p)", [rebar_app_info:name(AppInfo), rebar_app_info:source(AppInfo)]),
true = rebar_fetch:download_source(AppDir, Source, State);
false ->
case Upgrade of