Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate lock file warnings when upgrading from 1.1.0 locks #2221

Merged
merged 1 commit into from
Feb 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/rebar.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
-define(DEFAULT_TEST_DEPS_DIR, "test/lib").
-define(DEFAULT_RELEASE_DIR, "rel").
-define(CONFIG_VERSION, "1.2.0").
-define(SUPPORTED_CONFIG_VERSIONS, ["1.1.0", "1.2.0"]). % older were untagged
-define(DEFAULT_CDN, "https://repo.hex.pm/").
-define(REMOTE_PACKAGE_DIR, "tarballs").
-define(LOCK_FILE, "rebar.lock").
Expand Down
16 changes: 11 additions & 5 deletions src/rebar_config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ consult_lock_file(File) ->
case Terms of
[] ->
[];
[Locks] when is_list(Locks) -> % beta lock file
[Locks] when is_list(Locks) -> % beta/1.0.0 lock file
read_attrs(beta, Locks, []);
[{Vsn, Locks}|Attrs] when is_list(Locks) -> % versioned lock file
%% Because this is the first version of rebar3 to introduce a lock
Expand All @@ -79,10 +79,16 @@ consult_lock_file(File) ->
?CONFIG_VERSION ->
ok;
_ ->
%% Make sure the warning below is to be shown whenever a version
%% newer than the current one is being used, as we can't parse
%% all the contents of the lock file properly.
warn_vsn_once()
case lists:member(Vsn, ?SUPPORTED_CONFIG_VERSIONS) of
true ->
ok;
false ->
%% Make sure the warning below is to be shown
%% whenever a version newer than the current
%% one is being used, as we can't parse all the
%% contents of the lock file properly.
warn_vsn_once()
end
end,
read_attrs(Vsn, Locks, Attrs)
end.
Expand Down