hex_tarball.unpack

You're seeing just the function unpack, go back to hex_tarball module for more information.

Specs

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()}.
Unpacks a package tarball.

See also: unpack/3.

Link to this function

unpack(Tarball, Output, Config)

View Source

Specs

unpack(tarball(), memory, hex_core:config()) ->
          {ok,
           #{outer_checksum => checksum(),
             inner_checksum => checksum(),
             metadata => metadata(),
             contents => contents()}} |
          {error, term()};
      (tarball(), filename(), hex_core:config()) ->
          {ok,
           #{outer_checksum => checksum(), inner_checksum => checksum(), metadata => metadata()}} |
          {error, term()}.

Unpacks a package tarball.

Remember to verify the outer tarball checksum against the registry checksum returned from hex_repo:get_package(Config, Package).

Examples:

  > hex_tarball:unpack(Tarball, memory).
  {ok,#{outer_checksum => <<...>>,
        contents => [{"src/foo.erl",<<"-module(foo).">>}],
        metadata => #{<<"name">> => <<"foo">>, ...}}}
 
  > hex_tarball:unpack(Tarball, "path/to/unpack").
  {ok,#{outer_checksum => <<...>>,
        metadata => #{<<"name">> => <<"foo">>, ...}}}