mixlib-install 3.11.26 → 3.12.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec6b99d4690d5fe92eb7b63c8a6ee0866f01ba3631a9a11bfc545d71d980bb9a
4
- data.tar.gz: 9b91687c0bfc7ad8940958726e6e07a31c693b227f340324488c93c93ef6f3dd
3
+ metadata.gz: fb233e51e18e929105c7c97d7f1ca060e4dc02bb31c96fe593bdcda077e7f57a
4
+ data.tar.gz: 874ef20231f17e3bf00a0b5f9a8f6ad6c428793be44a897edb1b878449cdf86e
5
5
  SHA512:
6
- metadata.gz: 19f09f8899303faea32625580ca022ac759f9bb7bea83807d16d2d13ec6217d22f52bc8d6f0748ed7afd4505911819cc1c4c083f5156892377138de340af6034
7
- data.tar.gz: 3bd3541be3bc0ec57aca9b0cae11ba30c354ab8f1aeb1ebd601d015f066c205166f520c3d95d9727e025fc8db8770ec469464d586686299c4e21f04f3bcacb53
6
+ metadata.gz: 267808104df5f1e62d9a11b067ed53f75bf540465b5a1a5065d76dacb7618ba20acc381616a19d287d8dcbc996b2ee94fe53ca5e8f7856512abad827ad69a3c5
7
+ data.tar.gz: 123e1017d5c41f2a02be2723e8cacda065363ef5bd6f3af858e46c38a0099ead3bf7b8d2a687dbd4206e4986d0798d19f76014f5fc53c096b66a956b956ac793
data/Gemfile CHANGED
@@ -27,6 +27,6 @@ end
27
27
  group :debug do
28
28
  gem "pry"
29
29
  gem "pry-byebug"
30
- gem "pry-stack_explorer"
30
+ gem "pry-stack_explorer", "~> 0.4.0" # pin until we drop ruby < 2.6
31
31
  gem "rb-readline"
32
32
  end
@@ -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\\opscode\\#{options.product_name}"
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\\opscode\\#{options.product_name}\\version-manifest.json"
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
@@ -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. Infact we should not do this since for some arcane
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 simplifed key/pair Hash
248
+ # value pair to a simplified key/pair Hash
249
249
  #
250
250
  def map_properties(properties)
251
251
  return {} if properties.nil?
@@ -13,13 +13,17 @@
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
20
20
  class Cli < Thor
21
21
  include Thor::Actions
22
22
 
23
+ def self.exit_on_failure?
24
+ true
25
+ end
26
+
23
27
  desc "version", "print mixlib-install version"
24
28
  def version
25
29
  require_relative "version"
@@ -63,7 +67,7 @@ If no earlier version is found the earliest version available will be set.",
63
67
  desc: "Print artifact attributes",
64
68
  type: :boolean
65
69
  def download(product_name)
66
- # Set mininum options
70
+ # Set minimum options
67
71
  mixlib_install_options = {
68
72
  channel: options[:channel].to_sym,
69
73
  product_name: product_name,
@@ -24,6 +24,8 @@ module Mixlib
24
24
  MACOS_VOLUME = "chef_software".freeze
25
25
  # Windows install directory name
26
26
  WINDOWS_INSTALL_DIR = "opscode".freeze
27
+ # Linux install directory name
28
+ LINUX_INSTALL_DIR = "/opt"
27
29
  end
28
30
  end
29
31
  end
@@ -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 returnt the contents of the script
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 "succesfully."
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 valdation..."
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 hanlde response
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 OS X
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
- platform_version=$VERSION
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
  ;;
@@ -78,6 +78,15 @@ function Get-WebContentOnFullNet {
78
78
  $wc = new-object System.Net.WebClient
79
79
  $wc.Headers.Add("user-agent", "<%= user_agent_string %>")
80
80
  $proxy.Address = $env:http_proxy
81
+ $bypassList = $env:no_proxy
82
+
83
+
84
+ if($bypassList -ne $null){
85
+
86
+ $bypassList = $bypassList.split(",")
87
+ $proxy.BypassList = $byPassList
88
+ }
89
+
81
90
  $wc.Proxy = $proxy
82
91
 
83
92
  if ([string]::IsNullOrEmpty($filepath)) {
@@ -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\\opscode\\chef"
87
+ "$env:systemdrive\\#{Mixlib::Install::Dist::WINDOWS_INSTALL_DIR}\\#{Mixlib::Install::Dist::DEFAULT_PRODUCT}"
87
88
  else
88
- "/opt/chef"
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, conditionaly prefixed with sudo
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
@@ -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 Unixlike systems.
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 aleady set it doesn't get duplicated
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"
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class Install
3
- VERSION = "3.11.26"
3
+ VERSION = "3.12.5"
4
4
  end
5
5
  end
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.26
4
+ version: 3.12.5
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: 2019-12-30 00:00:00.000000000 Z
12
+ date: 2020-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mixlib-shellout