#
# Cookbook Name:: dotnetcore
# Recipe:: _tar_install
#
# Copyright (C) 2016 Andrew Cornies
#
# All rights reserved - Do Not Redistribute
#
# Installs dotnetcore using the tar instructions intended for CentOS, Oracle Linux, and Amazon
# https://www.microsoft.com/net/core#centos

package 'libunwind'
package 'libicu'

directory '/opt/dotnet' do
  recursive true
end

tar_extract node['dotnetcore']['package']['tar'] do
  target_dir '/opt/dotnet'
  creates '/opt/dotnet/dotnet'
end

link '/usr/bin/dotnet' do
  to '/opt/dotnet/dotnet'
end

#
# Cookbook Name:: dotnetcore
# Recipe:: _tar_install
#
# Copyright (C) 2016 Andrew Cornies
#
# All rights reserved - Do Not Redistribute
#
# Installs dotnetcore using the tar instructions intended for CentOS, Oracle Linux, and Amazon
# https://www.microsoft.com/net/core#centos

package 'libunwind'
package 'libicu'

directory '/opt/dotnet' do
  recursive true
end

tar_extract node['dotnetcore']['package']['tar'] do
  target_dir '/opt/dotnet'
end

link '/usr/bin/dotnet' do
  to '/opt/dotnet/dotnet'
end

Allow dotnetcore upgrade when using tar install method
Allow dotnetcore upgrade when using tar install method

This patch makes sure we can upgrade dotnetcore.

Before the patch, `creates` property prevented the downloaded tarball to
be extracted
(https://github.com/chef-cookbooks/tar/blob/3d659bd87bbdc32805d07b56bf531a04497b0066/resources/extract.rb#L92)
because the /opt/dotnet/dotnet exist after a first extraction.

tar_extract resource is fallbacks to chef notifications when not giving
`creates` which is the expected behavior

Fixes #16

Change-Id: Icc3c85e59890b7a6e1189d6a73b6a180cfe24afc
