Skip to content

Commit

Permalink
Update to hex_core v0.4.0 (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach authored Jan 9, 2019
1 parent 480b319 commit 6c15415
Show file tree
Hide file tree
Showing 10 changed files with 429 additions and 160 deletions.
9 changes: 5 additions & 4 deletions lib/hex/repo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,14 @@ defmodule Hex.Repo do

def decode_package(body, repo, package) do
if Hex.State.fetch!(:no_verify_repo_origin) do
:mix_hex_pb_package.decode_msg(body, :Package).releases
{:ok, releases} = :mix_hex_registry.decode_package(body, :no_verify, :no_verify)
releases
else
case :mix_hex_pb_package.decode_msg(body, :Package) do
%{releases: releases, repository: ^repo, name: ^package} ->
case :mix_hex_registry.decode_package(body, repo, package) do
{:ok, releases} ->
releases

_ ->
{:error, :unverified} ->
Mix.raise(
"Fetched deprecated registry record version from repo #{repo}. For security " <>
"reasons this registry version is no longer supported. The repository " <>
Expand Down
4 changes: 2 additions & 2 deletions src/mix_hex_core.hrl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
%% Vendored from hex_core v0.2.1, do not edit manually
%% Vendored from hex_core v0.4.0, do not edit manually

-define(HEX_CORE_VERSION, "0.2.1").
-define(HEX_CORE_VERSION, "0.4.0").
2 changes: 1 addition & 1 deletion src/mix_hex_erl_tar.erl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Vendored from hex_core v0.2.1, do not edit manually
%% Vendored from hex_core v0.4.0, do not edit manually

%% @private
%% Copied from https://github.com/erlang/otp/blob/OTP-20.0.1/lib/stdlib/src/erl_tar.erl
Expand Down
2 changes: 1 addition & 1 deletion src/mix_hex_erl_tar.hrl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Vendored from hex_core v0.2.1, do not edit manually
%% Vendored from hex_core v0.4.0, do not edit manually

% Copied from https://github.com/erlang/otp/blob/OTP-20.0.1/lib/stdlib/src/erl_tar.hrl

Expand Down
2 changes: 1 addition & 1 deletion src/mix_hex_filename.erl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Vendored from hex_core v0.2.1, do not edit manually
%% Vendored from hex_core v0.4.0, do not edit manually

% @private
% Excerpt from https://github.com/erlang/otp/blob/OTP-20.0.1/lib/stdlib/src/filename.erl#L761-L788
Expand Down
Loading

0 comments on commit 6c15415

Please sign in to comment.