mixlib-install 3.12.30 → 3.13.0

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: 97b6b9d6f612f1a8e4eb431feb24cd888fdcefbca693bd239a7d1435fc23b045
4
- data.tar.gz: 3e3804a6ad0bcf92caa7dbb5ac440c4366223be9a25096dde560010f1b4d96d3
3
+ metadata.gz: ff7a4f9c339e539a6ceb50655b22976fa5c5f41c9c4f74a721dc55028d7df84f
4
+ data.tar.gz: 30d398aefff7ada62fcf40368a0bd40a83031d11d765341a37d6572f9561fea9
5
5
  SHA512:
6
- metadata.gz: 2e3b09b0a7fb065568d81922529eb01714bbc0bdea1a6ca30734b4c2a1884287ea8144234263d636371ce372b3db2db9815b701ce9537bfe2e2b917f29a12587
7
- data.tar.gz: b74d672d7f632e4ccabcf05af695c6529e5571c8c155ce197e46c9d1104c5ccd821cbbe04b8c4f471ff74a466cdbc2b6053a3f026c9cd535ad9e95004a446176
6
+ metadata.gz: ca10f06e8f5a7fd3323f23c954988c57e31fef1ea093738a6aefdf3c77bafd2c9ad44ec54a42514cfab1c81c18cc8739f55718ef21f3e5850d68f36fbb6e82cd
7
+ data.tar.gz: 983a976ca909b8a0e56903b44f2ea38e62f79e49b502a81174383dc2946e96a8e6f30a2365801f5d5647f43df7a7b13c8faaba686230694df018a2e69f64d8b2
data/Gemfile CHANGED
@@ -3,30 +3,86 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  gem "chef-utils", "= 16.6.14" if RUBY_VERSION < "2.6.0"
6
+ # OpenSSL version constraints to fix CRL checking issues in OpenSSL 3.6+
7
+ # Ruby 2.6-2.7 bundled openssl needs update to 3.1.2+
8
+ # Ruby 3.0-3.2 bundled openssl needs update to 3.1.2+
9
+ # Ruby 3.3 bundled openssl needs update to 3.2.2+
10
+ # Ruby 3.4 bundled openssl needs update to 3.3.1+
11
+ if RUBY_VERSION < "2.7.0"
12
+ gem "openssl", ">= 3.1.2", "< 3.2.0"
13
+ elsif RUBY_VERSION < "3.3.0"
14
+ gem "openssl", ">= 3.1.2"
15
+ elsif RUBY_VERSION < "3.4.0"
16
+ gem "openssl", ">= 3.2.2"
17
+ elsif RUBY_VERSION < "4.0.0"
18
+ gem "openssl", ">= 3.3.1"
19
+ end
6
20
 
7
21
  group :test do
22
+ gem "contracts", "~> 0.16.0" # this entry can go away when ruby < 3 support is gone
8
23
  gem "rake"
9
24
  gem "rspec"
10
25
  gem "webrick"
11
26
  gem "webmock", "~> 3.4"
12
- gem "contracts", "~> 0.16.0" # this entry can go away when ruby < 3 support is gone
13
27
  if RUBY_VERSION < "2.6.0"
14
28
  gem "climate_control", "= 0.1.0"
15
- gem "vcr", "= 6.0.0"
16
29
  gem "mixlib-shellout", "= 3.2.5"
30
+ gem "public_suffix", "<= 5.1.1" # Dep of addressable which is a dep of webmock
31
+ gem "vcr", "= 6.0.0"
32
+ elsif RUBY_VERSION < "2.7.0"
33
+ gem "climate_control", "~> 1.0"
34
+ gem "mixlib-shellout", "< 3.3.9"
35
+ gem "public_suffix", "<= 5.1.1" # Dep of addressable which is a dep of webmock
36
+ gem "vcr", ">= 6.0.0", "< 6.2.0"
37
+ elsif RUBY_VERSION < "3.0.0"
38
+ gem "climate_control", "~> 1.0"
39
+ gem "mixlib-shellout", "< 3.3.9"
40
+ gem "public_suffix", "<= 5.1.1" # Dep of addressable which is a dep of webmock
41
+ gem "vcr"
42
+ elsif RUBY_VERSION < "3.2.0"
43
+ gem "climate_control", "~> 1.0"
44
+ gem "public_suffix", "< 7.0.0" # Dep of addressable which is a dep of webmock
45
+ gem "vcr"
46
+ elsif RUBY_VERSION < "3.3.0"
47
+ gem "climate_control", "~> 1.0"
48
+ gem "public_suffix", "< 7.0.0" # Dep of addressable which is a dep of webmock
49
+ gem "vcr"
50
+ elsif RUBY_VERSION >= "4.0.0"
51
+ gem "base64"
52
+ gem "benchmark"
53
+ gem "climate_control", "~> 1.0"
54
+ gem "ostruct"
55
+ gem "racc"
56
+ gem "vcr"
57
+ elsif RUBY_VERSION >= "3.4.0"
58
+ gem "base64"
59
+ gem "climate_control", "~> 1.0"
60
+ gem "racc"
61
+ gem "vcr"
62
+ elsif RUBY_VERSION >= "3.3.0"
63
+ gem "climate_control", "~> 1.0"
64
+ gem "racc"
65
+ gem "vcr"
17
66
  else
18
67
  gem "climate_control", "~> 1.0"
19
68
  gem "vcr"
20
69
  end
21
70
  end
22
71
 
23
- # use old chefstyle to support TargetRubyVersion of 1.9
24
72
  group :chefstyle do
25
- gem "chefstyle", "~> 0.4.0"
73
+ gem "chefstyle", "~> 0.12.0" # Minimum version that will run without errors on Ruby 3.4
26
74
  end
27
75
 
28
76
  group :debug do
29
77
  gem "pry"
30
- gem "pry-byebug"
78
+ if RUBY_VERSION < "2.7.0"
79
+ gem "byebug", "< 12.0" # Dep of pry-bybug
80
+ gem "pry-byebug", "< 3.10.0"
81
+ elsif RUBY_VERSION < "3.1.0"
82
+ gem "byebug", "< 12.0" # Dep of pry-bybug
83
+ gem "pry-byebug"
84
+ else
85
+ gem "pry-byebug"
86
+ end
31
87
  gem "rb-readline"
32
88
  end
@@ -19,6 +19,7 @@ require "erb" unless defined?(Erb)
19
19
  require "ostruct" unless defined?(OpenStruct)
20
20
  require_relative "../util"
21
21
  require_relative "../dist"
22
+ require "net/http" unless defined?(Net::HTTP)
22
23
 
23
24
  module Mixlib
24
25
  class Install
@@ -68,6 +69,17 @@ module Mixlib
68
69
  def get_script(name, context = {})
69
70
  self.class.get_script(name, context)
70
71
  end
72
+
73
+ def install_sh_from_upstream
74
+ uri = URI.parse(options.options[:new_omnibus_download_url])
75
+ response = Net::HTTP.get_response(uri)
76
+
77
+ if response.code == "200"
78
+ response.body
79
+ else
80
+ raise StandardError, "unable to fetch the install.sh"
81
+ end
82
+ end
71
83
  end
72
84
  end
73
85
  end
@@ -1,6 +1,9 @@
1
- if test -d "/opt/$project" && test "x$install_strategy" = "xonce"; then
2
- echo "$project installation detected"
3
- echo "install_strategy set to 'once'"
4
- echo "Nothing to install"
5
- exit
6
- fi
1
+ # Check for chef-client command in various locations
2
+ for path in /hab/pkgs/chef/chef-infra-client/*/*/bin/chef-client "/usr/bin/${project}-client" "/opt/$project/bin/${project}-client"; do
3
+ if test -x "$path" 2>/dev/null && test "x$install_strategy" = "xonce"; then
4
+ echo "$project installation detected at $path"
5
+ echo "install_strategy set to 'once'"
6
+ echo "Nothing to install"
7
+ exit
8
+ fi
9
+ done
@@ -59,11 +59,19 @@ function Install-Project {
59
59
  $install_strategy
60
60
  )
61
61
 
62
- if ((Test-Path "$env:systemdrive\<%= windows_dir %>\$project\embedded") -and ($install_strategy -eq 'once')) {
63
- Write-Host "$project installation detected"
64
- Write-Host "install_strategy set to 'once'"
65
- Write-Host "Nothing to install"
66
- exit
62
+ # Check for chef-client command in various locations
63
+ $chef_locations = @(
64
+ "$env:systemdrive\hab\pkgs\chef\chef-infra-client\*\*\bin\chef-client.bat",
65
+ "$env:systemdrive\<%= windows_dir %>\$project\bin\$project-client.bat"
66
+ )
67
+ foreach ($path in $chef_locations) {
68
+ $resolved = Get-Item $path -ErrorAction SilentlyContinue | Select-Object -First 1
69
+ if ($resolved -and (Test-Path $resolved.FullName) -and ($install_strategy -eq 'once')) {
70
+ Write-Host "$project installation detected at $($resolved.FullName)"
71
+ Write-Host "install_strategy set to 'once'"
72
+ Write-Host "Nothing to install"
73
+ exit
74
+ }
67
75
  }
68
76
 
69
77
  # Set http_proxy as env var
@@ -93,8 +101,8 @@ function Install-Project {
93
101
  else {
94
102
  $filename = (([System.Uri]$download_url).AbsolutePath -split '/')[-1]
95
103
  }
96
- Write-Verbose "Download directory: $download_directory"
97
- Write-Verbose "Filename: $filename"
104
+ Write-Host "Download directory: $download_directory"
105
+ Write-Host "Filename: $filename"
98
106
 
99
107
  if (-not (test-path $download_directory)) {
100
108
  mkdir $download_directory
@@ -104,23 +112,23 @@ function Install-Project {
104
112
  $download_destination = join-path $download_directory $filename
105
113
 
106
114
  if ((test-path $download_destination)) {
107
- Write-Verbose "Found existing installer at $download_destination."
115
+ Write-Host "Found existing installer at $download_destination."
108
116
  if (-not [string]::IsNullOrEmpty($sha256)) {
109
- Write-Verbose "Checksum specified"
117
+ Write-Host "Checksum specified"
110
118
  $valid_checksum = Test-ProjectPackage -Path $download_destination -Algorithm 'SHA256' -Hash $sha256
111
119
  if ($valid_checksum -eq $true) {
112
- Write-Verbose "Checksum verified, using existing installer."
120
+ Write-Host "Checksum verified, using existing installer."
113
121
  $cached_installer_available=$true # local file OK
114
122
  $verify_checksum = $false # no need to re-verify checksums
115
123
  }
116
124
  else {
117
- Write-Verbose "Checksum mismatch, ignoring existing installer."
125
+ Write-Host "Checksum mismatch, ignoring existing installer."
118
126
  $cached_installer_available=$false # bad local file
119
127
  $verify_checksum = $false # re-verify checksums
120
128
  }
121
129
  }
122
130
  else {
123
- Write-Verbose "Checksum not specified, existing installer ignored."
131
+ Write-Host "Checksum not specified, existing installer ignored."
124
132
  $cached_installer_available=$false # ignore local file
125
133
  $verify_checksum = $false # no checksum to compare
126
134
  }
@@ -128,7 +136,7 @@ function Install-Project {
128
136
 
129
137
  if (-not ($cached_installer_available)) {
130
138
  if ($pscmdlet.ShouldProcess("$($download_url)", "Download $project")) {
131
- Write-Verbose "Downloading $project from $($download_url) to $download_destination."
139
+ Write-Host "Downloading $project from $($download_url) to $download_destination."
132
140
  Get-WebContent $download_url -filepath $download_destination
133
141
  }
134
142
  }
@@ -22,11 +22,10 @@ module Mixlib
22
22
  class Install
23
23
  class Generator
24
24
  def self.install_command(options)
25
- if options.for_ps1?
26
- PowerShell.new(options).install_command
27
- else
28
- Bourne.new(options).install_command
29
- end
25
+ klass = options.for_ps1? ? PowerShell : Bourne
26
+ meth = options.options[:new_omnibus_download_url] ? :install_sh_from_upstream : :install_command
27
+
28
+ klass.new(options).send(meth)
30
29
  end
31
30
  end
32
31
  end
@@ -21,6 +21,7 @@ require_relative "util"
21
21
  require_relative "generator/powershell"
22
22
  require_relative "dist"
23
23
  require "cgi"
24
+ require "net/http" unless defined?(Net::HTTP)
24
25
 
25
26
  module Mixlib
26
27
  class Install
@@ -101,6 +102,17 @@ module Mixlib
101
102
  shell_code_from_file(vars)
102
103
  end
103
104
 
105
+ def install_command_from_omnitruck(url)
106
+ uri = URI.parse(url)
107
+ response = Net::HTTP.get_response(uri)
108
+
109
+ if response.code == "200"
110
+ response.body
111
+ else
112
+ raise StandardError, "unable to fetch the install.sh"
113
+ end
114
+ end
115
+
104
116
  private
105
117
 
106
118
  # Generates the install command variables for Bourne shell-based
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class Install
3
- VERSION = "3.12.30"
3
+ VERSION = "3.13.0"
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.30
4
+ version: 3.13.0
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: 2024-02-14 00:00:00.000000000 Z
12
+ date: 2026-01-06 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.1.4
120
+ rubygems_version: 3.3.27
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: A library for interacting with Chef Software Inc's software distribution