mixlib-install 3.11.29 → 3.12.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +10 -11
- data/Rakefile +0 -7
- data/lib/mixlib/install.rb +5 -4
- data/lib/mixlib/install/backend/package_router.rb +4 -4
- data/lib/mixlib/install/cli.rb +2 -2
- data/lib/mixlib/install/dist.rb +2 -0
- data/lib/mixlib/install/generator/base.rb +3 -3
- data/lib/mixlib/install/generator/bourne/scripts/fetch_package.sh +1 -1
- data/lib/mixlib/install/generator/bourne/scripts/helpers.sh.erb +2 -2
- data/lib/mixlib/install/generator/bourne/scripts/platform_detection.sh +11 -10
- data/lib/mixlib/install/generator/powershell/scripts/helpers.ps1.erb +12 -5
- data/lib/mixlib/install/generator/powershell/scripts/install_project.ps1.erb +2 -2
- data/lib/mixlib/install/script_generator.rb +4 -3
- data/lib/mixlib/install/util.rb +2 -2
- data/lib/mixlib/install/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe13831f6e3d7b294b7e1882f3ce89650a827683efafcd59950ecf6021d05142
|
4
|
+
data.tar.gz: b123da4632d197b6adf060d5c2ee8287c58bc48134259634bcebeddd7753c06c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6d552bafb38bdd3095798ebf1d87b8dfe904e4531a5a67f111dc0ed7eede36afb68ce8ad28c17f0b8099ebf00a926b7c86869e7513d4ce49d8f61b092c2975e
|
7
|
+
data.tar.gz: 427f67b3eb3e4c9051eb81e614840bab0f57393152b00fd44af46c5858bdcd4c1deafa11b1a05948ad7fdc4840ced78934493782ece7faf801b76a1b91640c46
|
data/Gemfile
CHANGED
@@ -2,31 +2,30 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
|
6
|
-
gem "github-markup"
|
7
|
-
gem "redcarpet"
|
8
|
-
gem "yard"
|
9
|
-
end
|
5
|
+
gem "chef-utils", "= 16.6.14" if RUBY_VERSION < "2.6.0"
|
10
6
|
|
11
7
|
group :test do
|
12
8
|
gem "rake"
|
13
9
|
gem "rspec"
|
14
10
|
gem "vcr"
|
11
|
+
gem "webrick"
|
15
12
|
gem "webmock", "~> 3.4"
|
16
13
|
gem "aruba", "~> 0.14"
|
17
14
|
gem "cucumber", "~> 1.3.20"
|
18
|
-
|
15
|
+
if RUBY_VERSION < "2.5.0"
|
16
|
+
gem "climate_control", "= 0.1.0"
|
17
|
+
else
|
18
|
+
gem "climate_control", "~> 1.0"
|
19
|
+
end
|
19
20
|
end
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
22
|
+
# use old chefstyle to support TargetRubyVersion of 1.9
|
23
|
+
group :chefstyle do
|
24
|
+
gem "chefstyle", "~> 0.4.0"
|
25
25
|
end
|
26
26
|
|
27
27
|
group :debug do
|
28
28
|
gem "pry"
|
29
29
|
gem "pry-byebug"
|
30
|
-
gem "pry-stack_explorer"
|
31
30
|
gem "rb-readline"
|
32
31
|
end
|
data/Rakefile
CHANGED
@@ -40,13 +40,6 @@ task "matrix" do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
begin
|
44
|
-
require "yard"
|
45
|
-
YARD::Rake::YardocTask.new(:docs)
|
46
|
-
rescue LoadError
|
47
|
-
puts "yard is not available. bundle install first to make sure all dependencies are installed."
|
48
|
-
end
|
49
|
-
|
50
43
|
task :console do
|
51
44
|
require "irb"
|
52
45
|
require "irb/completion"
|
data/lib/mixlib/install.rb
CHANGED
@@ -18,13 +18,14 @@
|
|
18
18
|
#
|
19
19
|
|
20
20
|
require "mixlib/versioning"
|
21
|
-
require "mixlib/shellout"
|
21
|
+
require "mixlib/shellout" unless defined?(Mixlib::ShellOut)
|
22
22
|
|
23
23
|
require_relative "install/backend"
|
24
24
|
require_relative "install/options"
|
25
25
|
require_relative "install/generator"
|
26
26
|
require_relative "install/generator/bourne"
|
27
27
|
require_relative "install/generator/powershell"
|
28
|
+
require_relative "install/dist"
|
28
29
|
|
29
30
|
module Mixlib
|
30
31
|
class Install
|
@@ -119,7 +120,7 @@ module Mixlib
|
|
119
120
|
# This only works for chef and chefdk but they are the only projects
|
120
121
|
# we are supporting as of now.
|
121
122
|
if options.for_ps1?
|
122
|
-
"$env:systemdrive
|
123
|
+
"$env:systemdrive\\#{Mixlib::Install::Dist::WINDOWS_INSTALL_DIR}\\#{options.product_name}"
|
123
124
|
else
|
124
125
|
"/opt/#{options.product_name}"
|
125
126
|
end
|
@@ -136,7 +137,7 @@ module Mixlib
|
|
136
137
|
# chef-server -> /opt/opscode). But this is OK for now since
|
137
138
|
# chef & chefdk are the only supported products.
|
138
139
|
version_manifest_file = if options.for_ps1?
|
139
|
-
"$env:systemdrive
|
140
|
+
"$env:systemdrive\\#{Mixlib::Install::Dist::WINDOWS_INSTALL_DIR}\\#{options.product_name}\\version-manifest.json"
|
140
141
|
else
|
141
142
|
"/opt/#{options.product_name}/version-manifest.json"
|
142
143
|
end
|
@@ -183,7 +184,7 @@ module Mixlib
|
|
183
184
|
# to disallow unsigned powershell scripts. This changes it for just this
|
184
185
|
# powershell session, which allows this to run even if the execution policy
|
185
186
|
# is set higher.
|
186
|
-
Mixlib::ShellOut.new("powershell.exe -file #{File.join(d, "detect_platform.ps1")}", :env => { "PSExecutionPolicyPreference" => "Bypass" }).run_command
|
187
|
+
Mixlib::ShellOut.new("powershell.exe -NoProfile -file #{File.join(d, "detect_platform.ps1")}", :env => { "PSExecutionPolicyPreference" => "Bypass" }).run_command
|
187
188
|
end
|
188
189
|
else
|
189
190
|
Mixlib::ShellOut.new(detect_platform_sh).run_command
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require "json"
|
19
|
+
require "json" unless defined?(JSON)
|
20
20
|
require_relative "../artifact_info"
|
21
21
|
require_relative "base"
|
22
22
|
require_relative "../product"
|
@@ -24,7 +24,7 @@ require_relative "../product_matrix"
|
|
24
24
|
require_relative "../util"
|
25
25
|
require_relative "../dist"
|
26
26
|
require "mixlib/versioning"
|
27
|
-
require "net/http"
|
27
|
+
require "net/http" unless defined?(Net::HTTP)
|
28
28
|
|
29
29
|
module Mixlib
|
30
30
|
class Install
|
@@ -78,7 +78,7 @@ EOF
|
|
78
78
|
|
79
79
|
# Filter out the partial builds if we are in :unstable channel
|
80
80
|
# In other channels we do not need to do this since all builds are
|
81
|
-
# always complete.
|
81
|
+
# always complete. In fact we should not do this since for some arcane
|
82
82
|
# builds like Chef Client 10.X we do not have build record created in
|
83
83
|
# artifactory.
|
84
84
|
if options.channel == :unstable
|
@@ -245,7 +245,7 @@ EOF
|
|
245
245
|
private
|
246
246
|
|
247
247
|
# Converts Array<Hash> where the Hash is a key pair and
|
248
|
-
# value pair to a
|
248
|
+
# value pair to a simplified key/pair Hash
|
249
249
|
#
|
250
250
|
def map_properties(properties)
|
251
251
|
return {} if properties.nil?
|
data/lib/mixlib/install/cli.rb
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
#
|
14
14
|
|
15
15
|
require_relative "../install"
|
16
|
-
require "thor"
|
16
|
+
require "thor" unless defined?(Thor)
|
17
17
|
|
18
18
|
module Mixlib
|
19
19
|
class Install
|
@@ -67,7 +67,7 @@ If no earlier version is found the earliest version available will be set.",
|
|
67
67
|
desc: "Print artifact attributes",
|
68
68
|
type: :boolean
|
69
69
|
def download(product_name)
|
70
|
-
# Set
|
70
|
+
# Set minimum options
|
71
71
|
mixlib_install_options = {
|
72
72
|
channel: options[:channel].to_sym,
|
73
73
|
product_name: product_name,
|
data/lib/mixlib/install/dist.rb
CHANGED
@@ -15,8 +15,8 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require "erb"
|
19
|
-
require "ostruct"
|
18
|
+
require "erb" unless defined?(Erb)
|
19
|
+
require "ostruct" unless defined?(OpenStruct)
|
20
20
|
require_relative "../util"
|
21
21
|
require_relative "../dist"
|
22
22
|
|
@@ -45,7 +45,7 @@ module Mixlib
|
|
45
45
|
script_path = File.join(script_base_path, name)
|
46
46
|
|
47
47
|
# If there is an erb template we render it, otherwise we just read
|
48
|
-
# and
|
48
|
+
# and return the contents of the script
|
49
49
|
if File.exist? "#{script_path}.erb"
|
50
50
|
# Default values to use incase they are not set in the context
|
51
51
|
context[:project_name] ||= Mixlib::Install::Dist::PROJECT_NAME.freeze
|
@@ -14,7 +14,7 @@
|
|
14
14
|
# $filetype: Type of the file downloaded.
|
15
15
|
############
|
16
16
|
|
17
|
-
filename=`echo $download_url | sed -e 's/^.*\///'`
|
17
|
+
filename=`echo $download_url | sed -e 's/^.*\///' | sed -e 's/?.*//'`
|
18
18
|
filetype=`echo $filename | sed -e 's/^.*\.//'`
|
19
19
|
|
20
20
|
# use either $tmp_dir, the provided directory (-d) or the provided filename (-f)
|
@@ -87,7 +87,7 @@ http_404_error() {
|
|
87
87
|
echo "In order to test the version parameter, adventurous users may take the Metadata URL"
|
88
88
|
echo "below and modify the '&v=<number>' parameter until you successfully get a URL that"
|
89
89
|
echo "does not 404 (e.g. via curl or wget). You should be able to use '&v=11' or '&v=12'"
|
90
|
-
echo "
|
90
|
+
echo "successfully."
|
91
91
|
echo ""
|
92
92
|
echo "If you cannot fix this problem by setting the bootstrap_version, it probably means"
|
93
93
|
echo "that $platform is not supported."
|
@@ -215,7 +215,7 @@ do_checksum() {
|
|
215
215
|
checksum=`shasum -a 256 $1 | awk '{ print $1 }'`
|
216
216
|
return `test "x$checksum" = "x$2"`
|
217
217
|
else
|
218
|
-
echo "WARNING: could not find a valid checksum program, pre-install shasum or sha256sum in your O/S image to get
|
218
|
+
echo "WARNING: could not find a valid checksum program, pre-install shasum or sha256sum in your O/S image to get validation..."
|
219
219
|
return 0
|
220
220
|
fi
|
221
221
|
}
|
@@ -48,7 +48,7 @@ elif test -f "/etc/redhat-release"; then
|
|
48
48
|
platform_version=`sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/redhat-release`
|
49
49
|
|
50
50
|
if test "$platform" = "xenserver"; then
|
51
|
-
# Current XenServer 6.2 is based on CentOS 5, platform is not reset to "el" server should
|
51
|
+
# Current XenServer 6.2 is based on CentOS 5, platform is not reset to "el" server should handle response
|
52
52
|
platform="xenserver"
|
53
53
|
else
|
54
54
|
# FIXME: use "redhat"
|
@@ -71,17 +71,11 @@ elif test -f "/etc/system-release"; then
|
|
71
71
|
fi
|
72
72
|
esac
|
73
73
|
|
74
|
-
# Apple
|
74
|
+
# Apple macOS
|
75
75
|
elif test -f "/usr/bin/sw_vers"; then
|
76
76
|
platform="mac_os_x"
|
77
77
|
# Matching the tab-space with sed is error-prone
|
78
78
|
platform_version=`sw_vers | awk '/^ProductVersion:/ { print $2 }' | cut -d. -f1,2`
|
79
|
-
|
80
|
-
# x86_64 Apple hardware often runs 32-bit kernels (see OHAI-63)
|
81
|
-
x86_64=`sysctl -n hw.optional.x86_64`
|
82
|
-
if test $x86_64 -eq 1; then
|
83
|
-
machine="x86_64"
|
84
|
-
fi
|
85
79
|
elif test -f "/etc/release"; then
|
86
80
|
machine=`/usr/bin/uname -p`
|
87
81
|
if grep SmartOS /etc/release >/dev/null; then
|
@@ -96,7 +90,7 @@ elif test -f "/etc/SuSE-release"; then
|
|
96
90
|
then
|
97
91
|
platform="sles"
|
98
92
|
platform_version=`awk '/^VERSION/ {V = $3}; /^PATCHLEVEL/ {P = $3}; END {print V "." P}' /etc/SuSE-release`
|
99
|
-
else
|
93
|
+
else # opensuse 43 only. 15 ships with /etc/os-release only
|
100
94
|
platform="opensuseleap"
|
101
95
|
platform_version=`awk '/^VERSION =/ { print $3 }' /etc/SuSE-release`
|
102
96
|
fi
|
@@ -114,7 +108,14 @@ elif test -f "/etc/os-release"; then
|
|
114
108
|
fi
|
115
109
|
|
116
110
|
platform=$ID
|
117
|
-
|
111
|
+
|
112
|
+
# VERSION_ID is always the preferred variable to use, but not
|
113
|
+
# every distro has it so fallback to VERSION
|
114
|
+
if test "x$VERSION_ID" != "x"; then
|
115
|
+
platform_version=$VERSION_ID
|
116
|
+
else
|
117
|
+
platform_version=$VERSION
|
118
|
+
fi
|
118
119
|
fi
|
119
120
|
|
120
121
|
if test "x$platform" = "x"; then
|
@@ -79,14 +79,14 @@ function Get-WebContentOnFullNet {
|
|
79
79
|
$wc.Headers.Add("user-agent", "<%= user_agent_string %>")
|
80
80
|
$proxy.Address = $env:http_proxy
|
81
81
|
$bypassList = $env:no_proxy
|
82
|
-
|
82
|
+
|
83
83
|
|
84
84
|
if($bypassList -ne $null){
|
85
|
-
|
85
|
+
|
86
86
|
$bypassList = $bypassList.split(",")
|
87
87
|
$proxy.BypassList = $byPassList
|
88
88
|
}
|
89
|
-
|
89
|
+
|
90
90
|
$wc.Proxy = $proxy
|
91
91
|
|
92
92
|
if ([string]::IsNullOrEmpty($filepath)) {
|
@@ -180,9 +180,16 @@ function Get-WMIQuery {
|
|
180
180
|
param ($class)
|
181
181
|
|
182
182
|
if(Get-Command -Name Get-CimInstance -ErrorAction SilentlyContinue) {
|
183
|
-
|
183
|
+
try{
|
184
|
+
$classObject = Get-CimInstance $class
|
185
|
+
# If the Get-CimInstance command exists but fails due to security settings, try Get-WmiObject.
|
186
|
+
}
|
187
|
+
catch {
|
188
|
+
$classObject = Get-WmiObject $class
|
189
|
+
}
|
184
190
|
}
|
185
191
|
else {
|
186
|
-
Get-WmiObject $class
|
192
|
+
$classObject = Get-WmiObject $class
|
187
193
|
}
|
194
|
+
return $classObject
|
188
195
|
}
|
@@ -73,7 +73,7 @@ function Install-Project {
|
|
73
73
|
|
74
74
|
$cached_installer_available = $false
|
75
75
|
$verify_checksum = $true
|
76
|
-
|
76
|
+
|
77
77
|
if (-not [string]::IsNullOrEmpty($download_url_override)) {
|
78
78
|
$download_url = $download_url_override
|
79
79
|
$sha256 = $checksum
|
@@ -91,7 +91,7 @@ function Install-Project {
|
|
91
91
|
}
|
92
92
|
}
|
93
93
|
else {
|
94
|
-
$filename = ($download_url -split '/')[-1]
|
94
|
+
$filename = (([System.Uri]$download_url).AbsolutePath -split '/')[-1]
|
95
95
|
}
|
96
96
|
Write-Verbose "Download directory: $download_directory"
|
97
97
|
Write-Verbose "Filename: $filename"
|
@@ -19,6 +19,7 @@
|
|
19
19
|
|
20
20
|
require_relative "util"
|
21
21
|
require_relative "generator/powershell"
|
22
|
+
require_relative "dist"
|
22
23
|
require "cgi"
|
23
24
|
|
24
25
|
module Mixlib
|
@@ -83,9 +84,9 @@ module Mixlib
|
|
83
84
|
@sudo_command = "sudo -E"
|
84
85
|
|
85
86
|
@root = if powershell
|
86
|
-
"$env:systemdrive
|
87
|
+
"$env:systemdrive\\#{Mixlib::Install::Dist::WINDOWS_INSTALL_DIR}\\#{Mixlib::Install::Dist::DEFAULT_PRODUCT}"
|
87
88
|
else
|
88
|
-
"
|
89
|
+
"#{Mixlib::Install::Dist::LINUX_INSTALL_DIR}/#{Mixlib::Install::Dist::DEFAULT_PRODUCT}"
|
89
90
|
end
|
90
91
|
|
91
92
|
parse_opts(opts)
|
@@ -226,7 +227,7 @@ module Mixlib
|
|
226
227
|
# Conditionally prefixes a command with a sudo command.
|
227
228
|
#
|
228
229
|
# @param command [String] command to be prefixed
|
229
|
-
# @return [String] the command,
|
230
|
+
# @return [String] the command, conditionally prefixed with sudo
|
230
231
|
# @api private
|
231
232
|
def sudo(script)
|
232
233
|
use_sudo ? "#{sudo_command} #{script}" : script
|
data/lib/mixlib/install/util.rb
CHANGED
@@ -109,7 +109,7 @@ module Mixlib
|
|
109
109
|
# invoked on a remote instance or locally.
|
110
110
|
#
|
111
111
|
# This method uses the Bourne shell (/bin/sh) to maximize the chance of
|
112
|
-
# cross platform portability on
|
112
|
+
# cross platform portability on Unix-like systems.
|
113
113
|
#
|
114
114
|
# @param [String] the command
|
115
115
|
# @return [String] a wrapped command string
|
@@ -129,7 +129,7 @@ module Mixlib
|
|
129
129
|
require_relative "version"
|
130
130
|
user_agents = %W{mixlib-install/#{Mixlib::Install::VERSION}}
|
131
131
|
user_agents << headers
|
132
|
-
# Ensure that if the default user agent is
|
132
|
+
# Ensure that if the default user agent is already set it doesn't get duplicated
|
133
133
|
user_agents.flatten.compact.uniq.join(" ")
|
134
134
|
end
|
135
135
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mixlib-install
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.11
|
4
|
+
version: 3.12.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thom May
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-03-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mixlib-shellout
|
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
requirements: []
|
120
|
-
rubygems_version: 3.
|
120
|
+
rubygems_version: 3.1.4
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
123
|
summary: A library for interacting with Chef Software Inc's software distribution
|