Do not vendor cookbooks using Berkshelf anymore

Instead, use the Berkshelf support in knife-solo and the
vagrant-berkshelf plugin on Vagrant
This commit is contained in:
Greg Karékinian
2019-04-11 18:16:28 +02:00
parent 87d7c721b1
commit ba6e4220a1
1436 changed files with 12 additions and 110987 deletions

View File

@@ -1,30 +0,0 @@
seven_zip Cookbook CHANGELOG
========================
This file is used to list changes made in each version of the seven_zip cookbook.
v2.0.2
------
- Add timeout to extract action on seven\_zip resource and configurable default\_extract_timeout attribute.
v2.0.1
------
- [GH Issue 21 - NoMethodError: Undefined method or attribute `kernel' on `node'](https://github.com/daptiv/seven_zip/issues/21).
v2.0.0
------
- [Upgrade to 7-Zip 15.14](https://github.com/daptiv/seven_zip/pull/9).
- [7-Zip now installed to the default MSI location by default](https://github.com/daptiv/seven_zip/pull/11).
- [7z.exe is located using the Windows registry unless the home attribute is explicitly set](https://github.com/daptiv/seven_zip/pull/10).
- [7-Zip is only added to the Windows PATH if the syspath attribute is set](https://github.com/daptiv/seven_zip/pull/11).
- [Installation idempotence check was fixed](https://github.com/daptiv/seven_zip/pull/14), package name was corrected.
- [TravisCI build added](https://github.com/daptiv/seven_zip/pull/12).
- [ServerSpec tests added](https://github.com/daptiv/seven_zip/pull/9)
- [Document Archive LRWP](https://github.com/daptiv/seven_zip/pull/6)
v1.0.2
------
- [COOK-3476 - Upgrade to 7-zip 9.22](https://tickets.opscode.com/browse/COOK-3476)
1.0.0
-----
- initial release

View File

@@ -1,108 +0,0 @@
[![Cookbook Version](http://img.shields.io/cookbook/v/seven_zip.svg)](https://supermarket.chef.io/cookbooks/seven_zip)
[![Build status](https://ci.appveyor.com/api/projects/status/y1lsnlkd2b3q6gfd/branch/master?svg=true)](https://ci.appveyor.com/project/ChefWindowsCookbooks65871/seven-zip/branch/master)
# seven_zip Cookbook
[7-Zip](http://www.7-zip.org/) is a file archiver with a high compression ratio. This cookbook installs the full 7-zip suite of tools (GUI and CLI). This cookbook replaces the older [7-zip cookbook](https://github.com/sneal/7-zip).
# Requirements
## Platforms
- Windows XP
- Windows Vista
- Windows 7
- Windows 8, 8.1
- Windows 10
- Windows Server 2003 R2
- Windows Server 2008 (R1, R2)
- Windows Server 2012 (R1, R2)
## Chef
- Chef >= 11.6
## Cookbooks
- windows
# Attributes
## Optional
<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><code>['seven_zip']['home']</code></td>
<td>String</td>
<td>7-Zip installation directory.</td>
<td></td>
</tr>
<tr>
<td><code>['seven_zip']['syspath']</code></td>
<td>Boolean</td>
<td>If true, adds 7-zip directory to system PATH environment variable.</td>
<td></td>
</tr>
<tr>
<td><code>['seven_zip']['default_extract_timeout']</code></td>
<td>Integer</td>
<td>The default timeout for an extract operation in seconds. This can be overridden by a resource attribute.</td>
<td>600</td>
</tr>
</table>
# Usage
## default
Add `seven_zip::default` to your run\_list which will download and install 7-zip for the current Windows platform.
# Resource/Provider
## seven_zip_archive
Extracts a 7-zip compatible archive (iso, zip, 7z etc) to the specified destination directory.
#### Actions
- `:extract` - Extract a 7-zip compatible archive
#### Attribute Parameters
- `path` - Name attribute. The destination to extract to.
- `source` - The file path to the archive to extract.
- `overwrite` - Defaults to false. If true, the destination files will be overwritten.
- `checksum` - The archive file checksum.
- `timeout` - The extract action timeout in seconds, defaults to `node['seven_zip']['default_extract_timeout']`.
#### Examples
Extract 7-zip source files to `C:\seven_zip_source`.
```ruby
seven_zip_archive 'seven_zip_source' do
path 'C:\seven_zip_source'
source 'http://www.7-zip.org/a/7z1514-src.7z'
overwrite true
checksum '3713aed72728eae8f6649e4803eba0b3676785200c76df6269034c520df4bbd5'
timeout 30
end
```
# Recipes
## default
Installs 7-zip and adds it to your system PATH.
# License & Authors
- Author:: Seth Chisamore (<schisamo@chef.io>)
- Author:: Shawn Neal (<sneal@sneal.net>)
```text
Copyright:: 2011-2016, Chef Software, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

View File

@@ -1,31 +0,0 @@
#
# Author:: Seth Chisamore (<schisamo@chef.io>)
# Cookbook Name:: seven_zip
# Attribute:: default
#
# Copyright:: Copyright (c) 2011-2016 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
if node['kernel']['machine'] == 'x86_64'
default['seven_zip']['url'] = 'http://www.7-zip.org/a/7z1514-x64.msi'
default['seven_zip']['checksum'] = 'cefe1a9092d8a6be68468c33910d6206b40e934fb63cab686c5cccf369fbf712'
default['seven_zip']['package_name'] = '7-Zip 15.14 (x64 edition)'
else
default['seven_zip']['url'] = 'http://www.7-zip.org/a/7z1514.msi'
default['seven_zip']['checksum'] = 'eaf58e29941d8ca95045946949d75d9b5455fac167df979a7f8e4a6bf2d39680'
default['seven_zip']['package_name'] = '7-Zip 15.14'
end
default['seven_zip']['default_extract_timeout'] = 600

View File

@@ -1,33 +0,0 @@
#
# Author:: Shawn Neal (<sneal@sneal.net>)
# Cookbook Name:: visualstudio
#
# Copyright 2015, Shawn Neal
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
if defined?(ChefSpec)
chefspec_version = Gem.loaded_specs['chefspec'].version
define_method = if chefspec_version < Gem::Version.new('4.1.0')
ChefSpec::Runner.method(:define_runner_method)
else
ChefSpec.method(:define_matcher)
end
define_method.call :seven_zip_archive
def extract_seven_zip_archive(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:seven_zip_archive, :extract, resource_name)
end
end

View File

@@ -1 +0,0 @@
{"name":"seven_zip","version":"2.0.2","description":"Installs/Configures the 7-zip file archiver","long_description":"[![Cookbook Version](http://img.shields.io/cookbook/v/seven_zip.svg)](https://supermarket.chef.io/cookbooks/seven_zip)\n[![Build status](https://ci.appveyor.com/api/projects/status/y1lsnlkd2b3q6gfd/branch/master?svg=true)](https://ci.appveyor.com/project/ChefWindowsCookbooks65871/seven-zip/branch/master)\n\n# seven_zip Cookbook\n[7-Zip](http://www.7-zip.org/) is a file archiver with a high compression ratio. This cookbook installs the full 7-zip suite of tools (GUI and CLI). This cookbook replaces the older [7-zip cookbook](https://github.com/sneal/7-zip).\n\n# Requirements\n## Platforms\n- Windows XP\n- Windows Vista\n- Windows 7\n- Windows 8, 8.1\n- Windows 10\n- Windows Server 2003 R2\n- Windows Server 2008 (R1, R2)\n- Windows Server 2012 (R1, R2)\n\n## Chef\n- Chef >= 11.6\n\n## Cookbooks\n- windows\n\n# Attributes\n## Optional\n<table>\n <tr>\n <th>Key</th>\n <th>Type</th>\n <th>Description</th>\n <th>Default</th>\n </tr>\n <tr>\n <td><code>['seven_zip']['home']</code></td>\n <td>String</td>\n <td>7-Zip installation directory.</td>\n <td></td>\n </tr>\n <tr>\n <td><code>['seven_zip']['syspath']</code></td>\n <td>Boolean</td>\n <td>If true, adds 7-zip directory to system PATH environment variable.</td>\n <td></td>\n </tr>\n <tr>\n <td><code>['seven_zip']['default_extract_timeout']</code></td>\n <td>Integer</td>\n <td>The default timeout for an extract operation in seconds. This can be overridden by a resource attribute.</td>\n <td>600</td>\n </tr>\n</table>\n\n# Usage\n## default\n\nAdd `seven_zip::default` to your run\\_list which will download and install 7-zip for the current Windows platform. \n\n# Resource/Provider\n## seven_zip_archive\nExtracts a 7-zip compatible archive (iso, zip, 7z etc) to the specified destination directory.\n\n#### Actions\n- `:extract` - Extract a 7-zip compatible archive\n\n#### Attribute Parameters\n- `path` - Name attribute. The destination to extract to.\n- `source` - The file path to the archive to extract.\n- `overwrite` - Defaults to false. If true, the destination files will be overwritten.\n- `checksum` - The archive file checksum.\n- `timeout` - The extract action timeout in seconds, defaults to `node['seven_zip']['default_extract_timeout']`.\n\n#### Examples\nExtract 7-zip source files to `C:\\seven_zip_source`.\n\n```ruby\nseven_zip_archive 'seven_zip_source' do\n path 'C:\\seven_zip_source'\n source 'http://www.7-zip.org/a/7z1514-src.7z'\n overwrite true\n checksum '3713aed72728eae8f6649e4803eba0b3676785200c76df6269034c520df4bbd5'\n timeout 30\nend\n```\n\n# Recipes\n## default\n\nInstalls 7-zip and adds it to your system PATH.\n\n# License & Authors\n- Author:: Seth Chisamore (<schisamo@chef.io>)\n- Author:: Shawn Neal (<sneal@sneal.net>)\n\n```text\nCopyright:: 2011-2016, Chef Software, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","maintainer":"Shawn Neal","maintainer_email":"sneal@sneal.net","license":"Apache 2.0","platforms":{"windows":">= 0.0.0"},"dependencies":{"windows":">= 1.2.2"},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{}}

View File

@@ -1,68 +0,0 @@
#
# Author:: Shawn Neal (<sneal@sneal.net>)
# Cookbook Name:: seven_zip
# Provider:: archive
#
# Copyright:: 2013, Daptiv Solutions LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
require 'fileutils'
require 'chef/mixin/shell_out'
include Chef::Mixin::ShellOut
include Windows::Helper
def whyrun_supported?
true
end
use_inline_resources
action :extract do
converge_by("Extract #{@new_resource.source} => #{@new_resource.path} (overwrite=#{@new_resource.overwrite})") do
FileUtils.mkdir_p(@new_resource.path) unless Dir.exist?(@new_resource.path)
local_source = cached_file(@new_resource.source, @new_resource.checksum)
cmd = "\"#{seven_zip_exe}\" x"
cmd << ' -y' if @new_resource.overwrite
cmd << " -o\"#{win_friendly_path(@new_resource.path)}\""
cmd << " \"#{local_source}\""
Chef::Log.debug(cmd)
shell_out!(cmd, timeout: extract_timeout)
end
end
def seven_zip_exe
path = if node['seven_zip']['home']
node['seven_zip']['home']
else
seven_zip_exe_from_registry
end
Chef::Log.debug("Using 7-zip home: #{path}")
win_friendly_path(::File.join(path, '7z.exe'))
end
def seven_zip_exe_from_registry
require 'win32/registry'
# Read path from recommended Windows App Paths registry location
# docs: https://msdn.microsoft.com/en-us/library/windows/desktop/ee872121
::Win32::Registry::HKEY_LOCAL_MACHINE.open(
'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\7zFM.exe',
::Win32::Registry::KEY_READ
).read_s('Path')
end
def extract_timeout
@new_resource.timeout || node['seven_zip']['default_extract_timeout']
end

View File

@@ -1,41 +0,0 @@
#
# Author:: Seth Chisamore (<schisamo@chef.io>)
# Cookbook Name:: seven_zip
# Recipe:: default
#
# Copyright 2011-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
windows_package node['seven_zip']['package_name'] do
source node['seven_zip']['url']
checksum node['seven_zip']['checksum']
options "INSTALLDIR=\"#{node['seven_zip']['home']}\"" if node['seven_zip']['home']
action :install
end
# update path
windows_path 'seven_zip' do
path lazy {
if node['seven_zip']['home']
node['seven_zip']['home']
else
::Win32::Registry::HKEY_LOCAL_MACHINE.open(
'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\7zFM.exe',
::Win32::Registry::KEY_READ
).read_s('Path')
end
}
action :add
end if node['seven_zip']['syspath']

View File

@@ -1,29 +0,0 @@
#
# Author:: Shawn Neal (<sneal@sneal.net>)
# Cookbook Name:: seven_zip
# Resource:: archive
#
# Copyright:: 2013, Daptiv Solutions LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
default_action :extract
actions :extract
attribute :path, kind_of: String, name_attribute: true
attribute :source, kind_of: String
attribute :overwrite, kind_of: [TrueClass, FalseClass], default: false
attribute :checksum, kind_of: String
attribute :timeout, kind_of: Integer