hex_core icon indicating copy to clipboard operation
hex_core copied to clipboard

Do not crash when unpacking empty packages

Open wojtekmach opened this issue 6 years ago • 2 comments

E.g.:

mix hex.package fetch loki 0.1.0 --unpack
** (MatchError) no match of right hand side value: {:error, :enoent}
    (hex 0.20.1) src/mix_hex_tarball.erl:220: :mix_hex_tarball.copy_metadata_config/2
    (hex 0.20.1) src/mix_hex_tarball.erl:209: :mix_hex_tarball.finish_unpack/1
    (hex 0.20.1) lib/hex.ex:183: Hex.unpack_tar!/2
    (hex 0.20.1) lib/mix/tasks/hex.package.ex:114: Mix.Tasks.Hex.Package.fetch/4
    (mix 1.10.0-dev) lib/mix/task.ex:330: Mix.Task.run_task/3
    (mix 1.10.0-dev) lib/mix/cli.ex:83: Mix.CLI.run_task/2

wojtekmach avatar Nov 14 '19 14:11 wojtekmach

 mix hex.package fetch xclient 0.5.0-vendored-xhttp --unpack
** (Mix) Unpacking tarball failed: inner tarball error, no such file or directory

wojtekmach avatar Nov 14 '19 14:11 wojtekmach

The packages are broken but hex_core should gracefully handle that.

wojtekmach avatar Nov 14 '19 14:11 wojtekmach