mixlib-install 3.12.3 → 3.12.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9292398c41cc34a46a603c508a55b865da85bf161780dc19892fe9ae3607319
4
- data.tar.gz: 767131ab311ea5ef51c3aef89f40beca0634aabacb6d0c4cdd60a9ba233cec49
3
+ metadata.gz: 7a21f92ea82f18b67b83b117f0acd51b14651a57d0a9f5ae1651fc1e38364122
4
+ data.tar.gz: 74e44ce180f1e6ec62caa06901b9ef8fe479ef2e540b3d7dda69ccc15fc8ad31
5
5
  SHA512:
6
- metadata.gz: f1c4f472513b0f4a61463f6314781f59c088b934a5ac8a9f812152dc4ae70f25647ce164e9856f4f7dc62ec4c3eccb3c34ddda2a990c56f1368476d25cc8e8dc
7
- data.tar.gz: b6d9ff5a37a56484aa7028aa61421ffde2a6acd2f32d97cde6abfed658c74cb63402999b98d28f5e2d3999102ac8b9ff3aa868da7bef1afd5b33568e24c28cba
6
+ metadata.gz: e1aae0835dfd3a6fc198b7be66280414f90c755fdf4dbc5f3c9455b671c6ddba99b81a644911c109c845624cbea1ca959b8a264235e3545a5b6f9a81b14422bb
7
+ data.tar.gz: 92210d23a37f1b09d908aeb2b3af418b806f9a75515718b86c94a357c83fb8d30ef20db6f28b41e8583f8b944bc3b4e8b658e6147a7321774d56849f9ca8ba39
data/Gemfile CHANGED
@@ -2,31 +2,31 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- group :docs do
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
- gem "climate_control"
15
+ gem "contracts", "~> 0.16.0" # this entry can go away when ruby < 3 support is gone
16
+ if RUBY_VERSION < "2.5.0"
17
+ gem "climate_control", "= 0.1.0"
18
+ else
19
+ gem "climate_control", "~> 1.0"
20
+ end
19
21
  end
20
22
 
21
- if RUBY_VERSION =~ /^2/
22
- group :chefstyle do
23
- gem "chefstyle", "~> 0.4.0"
24
- end
23
+ # use old chefstyle to support TargetRubyVersion of 1.9
24
+ group :chefstyle do
25
+ gem "chefstyle", "~> 0.4.0"
25
26
  end
26
27
 
27
28
  group :debug do
28
29
  gem "pry"
29
30
  gem "pry-byebug"
30
- gem "pry-stack_explorer", "~> 0.4.0" # pin until we drop ruby < 2.6
31
31
  gem "rb-readline"
32
32
  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"
@@ -25,6 +25,7 @@ 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
@@ -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
@@ -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
@@ -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)
@@ -15,7 +15,7 @@ if test "x$version" = "x" -a "x$CI" != "xtrue"; then
15
15
  echo "You are installing a package without a version pin. If you are installing"
16
16
  echo "on production servers via an automated process this is DANGEROUS and you will"
17
17
  echo "be upgraded without warning on new releases, even to new major releases."
18
- echo "Letting the version float is only appropriate in desktop, test, development or"
18
+ echo "Letting the version float is only appropriate in test, development or"
19
19
  echo "CI/CD environments."
20
20
  echo
21
21
  echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
@@ -76,12 +76,6 @@ 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
@@ -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
- Get-CimInstance $class
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"
@@ -233,7 +233,7 @@ Must be one of: #{SUPPORTED_SHELL_TYPES.join(", ")}
233
233
  def validate_platform_options
234
234
  unless all_or_none?(platform_info.values)
235
235
  errors << <<-EOS
236
- Must provide platform, platform version and architecture when specifying any platform details
236
+ Must provide platform (-p), platform version (-l) and architecture (-a) when specifying any platform details
237
237
  EOS
238
238
  end
239
239
  end
@@ -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)
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class Install
3
- VERSION = "3.12.3"
3
+ VERSION = "3.12.15"
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.12.3
4
+ version: 3.12.15
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: 2020-08-13 00:00:00.000000000 Z
12
+ date: 2021-08-13 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.0.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