mixlib-install 3.12.20 → 3.12.23

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: 3b7e852271e0ff401f9ecd64f0713df06223310306fcab1bc2ea7f20d155da4f
4
- data.tar.gz: 4cf638db66178b2436dcec6f35a55965af55686df9957d7382fcd91c206e2e02
3
+ metadata.gz: 687fca4a38f2f4399c6cdbbcb83ee07d700ed88e0c0780a4e7669e8f6bee90c3
4
+ data.tar.gz: 07752cab13343e0d2c811ce49b9d46afef365784ac60c9a538688c2ad519b1f2
5
5
  SHA512:
6
- metadata.gz: a2b192a68c026200b142ed7e4d9c99bb8f5a133330613abe756bff5aab6a38f1f76e3e418c6f8fd0f277acfcab1cc4375cd418e41afe097f59f50d13bd6ad485
7
- data.tar.gz: 1a2781e80f15c58942a06874cf5eb3f534dec47ead6121ea7eaf63b9e0de46b1e8893ec04d8c77a509b258bfaa69eca7395839fd8b3fb568c64ea1377182de46
6
+ metadata.gz: 72882b68c9bc0ddb6d54e8a3eeff527248dd4d6cab241ecc9278fd74cb869fa861cc1de4ef2fe2eb3631138ef112317e65f0dc70c26132c58cad66ad78074965
7
+ data.tar.gz: c39c0155192848b29405b0df348dd4e1eba26707b8e9f359dc44ecd55c1bb32e4d76cc02fd7f343e73021630cee76a77485c3f64a060973ce929539f6c659de3
@@ -30,7 +30,6 @@ module Mixlib
30
30
  class Install
31
31
  class Backend
32
32
  class PackageRouter < Base
33
- ENDPOINT = Mixlib::Install::Dist::PRODUCT_ENDPOINT.freeze
34
33
 
35
34
  COMPAT_DOWNLOAD_URL_ENDPOINT = "http://packages.chef.io".freeze
36
35
 
@@ -269,7 +268,7 @@ EOF
269
268
  end
270
269
 
271
270
  def endpoint
272
- @endpoint ||= ENV.fetch("PACKAGE_ROUTER_ENDPOINT", ENDPOINT)
271
+ @endpoint ||= PRODUCT_MATRIX.lookup(options.product_name, options.product_version).api_url
273
272
  end
274
273
 
275
274
  def omnibus_project
@@ -2,13 +2,17 @@
2
2
  [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls,Tls11,Tls12'
3
3
 
4
4
  function Get-PlatformVersion {
5
- switch -regex ((Get-Win32OS).version) {
6
- '10\.0\.\d+' {$platform_version = '2016'}
7
- '10\.0\.17\d+' {$platform_version = '2019'}
8
- '6\.3\.\d+' {$platform_version = '2012r2'}
9
- '6\.2\.\d+' {$platform_version = '2012'}
10
- '6\.1\.\d+' {$platform_version = '2008r2'}
11
- '6\.0\.\d+' {$platform_version = '2008'}
5
+ [version]$osVersion = (Get-Win32OS).version
6
+
7
+ $platform_version = switch ($osVersion) {
8
+ # Windows Server build numbers from: https://betawiki.net/wiki/Microsoft_Windows
9
+ { $_ -ge [version]'10.0.20145' } { '2022'; break }
10
+ { $_ -ge [version]'10.0.17609' } { '2019'; break }
11
+ { $_ -ge [version]'10.0.0' } { '2016'; break }
12
+ { $_ -ge [version]'6.3.0' } { '2012r2'; break }
13
+ { $_ -ge [version]'6.2.0' } { '2012'; break }
14
+ { $_ -ge [version]'6.1.0' } { '2008r2'; break }
15
+ { $_ -ge [version]'6.0.0' } { '2008'; break }
12
16
  }
13
17
 
14
18
  if(Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Server\ServerLevels') {
@@ -26,7 +26,7 @@ module Mixlib
26
26
  class Options
27
27
  class InvalidOptions < ArgumentError; end
28
28
 
29
- attr_reader :options, :errors, :original_platform_version
29
+ attr_reader :options, :errors, :original_platform_version, :supported_product_names
30
30
 
31
31
  SUPPORTED_ARCHITECTURES = %w{
32
32
  aarch64
@@ -46,8 +46,6 @@ module Mixlib
46
46
  :unstable,
47
47
  ]
48
48
 
49
- SUPPORTED_PRODUCT_NAMES = PRODUCT_MATRIX.products
50
-
51
49
  SUPPORTED_SHELL_TYPES = [
52
50
  :ps1,
53
51
  :sh,
@@ -77,6 +75,15 @@ module Mixlib
77
75
  # Store original options in cases where we must remap
78
76
  @original_platform_version = options[:platform_version]
79
77
 
78
+ # Eval extra products definition
79
+ extra_products = ENV.fetch("EXTRA_PRODUCTS_FILE", nil)
80
+ unless extra_products.nil?
81
+ PRODUCT_MATRIX.instance_eval(::File.read(extra_products), extra_products)
82
+ end
83
+
84
+ # Store supported product names
85
+ @supported_product_names = PRODUCT_MATRIX.products
86
+
80
87
  resolve_platform_version_compatibility_mode!
81
88
 
82
89
  map_windows_versions!
@@ -189,10 +196,10 @@ Must be one of: #{SUPPORTED_ARCHITECTURES.join(", ")}
189
196
  end
190
197
 
191
198
  def validate_product_names
192
- unless SUPPORTED_PRODUCT_NAMES.include? product_name
199
+ unless @supported_product_names.include? product_name
193
200
  errors << <<-EOS
194
201
  Unknown product name #{product_name}.
195
- Must be one of: #{SUPPORTED_PRODUCT_NAMES.join(", ")}
202
+ Must be one of: #{@supported_product_names.join(", ")}
196
203
  EOS
197
204
  end
198
205
  end
@@ -36,6 +36,7 @@ module Mixlib
36
36
  :omnibus_project,
37
37
  :github_repo,
38
38
  :downloads_product_page_url,
39
+ :api_url,
39
40
  ]
40
41
 
41
42
  #
@@ -86,6 +87,8 @@ module Mixlib
86
87
  "#{Mixlib::Install::Dist::DOWNLOADS_PAGE}/#{product_key}"
87
88
  when :github_repo
88
89
  "#{Mixlib::Install::Dist::GITHUB_ORG}/#{product_key}"
90
+ when :api_url
91
+ ENV.fetch("PACKAGE_ROUTER_ENDPOINT", Mixlib::Install::Dist::PRODUCT_ENDPOINT)
89
92
  else
90
93
  nil
91
94
  end
@@ -47,6 +47,11 @@ PRODUCT_MATRIX = Mixlib::Install::ProductMatrix.new do
47
47
  package_name "chef"
48
48
  end
49
49
 
50
+ product "chef-universal" do
51
+ product_name "Chef Infra Client MacOS Universal"
52
+ package_name "universal-package"
53
+ end
54
+
50
55
  product "chef-backend" do
51
56
  product_name "Chef Backend"
52
57
  package_name "chef-backend"
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class Install
3
- VERSION = "3.12.20"
3
+ VERSION = "3.12.23"
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.20
4
+ version: 3.12.23
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: 2022-08-09 00:00:00.000000000 Z
12
+ date: 2022-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mixlib-shellout