mixlib-install 3.11.28 → 3.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- 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/helpers.sh.erb +2 -2
- data/lib/mixlib/install/generator/bourne/scripts/platform_detection.sh +14 -10
- data/lib/mixlib/install/generator/powershell/scripts/helpers.ps1.erb +12 -5
- data/lib/mixlib/install/options.rb +0 -1
- data/lib/mixlib/install/script_generator.rb +4 -3
- data/lib/mixlib/install/util.rb +4 -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: 601807500297868555334b6b675f76e7f47e82b06508c25034b7104c8d2d6310
|
|
4
|
+
data.tar.gz: 505719449732303c18b2b6c1ca892f61bcc9c2bfb249e3b10f7073f0db675e68
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 28787830d0a413c5698fd7889562f9210d8ab3f6ae9d94274f02c015280ce6e1914413e18a89036306d7f5e3ac12fd24a9401b891fde2c7de8f33a98183e4bc3
|
|
7
|
+
data.tar.gz: 0d3ec51ff6c6dbaa499eba0cf95ffd9e66881381543b6cabe257539901ad2e1cf3ca895768729d2cadc7bd8a250f9925ecfe15e88bc59f7355469ee105a6f194
|
data/Gemfile
CHANGED
|
@@ -2,6 +2,8 @@ source "https://rubygems.org"
|
|
|
2
2
|
|
|
3
3
|
gemspec
|
|
4
4
|
|
|
5
|
+
gem "chef-utils", "= 16.6.14" if RUBY_VERSION < "2.6.0"
|
|
6
|
+
|
|
5
7
|
group :docs do
|
|
6
8
|
gem "github-markup"
|
|
7
9
|
gem "redcarpet"
|
|
@@ -27,6 +29,6 @@ end
|
|
|
27
29
|
group :debug do
|
|
28
30
|
gem "pry"
|
|
29
31
|
gem "pry-byebug"
|
|
30
|
-
gem "pry-stack_explorer"
|
|
32
|
+
gem "pry-stack_explorer", "~> 0.4.0" # pin until we drop ruby < 2.6
|
|
31
33
|
gem "rb-readline"
|
|
32
34
|
end
|
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
|
|
@@ -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
|
|
@@ -163,6 +164,9 @@ esac
|
|
|
163
164
|
|
|
164
165
|
# normalize the architecture we detected
|
|
165
166
|
case $machine in
|
|
167
|
+
"arm64"|"aarch64")
|
|
168
|
+
machine="aarch64"
|
|
169
|
+
;;
|
|
166
170
|
"x86_64"|"amd64"|"x64")
|
|
167
171
|
machine="x86_64"
|
|
168
172
|
;;
|
|
@@ -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
|
}
|
|
@@ -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
|
|
|
@@ -162,6 +162,8 @@ module Mixlib
|
|
|
162
162
|
case architecture
|
|
163
163
|
when "amd64"
|
|
164
164
|
"x86_64"
|
|
165
|
+
when "arm64"
|
|
166
|
+
"aarch64"
|
|
165
167
|
when "i86pc", "i686"
|
|
166
168
|
"i386"
|
|
167
169
|
when "sun4u", "sun4v"
|
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.
|
|
4
|
+
version: 3.12.7
|
|
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-02-19 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
|