From 77d21c6177390bf4bedcdbe4c16e4eedac936902 Mon Sep 17 00:00:00 2001 From: Bryan Paxton Date: Wed, 4 Nov 2020 14:37:31 -0600 Subject: [PATCH] Re-vendor hex_core in at 0.7.0 --- src/r3_hex_api.erl | 2 +- src/r3_hex_api_key.erl | 2 +- src/r3_hex_api_package.erl | 2 +- src/r3_hex_api_package_owner.erl | 2 +- src/r3_hex_api_release.erl | 47 ++++++++++++++-- src/r3_hex_api_user.erl | 2 +- src/r3_hex_core.erl | 10 +++- src/r3_hex_core.hrl | 4 +- src/r3_hex_erl_tar.erl | 16 +++++- src/r3_hex_erl_tar.hrl | 2 +- src/r3_hex_filename.erl | 2 +- src/r3_hex_http.erl | 2 +- src/r3_hex_http_httpc.erl | 5 +- src/r3_hex_pb_names.erl | 2 +- src/r3_hex_pb_package.erl | 2 +- src/r3_hex_pb_signed.erl | 2 +- src/r3_hex_pb_versions.erl | 2 +- src/r3_hex_registry.erl | 2 +- src/r3_hex_repo.erl | 2 +- src/r3_hex_tarball.erl | 95 +++++++++++++++++++++++--------- src/r3_safe_erl_term.xrl | 2 +- 21 files changed, 151 insertions(+), 56 deletions(-) diff --git a/src/r3_hex_api.erl b/src/r3_hex_api.erl index ff1167e2..1c0586ef 100644 --- a/src/r3_hex_api.erl +++ b/src/r3_hex_api.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually %% @hidden diff --git a/src/r3_hex_api_key.erl b/src/r3_hex_api_key.erl index 3fb04c63..1fcd7aea 100644 --- a/src/r3_hex_api_key.erl +++ b/src/r3_hex_api_key.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually -module(r3_hex_api_key). -export([ diff --git a/src/r3_hex_api_package.erl b/src/r3_hex_api_package.erl index 97c41a06..3cfb4702 100644 --- a/src/r3_hex_api_package.erl +++ b/src/r3_hex_api_package.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually -module(r3_hex_api_package). -export([get/2, search/3]). diff --git a/src/r3_hex_api_package_owner.erl b/src/r3_hex_api_package_owner.erl index b85ed45e..742104ad 100644 --- a/src/r3_hex_api_package_owner.erl +++ b/src/r3_hex_api_package_owner.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually -module(r3_hex_api_package_owner). -export([ diff --git a/src/r3_hex_api_release.erl b/src/r3_hex_api_release.erl index 21cf8b9f..f5994dda 100644 --- a/src/r3_hex_api_release.erl +++ b/src/r3_hex_api_release.erl @@ -1,15 +1,18 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually -module(r3_hex_api_release). -export([ delete/3, get/3, publish/2, + publish/3, retire/4, unretire/3 ]). --export_type([retirement_params/0, retirement_reason/0]). +-export_type([publish_params/0, retirement_params/0, retirement_reason/0]). + +-type publish_params() :: [{replace, boolean()}]. -type retirement_reason() :: other | invalid | security | deprecated | renamed. @@ -74,12 +77,46 @@ get(Config, Name, Version) when is_map(Config) and is_binary(Name) and is_binary %% ''' %% @end -spec publish(r3_hex_core:config(), binary()) -> r3_hex_api:response(). -publish(Config, Tarball) when is_map(Config) and is_binary(Tarball) -> - Path = r3_hex_api:build_repository_path(Config, ["publish"]), +publish(Config, Tarball) -> publish(Config, Tarball, []). + + +%% @doc +%% Publishes a new package release with query parameters. +%% +%% Supported query params : +%% - replace : boolean +%% +%% Examples: +%% +%% ``` +%% > r3_hex_api_release:publish(r3_hex_core:default_config(), Tarball, [{replace, true}]). +%% {ok, {201, ..., #{ +%% <<"checksum">> => <<"540d210d81f56f17f64309a4896430e727972499b37bd59342dc08d61dff74d8">>, +%% <<"docs_html_url">> => <<"https://hexdocs.pm/package/1.0.0/">>, +%% <<"downloads">> => 740,<<"has_docs">> => true, +%% <<"html_url">> => <<"https://hex.pm/packages/package/1.0.0">>, +%% <<"inserted_at">> => <<"2014-12-09T18:32:03Z">>, +%% <<"meta">> => +%% #{<<"app">> => <<"package">>, +%% <<"build_tools">> => [<<"mix">>]}, +%% <<"package_url">> => <<"https://hex.pm/api/packages/package">>, +%% <<"publisher">> => nil,<<"requirements">> => #{}, +%% <<"retirement">> => nil, +%% <<"updated_at">> => <<"2019-07-28T21:12:11Z">>, +%% <<"url">> => <<"https://hex.pm/api/packages/package/releases/1.0.0">>, +%% <<"version">> => <<"1.0.0">> +%% }}} +%% ''' +%% @end +-spec publish(hexcore:config(), binary(), publish_params()) -> r3_hex_api:response(). +publish(Config, Tarball, Params) when is_map(Config) andalso is_binary(Tarball) andalso is_list(Params)-> + QueryString = r3_hex_api:encode_query_string([{replace, proplists:get_value(replace, Params, false)}]), + Path = r3_hex_api:join_path_segments(r3_hex_api:build_repository_path(Config, ["publish"])), + PathWithQuery = <>, TarballContentType = "application/octet-stream", Config2 = put_header(<<"content-length">>, integer_to_binary(byte_size(Tarball)), Config), Body = {TarballContentType, Tarball}, - r3_hex_api:post(Config2, Path, Body). + r3_hex_api:post(Config2, PathWithQuery, Body). %% @doc %% Deletes a package release. diff --git a/src/r3_hex_api_user.erl b/src/r3_hex_api_user.erl index 7d6d0471..5b4111ad 100644 --- a/src/r3_hex_api_user.erl +++ b/src/r3_hex_api_user.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually -module(r3_hex_api_user). -export([ diff --git a/src/r3_hex_core.erl b/src/r3_hex_core.erl index 1f524b59..86832015 100644 --- a/src/r3_hex_core.erl +++ b/src/r3_hex_core.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually %% @doc %% hex_core entrypoint module. @@ -69,7 +69,9 @@ J1i2xWFndWa6nfFnRxZmCStCOZWYYPlaxr+FZceFbpMwzTNs4g3d4tLNUcbKAIH4 repo_url => binary(), repo_organization => binary() | undefined, repo_verify => boolean(), - repo_verify_origin => boolean() + repo_verify_origin => boolean(), + tarball_max_size => pos_integer(), + tarball_max_uncompressed_size => pos_integer() }. -spec default_config() -> config(). @@ -82,6 +84,7 @@ default_config() -> http_adapter => r3_hex_http_httpc, http_adapter_config => #{profile => default}, http_etag => undefined, + http_headers => #{}, http_user_agent_fragment => <<"(httpc)">>, repo_key => undefined, repo_name => <<"hexpm">>, @@ -90,5 +93,6 @@ default_config() -> repo_organization => undefined, repo_verify => true, repo_verify_origin => true, - http_headers => #{} + tarball_max_size => 8 * 1024 * 1024, + tarball_max_uncompressed_size => 64 * 1024 * 1024 }. diff --git a/src/r3_hex_core.hrl b/src/r3_hex_core.hrl index 721fca86..6f045695 100644 --- a/src/r3_hex_core.hrl +++ b/src/r3_hex_core.hrl @@ -1,3 +1,3 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually --define(HEX_CORE_VERSION, "0.6.8"). +-define(HEX_CORE_VERSION, "0.7.0"). diff --git a/src/r3_hex_erl_tar.erl b/src/r3_hex_erl_tar.erl index a2da2783..18893cee 100644 --- a/src/r3_hex_erl_tar.erl +++ b/src/r3_hex_erl_tar.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually %% @private %% Copied from https://github.com/erlang/otp/blob/OTP-20.0.1/lib/stdlib/src/erl_tar.erl @@ -11,6 +11,7 @@ %% - Add safe_relative_path_links/2 to check directory traversal vulnerability when extracting files, %% it differs from OTP's current fix (2020-02-04) in that it checks regular files instead of %% symlink targets. This allows creating symlinks with relative path targets such as `../tmp/log` +%% - Remove ram_file usage (backported from OTP master) %% %% %CopyrightBegin% @@ -335,10 +336,19 @@ do_open(Name, Mode) when is_list(Mode) -> {error, {Name, Reason}} end. -open1({binary,Bin}, read, _Raw, Opts) when is_binary(Bin) -> +open1({binary,Bin0}, read, _Raw, Opts) when is_binary(Bin0) -> + Bin = case lists:member(compressed, Opts) of + true -> + try + zlib:gunzip(Bin0) + catch + _:_ -> Bin0 + end; + false -> + Bin0 + end, case file:open(Bin, [ram,binary,read]) of {ok,File} -> - _ = [ram_file:uncompress(File) || Opts =:= [compressed]], {ok, #reader{handle=File,access=read,func=fun file_op/2}}; Error -> Error diff --git a/src/r3_hex_erl_tar.hrl b/src/r3_hex_erl_tar.hrl index 64772969..bd6395fc 100644 --- a/src/r3_hex_erl_tar.hrl +++ b/src/r3_hex_erl_tar.hrl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually % Copied from https://github.com/erlang/otp/blob/OTP-20.0.1/lib/stdlib/src/erl_tar.hrl diff --git a/src/r3_hex_filename.erl b/src/r3_hex_filename.erl index fe27a6c1..3d9f2328 100644 --- a/src/r3_hex_filename.erl +++ b/src/r3_hex_filename.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.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 diff --git a/src/r3_hex_http.erl b/src/r3_hex_http.erl index d4258414..71cd8bee 100644 --- a/src/r3_hex_http.erl +++ b/src/r3_hex_http.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually -module(r3_hex_http). -export([request/5]). diff --git a/src/r3_hex_http_httpc.erl b/src/r3_hex_http_httpc.erl index 1e953f4b..ace8b0e9 100644 --- a/src/r3_hex_http_httpc.erl +++ b/src/r3_hex_http_httpc.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually %% @hidden @@ -13,8 +13,7 @@ request(Method, URI, ReqHeaders, Body, AdapterConfig) -> Profile = maps:get(profile, AdapterConfig, default), Request = build_request(URI, ReqHeaders, Body), - case httpc:request(Method, Request, [{ssl, rebar_utils:ssl_opts(URI)}], - [{body_format, binary}], Profile) of + case httpc:request(Method, Request, [], [{body_format, binary}], Profile) of {ok, {{_, StatusCode, _}, RespHeaders, RespBody}} -> RespHeaders2 = load_headers(RespHeaders), {ok, {StatusCode, RespHeaders2, RespBody}}; diff --git a/src/r3_hex_pb_names.erl b/src/r3_hex_pb_names.erl index fa0f87f4..02a94b67 100644 --- a/src/r3_hex_pb_names.erl +++ b/src/r3_hex_pb_names.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually %% -*- coding: utf-8 -*- %% Automatically generated, do not edit diff --git a/src/r3_hex_pb_package.erl b/src/r3_hex_pb_package.erl index 820df11f..208d34b4 100644 --- a/src/r3_hex_pb_package.erl +++ b/src/r3_hex_pb_package.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually %% -*- coding: utf-8 -*- %% Automatically generated, do not edit diff --git a/src/r3_hex_pb_signed.erl b/src/r3_hex_pb_signed.erl index 22bc58e4..5e6df79a 100644 --- a/src/r3_hex_pb_signed.erl +++ b/src/r3_hex_pb_signed.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually %% -*- coding: utf-8 -*- %% Automatically generated, do not edit diff --git a/src/r3_hex_pb_versions.erl b/src/r3_hex_pb_versions.erl index 3cbd4a03..a8d64d8b 100644 --- a/src/r3_hex_pb_versions.erl +++ b/src/r3_hex_pb_versions.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually %% -*- coding: utf-8 -*- %% Automatically generated, do not edit diff --git a/src/r3_hex_registry.erl b/src/r3_hex_registry.erl index 6c8da4de..f12aabde 100644 --- a/src/r3_hex_registry.erl +++ b/src/r3_hex_registry.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually -module(r3_hex_registry). -export([ diff --git a/src/r3_hex_repo.erl b/src/r3_hex_repo.erl index 986b9bd8..b16943fd 100644 --- a/src/r3_hex_repo.erl +++ b/src/r3_hex_repo.erl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually -module(r3_hex_repo). -export([ diff --git a/src/r3_hex_tarball.erl b/src/r3_hex_tarball.erl index a80ca153..2506125c 100644 --- a/src/r3_hex_tarball.erl +++ b/src/r3_hex_tarball.erl @@ -1,13 +1,12 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually -module(r3_hex_tarball). --export([create/2, create_docs/1, unpack/2, unpack_docs/2, format_checksum/1, format_error/1]). +-export([create/2, create/3, create_docs/1, create_docs/2, unpack/2, unpack/3, + unpack_docs/2, unpack_docs/3, format_checksum/1, format_error/1]). -ifdef(TEST). -export([do_decode_metadata/1, gzip/1, normalize_requirements/1]). -endif. -define(VERSION, <<"3">>). --define(TARBALL_MAX_SIZE, 8 * 1024 * 1024). --define(TARBALL_MAX_UNCOMPRESSED_SIZE, 64 * 1024 * 1024). -define(BUILD_TOOL_FILES, [ {<<"mix.exs">>, <<"mix">>}, {<<"rebar.config">>, <<"rebar3">>}, @@ -45,13 +44,16 @@ %% inner_checksum => <<178,12,...>>}} %% ''' %% @end --spec create(metadata(), files()) -> {ok, {tarball(), checksum()}} | {error, term()}. -create(Metadata, Files) -> +-spec create(metadata(), files(), r3_hex_core:config()) -> {ok, #{tarball => tarball(), outer_checksum => checksum(), + inner_checksum => tarball()}} | {error, term()}. +create(Metadata, Files, Config) -> MetadataBinary = encode_metadata(Metadata), ContentsTarball = create_memory_tarball(Files), ContentsTarballCompressed = gzip(ContentsTarball), InnerChecksum = inner_checksum(?VERSION, MetadataBinary, ContentsTarballCompressed), InnerChecksumBase16 = encode_base16(InnerChecksum), + TarballMaxSize = maps:get(tarball_max_size, Config), + TarballMaxUncompressedSize = maps:get(tarball_max_uncompressed_size, Config), OuterFiles = [ {"VERSION", ?VERSION}, @@ -65,14 +67,22 @@ create(Metadata, Files) -> UncompressedSize = byte_size(ContentsTarball), - case(byte_size(Tarball) > ?TARBALL_MAX_SIZE) or (UncompressedSize > ?TARBALL_MAX_UNCOMPRESSED_SIZE) of - true -> - {error, {tarball, too_big}}; + case {(byte_size(Tarball) > TarballMaxSize), (UncompressedSize > TarballMaxUncompressedSize)} of + {_, true} -> + {error, {tarball, {too_big_uncompressed, TarballMaxUncompressedSize}}}; - false -> + {true, _} -> + {error, {tarball, {too_big_compressed, TarballMaxSize}}}; + + {false, false} -> {ok, #{tarball => Tarball, outer_checksum => OuterChecksum, inner_checksum => InnerChecksum}} end. +-spec create(metadata(), files()) -> {ok, #{tarball => tarball(), outer_checksum => checksum(), + inner_checksum => tarball()}} | {error, term()}. +create(Metadata, Files) -> + create(Metadata, Files, r3_hex_core:default_config()). + %% @doc %% Creates a docs tarball. %% @@ -84,14 +94,14 @@ create(Metadata, Files) -> %% {ok, <<86,69,...>>} %% ''' %% @end --spec create_docs(files()) -> {ok, tarball()}. -create_docs(Files) -> +-spec create_docs(files(), r3_hex_core:config()) -> {ok, tarball()} | {error, term()}. +create_docs(Files, #{tarball_max_size := TarballMaxSize, tarball_max_uncompressed_size := TarballMaxUncompressedSize}) -> UncompressedTarball = create_memory_tarball(Files), UncompressedSize = byte_size(UncompressedTarball), Tarball = gzip(UncompressedTarball), Size = byte_size(Tarball), - case(Size > ?TARBALL_MAX_SIZE) or (UncompressedSize > ?TARBALL_MAX_UNCOMPRESSED_SIZE) of + case(Size > TarballMaxSize) or (UncompressedSize > TarballMaxUncompressedSize) of true -> {error, {tarball, too_big}}; @@ -99,6 +109,10 @@ create_docs(Files) -> {ok, Tarball} end. +-spec create_docs(files()) -> {ok, tarball()}. +create_docs(Files) -> + create_docs(Files, r3_hex_core:default_config()). + %% @doc %% Unpacks a package tarball. %% @@ -117,16 +131,18 @@ create_docs(Files) -> %% {ok,#{outer_checksum => <<...>>, %% metadata => #{<<"name">> => <<"foo">>, ...}}} %% ''' --spec unpack(tarball(), memory) -> - {ok, #{checksum => checksum(), metadata => metadata(), contents => contents()}} | +-spec unpack(tarball(), memory, r3_hex_core:config()) -> + {ok, #{outer_checksum => checksum(), inner_checksum => checksum(), + metadata => metadata(), contents => contents()}} | {error, term()}; - (tarball(), filename()) -> - {ok, #{checksum => checksum(), metadata => metadata()}} | + (tarball(), filename(), r3_hex_core:config()) -> + {ok, #{outer_checksum => checksum(), inner_checksum => checksum(), + metadata => metadata()}} | {error, term()}. -unpack(Tarball, _) when byte_size(Tarball) > ?TARBALL_MAX_SIZE -> +unpack(Tarball, _, #{tarball_max_size := TarballMaxSize}) when byte_size(Tarball) > TarballMaxSize -> {error, {tarball, too_big}}; -unpack(Tarball, Output) -> +unpack(Tarball, Output, _Config) -> case r3_hex_erl_tar:extract({binary, Tarball}, [memory]) of {ok, []} -> {error, {tarball, empty}}; @@ -139,6 +155,18 @@ unpack(Tarball, Output) -> {error, {tarball, Reason}} end. + +-spec unpack(tarball(), memory) -> + {ok, #{outer_checksum => checksum(), inner_checksum => checksum(), + metadata => metadata(), contents => contents()}} | + {error, term()}; + (tarball(), filename()) -> + {ok, #{outer_checksum => checksum(), inner_checksum => checksum(), + metadata => metadata()}} | + {error, term()}. +unpack(Tarball, Output) -> + unpack(Tarball, Output, r3_hex_core:default_config()). + %% @doc %% Unpacks a documentation tarball. %% @@ -151,14 +179,19 @@ unpack(Tarball, Output) -> %% > r3_hex_tarball:unpack_docs(Tarball, "path/to/unpack"). %% ok %% ''' --spec unpack_docs(tarball(), memory) -> {ok, contents()} | {error, term()}; - (tarball(), filename()) -> ok | {error, term()}. -unpack_docs(Tarball, _) when byte_size(Tarball) > ?TARBALL_MAX_SIZE -> +-spec unpack_docs(tarball(), memory, r3_hex_core:config()) -> {ok, contents()} | {error, term()}; + (tarball(), filename(), r3_hex_core:config()) -> ok | {error, term()}. +unpack_docs(Tarball, _, #{tarball_max_size := TarballMaxSize}) when byte_size(Tarball) > TarballMaxSize -> {error, {tarball, too_big}}; -unpack_docs(Tarball, Output) -> +unpack_docs(Tarball, Output, _Config) -> unpack_tarball(Tarball, Output). +-spec unpack_docs(tarball(), memory) -> {ok, contents()} | {error, term()}; + (tarball(), filename()) -> ok | {error, term()}. +unpack_docs(Tarball, Output) -> + unpack_docs(Tarball, Output, r3_hex_core:default_config()). + %% @doc %% Returns base16-encoded representation of checksum. -spec format_checksum(checksum()) -> binary(). @@ -169,7 +202,11 @@ format_checksum(Checksum) -> %% Converts an error reason term to a human-readable error message string. -spec format_error(term()) -> string(). format_error({tarball, empty}) -> "empty tarball"; -format_error({tarball, too_big}) -> "tarball is too big"; +format_error({tarball, {too_big_uncompressed, Size}}) -> + io_lib:format("package exceeds max uncompressed size ~w ~s", [format_byte_size(Size), "MB"]); +format_error({tarball, {too_big_compressed, Size}}) -> + io_lib:format("package exceeds max compressed size ~w ~s", [format_byte_size(Size), "MB"]); + format_error({tarball, {missing_files, Files}}) -> io_lib:format("missing files: ~p", [Files]); format_error({tarball, {bad_version, Vsn}}) -> io_lib:format("unsupported version: ~p", [Vsn]); format_error({tarball, invalid_checksum}) -> "invalid tarball checksum"; @@ -186,6 +223,9 @@ format_error({checksum_mismatch, ExpectedChecksum, ActualChecksum}) -> "Actual (base16-encoded): ~s", [encode_base16(ExpectedChecksum), encode_base16(ActualChecksum)]). +format_byte_size(Size) -> + Size / 1000000. + %%==================================================================== %% Internal functions %%==================================================================== @@ -225,7 +265,12 @@ finish_unpack({error, _} = Error) -> finish_unpack(#{metadata := Metadata, files := Files, inner_checksum := InnerChecksum, outer_checksum := OuterChecksum, output := Output}) -> _ = maps:get("VERSION", Files), ContentsBinary = maps:get("contents.tar.gz", Files), - filelib:ensure_dir(filename:join(Output, "*")), + + case Output of + memory -> ok; + _ -> filelib:ensure_dir(filename:join(Output, "*")) + end, + case unpack_tarball(ContentsBinary, Output) of ok -> copy_metadata_config(Output, maps:get("metadata.config", Files)), diff --git a/src/r3_safe_erl_term.xrl b/src/r3_safe_erl_term.xrl index e938905a..ffee21c5 100644 --- a/src/r3_safe_erl_term.xrl +++ b/src/r3_safe_erl_term.xrl @@ -1,4 +1,4 @@ -%% Vendored from hex_core v0.6.8, do not edit manually +%% Vendored from hex_core v0.7.0, do not edit manually %%% Author : Robert Virding %%% Purpose : Token definitions for Erlang.