   end
 
   defp update_tar(release, name, output_dir, overlays) do
+    Logger.debug "Updating tarball"
     tarfile = '#{Path.join([output_dir, "releases", release.version, name <> ".tar.gz"])}'
     tmpdir = Utils.insecure_mkdtemp!
     :erl_tar.extract(tarfile, [{:cwd, '#{tmpdir}'}, :compressed])

  @moduledoc """
  This module is responsible for packaging a release into a tarball.
  """
  alias Mix.Releases.{Release, Overlays, Utils}

  def archive(%Release{} = release) do
    name = "#{release.name}"
    output_dir = Path.relative_to_cwd(Path.join("rel", "#{release.name}"))

    case make_tar(release, name, output_dir) do
      {:error, _} = err ->
        err

               {'erts-#{erts_vsn}', '#{Path.join(output_dir, "erts-" <> erts_vsn)}'}]
          end
        ] ++ overlays, [:dereference, :compressed])
    Logger.debug "Tarball updated!"
    File.rm_rf!(tmpdir)
    :ok
  end

  defp apply_overlays(release, _name, output_dir) do
    Logger.debug "Applying overlays"
    overlay_vars = release.profile.overlay_vars ++ generate_overlay_vars(release)
    hook_overlays = [
      {:mkdir, "releases/<%= release_version %>/hooks"},
