omnibus 8.3.2 → 9.0.11

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: 0ead593d30d6adc565642ff443cce0b239294752253a6811d94f830160af190c
4
- data.tar.gz: b75f1260a3b3acfb23bc31f9f376edb1be0799567d5623a2c33a3d350041468f
3
+ metadata.gz: 4c7c8bc84ab97c3a75715fc42df6d16ea4df3a301cc24fd6b6b096f65684790f
4
+ data.tar.gz: 70613619043bc015ad98e7748f4bf93ba6daad5c41eb41155bb817edd2e06d98
5
5
  SHA512:
6
- metadata.gz: c403ea34e2b0352ed171abc7d329a797f36f1b8bd9d79c4bd2f4da1c3d5c187a9caa7bcad4fca8d7ab4577b9d3c079b05927fe872d145ccd0e2ffa1b9c302820
7
- data.tar.gz: 3230fb144ca86a372f6de1e3e5fd21f1e9e0c72c95c2a8ef0194bca0b0f8437a7881d1de882666c9980d2a9c2ccaba371646ae69648eb6191d55266875d3258e
6
+ metadata.gz: 060c19bb8659c184104e6dd7e4a035ff6250098b555948202a5ecaaf11af00f94e9625c8a07aeb337ec9748c3a8e5b6c2e48edd866b85a582387dbe8db26f1df
7
+ data.tar.gz: fd7b52b9bf73774a0b42b3dc5bca7e367abce0660c64e1df1d26bb78b77b106e33f9e759c52caf526445392bcd52fc6f41fe3a54006aec055cce5a776b807d89
@@ -601,6 +601,18 @@ module Omnibus
601
601
  # @return [true, false]
602
602
  default(:fatal_transitive_dependency_licensing_warnings, false)
603
603
 
604
+ # Fail the build when health check does not succeed. This may only be set to false
605
+ # for very specific use-cases in the omnibus project. e.g. creating a wrapper installer
606
+ #
607
+ # @return [true, false]
608
+ default(:health_check, true)
609
+
610
+ # Use the internal_source URL when fetching software dependencies. e.g. when creating an
611
+ # omnibus package using artifactory as the source url.
612
+ #
613
+ # @return [true, false]
614
+ default(:use_internal_sources, false)
615
+
604
616
  # --------------------------------------------------
605
617
  # @!endgroup
606
618
  #
@@ -351,4 +351,15 @@ module Omnibus
351
351
  EOH
352
352
  end
353
353
  end
354
+
355
+ class InternalSourceMissing < Error
356
+ def initialize(software)
357
+ super <<~EOH
358
+ Internal source missing for #{software.name}.
359
+
360
+ When :use_internal_sources is set in the configuration you must specify an
361
+ internal_source for sources fetched from a url.
362
+ EOH
363
+ end
364
+ end
354
365
  end
@@ -147,6 +147,8 @@ module Omnibus
147
147
  def download_url
148
148
  if Config.use_s3_caching
149
149
  S3Cache.url_for(self)
150
+ elsif Config.use_internal_sources && !source[:internal]
151
+ raise InternalSourceMissing.new(self)
150
152
  else
151
153
  source[:url]
152
154
  end
@@ -212,7 +214,7 @@ module Omnibus
212
214
  # :seven_zip - use 7zip for all tar/compressed tar files on windows.
213
215
  # :lax_tar - use tar.exe on windows but ignore errors.
214
216
  #
215
- # Both 7z and bsdtar have issues on windows.
217
+ # 7z has issues on windows.
216
218
  #
217
219
  # 7z cannot extract and untar at the same time. You need to extract to a
218
220
  # temporary location and then extract again into project_dir.
@@ -221,15 +223,6 @@ module Omnibus
221
223
  # location simply results in a text file with the target path written in
222
224
  # it. It does this without throwing any errors.
223
225
  #
224
- # bsdtar will exit(1) if it is encounters symlinks on windows. So we can't
225
- # use shellout! directly.
226
- #
227
- # bsdtar will also exit(1) and fail to overwrite files at the destination
228
- # during extraction if a file already exists at the destination and is
229
- # marked read-only. This used to be a problem when we weren't properly
230
- # cleaning an existing project_dir. It should be less of a problem now...
231
- # but who knows.
232
- #
233
226
  def extract
234
227
  # Only used by tar
235
228
  compression_switch = ""
@@ -243,7 +236,7 @@ module Omnibus
243
236
  returns = [0]
244
237
  returns << 1 if source[:extract] == :lax_tar
245
238
 
246
- shellout!("tar #{compression_switch}xf #{safe_downloaded_file} -C#{safe_project_dir}", returns: returns)
239
+ shellout!("tar #{compression_switch}xf #{downloaded_file} --force-local -C#{project_dir}", returns: returns)
247
240
  elsif downloaded_file.end_with?(*COMPRESSED_TAR_EXTENSIONS)
248
241
  Dir.mktmpdir do |temp_dir|
249
242
  log.debug(log_key) { "Temporarily extracting `#{safe_downloaded_file}' to `#{temp_dir}'" }
@@ -64,6 +64,10 @@ module Omnibus
64
64
  # if the healthchecks pass
65
65
  #
66
66
  def run!
67
+ unless Config.health_check
68
+ log.info(log_key) { "Health check skipped as specified in config for #{project.name}" }
69
+ return true
70
+ end
67
71
  measure("Health check time") do
68
72
  log.info(log_key) { "Running health on #{project.name}" }
69
73
  bad_libs, good_libs =
@@ -345,11 +349,16 @@ module Omnibus
345
349
  bad_libs = {}
346
350
  good_libs = {}
347
351
 
348
- read_shared_libs("find #{project.install_dir}/ -type f | xargs file | grep \"ELF\" | awk -F: '{print $1}' | sed -e 's/:$//'", "xargs -n 1 ldd") do |line|
352
+ # The case/when below depends on the "current_library" being output with a : at the end
353
+ # and then the dependencies on subsequent lines in the form "library.so.1 => /lib/64/library.so.1"
354
+ # This output format only happens if ldd is passed multiple libraries (for Solaris, similar to Linux)
355
+ # FIXME if any of the `when` clauses in the `health_check_*` methods run before the `current_library`
356
+ # they probably should error out with an explicit callout of formatting with their environment's
357
+ # respective ldd parsing
358
+ read_shared_libs("find #{project.install_dir}/ -type f | xargs file | grep \"ELF\" | awk -F: '{print $1}' | sed -e 's/:$//'", "xargs ldd") do |line|
349
359
  case line
350
360
  when /^(.+):$/
351
361
  current_library = Regexp.last_match[1]
352
- log.debug(log_key) { "Analyzing dependencies for #{current_library}" }
353
362
  when /^\s+(.+) \=\>\s+(.+)( \(.+\))?$/
354
363
  name = Regexp.last_match[1]
355
364
  linked = Regexp.last_match[2]
@@ -218,7 +218,7 @@ module Omnibus
218
218
  # version is the same as Windows 2012R2. It's only here for completeness
219
219
  # and documentation.
220
220
  when /6\.3\.\d+/, "8.1" then "8.1"
221
- when /^10\.0/ then "10"
221
+ when "10", /^10\.0/ then "10"
222
222
  else
223
223
  raise UnknownPlatformVersion.new(platform, platform_version)
224
224
  end
@@ -179,7 +179,7 @@ module Omnibus
179
179
  if null?(val)
180
180
  @install_dir || raise(MissingRequiredAttribute.new(self, :install_dir, "/opt/chef"))
181
181
  else
182
- @install_dir = val.tr('\\', "/").squeeze("/").chomp("/")
182
+ @install_dir = val.tr('\\', "/").squeeze("/").chomp("/") # rubocop:disable Style/StringLiterals
183
183
  end
184
184
  end
185
185
  expose :install_dir
@@ -336,7 +336,7 @@ module Omnibus
336
336
  extra_keys = val.keys - [
337
337
  :git, :file, :path, :url, # fetcher types
338
338
  :md5, :sha1, :sha256, :sha512, # hash type - common to all fetchers
339
- :cookie, :warning, :unsafe, :extract, :cached_name, :authorization, # used by net_fetcher
339
+ :cookie, :warning, :unsafe, :extract, :cached_name, :authorization, :internal, # used by net_fetcher
340
340
  :options, # used by path_fetcher
341
341
  :submodules # used by git_fetcher
342
342
  ]
@@ -351,8 +351,21 @@ module Omnibus
351
351
  "not include duplicate keys. Duplicate keys: #{duplicate_keys.inspect}")
352
352
  end
353
353
 
354
- @source ||= {}
355
- @source.merge!(val)
354
+ if Config.use_internal_sources && val[:url]
355
+ if internal_source_set? && val[:internal].nil?
356
+ # We only want to replace the hash types here
357
+ hash_types = %i{md5 sha1 sha256 sha512}
358
+ val.each_key do |key|
359
+ val.delete(key) unless hash_types.include?(key)
360
+ end
361
+ end
362
+
363
+ @source ||= {}
364
+ @source.merge!(val)
365
+ else
366
+ @source ||= {}
367
+ @source.merge!(val)
368
+ end
356
369
  end
357
370
 
358
371
  override = canonicalize_source(overrides[:source])
@@ -360,6 +373,22 @@ module Omnibus
360
373
  end
361
374
  expose :source
362
375
 
376
+ def internal_source_set?
377
+ @source && @source[:internal] == true
378
+ end
379
+
380
+ def internal_source(val = NULL)
381
+ unless val.is_a?(Hash)
382
+ raise InvalidValue.new(:internal_source,
383
+ "be a kind of `Hash', but was `#{val.class.inspect}'")
384
+ end
385
+ if Config.use_internal_sources
386
+ val[:internal] = true
387
+ source(val)
388
+ end
389
+ end
390
+ expose :internal_source
391
+
363
392
  #
364
393
  # Set or retrieve the {#default_version} of the software to build.
365
394
  #
@@ -717,7 +746,7 @@ module Omnibus
717
746
  {
718
747
  "CC" => "clang",
719
748
  "CXX" => "clang++",
720
- "LDFLAGS" => "-L#{install_dir}/embedded/lib",
749
+ "LDFLAGS" => "-L#{install_dir}/embedded/lib -Wl,-rpath,#{install_dir}/embedded/lib",
721
750
  "CFLAGS" => "-I#{install_dir}/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
722
751
  }
723
752
  when "windows"
@@ -15,5 +15,5 @@
15
15
  #
16
16
 
17
17
  module Omnibus
18
- VERSION = "8.3.2".freeze
18
+ VERSION = "9.0.11".freeze
19
19
  end
@@ -88,11 +88,13 @@ OMNIOS_WHITELIST_LIBS = [
88
88
  SOLARIS_WHITELIST_LIBS = [
89
89
  /libaio\.so/,
90
90
  /libavl\.so/,
91
+ /libbsm\.so/,
91
92
  /libcrypt_[di]\.so/,
92
93
  /libcrypto.so/,
93
94
  /libcurses\.so/,
94
95
  /libdoor\.so/,
95
96
  /libgen\.so/,
97
+ /libinetutil\.so/,
96
98
  /libmd5\.so/,
97
99
  /libmd\.so/,
98
100
  /libmp\.so/,
@@ -102,9 +104,11 @@ SOLARIS_WHITELIST_LIBS = [
102
104
  /libsocket\.so/,
103
105
  /libssl.so/,
104
106
  /libthread.so/,
107
+ /libtsol\.so/,
105
108
  /libuutil\.so/,
106
109
  /libkstat\.so/,
107
110
  # solaris 11 libraries:
111
+ /libstdc\+\+\.so/,
108
112
  /libc\.so\.1/,
109
113
  /libm\.so\.2/,
110
114
  /libdl\.so\.1/,
@@ -173,6 +177,8 @@ MAC_WHITELIST_LIBS = [
173
177
 
174
178
  FREEBSD_WHITELIST_LIBS = [
175
179
  /libc\.so/,
180
+ /libc\+\+\.so/,
181
+ /libcxxrt\.so/,
176
182
  /libgcc_s\.so/,
177
183
  /libcrypt\.so/,
178
184
  /libm\.so/,
data/omnibus.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
20
20
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
21
21
  gem.require_paths = ["lib"]
22
22
 
23
- gem.add_dependency "aws-sdk-s3", "~> 1"
23
+ gem.add_dependency "aws-sdk-s3", "~> 1.116.0"
24
24
  gem.add_dependency "chef-utils", ">= 15.4"
25
25
  gem.add_dependency "chef-cleanroom", "~> 1.0"
26
26
  gem.add_dependency "ffi-yajl", "~> 2.2"
@@ -30,13 +30,14 @@ Gem::Specification.new do |gem|
30
30
  gem.add_dependency "thor", ">= 0.18", "< 2.0"
31
31
  gem.add_dependency "license_scout", "~> 1.0"
32
32
  gem.add_dependency "contracts", ">= 0.16.0", "< 0.17.0"
33
+ gem.add_dependency "rexml", "~> 3.2"
33
34
 
34
35
  gem.add_dependency "mixlib-versioning"
35
36
  gem.add_dependency "pedump"
36
37
 
37
38
  gem.add_development_dependency "artifactory", "~> 3.0"
38
39
  gem.add_development_dependency "aruba", "~> 2.0"
39
- gem.add_development_dependency "chefstyle", "= 1.7.5"
40
+ gem.add_development_dependency "chefstyle", "= 2.2.2"
40
41
  gem.add_development_dependency "fauxhai-ng", ">= 7.5"
41
42
  gem.add_development_dependency "rspec", "~> 3.0"
42
43
  gem.add_development_dependency "rspec-json_expectations"
@@ -222,7 +222,7 @@ module Omnibus
222
222
  output = capture_logging { subject.build }
223
223
 
224
224
  appbundler_path = File.join(embedded_bin_dir, "appbundler")
225
- appbundler_path.gsub!(%r{/}, '\\') if windows?
225
+ appbundler_path.gsub!(%r{/}, '\\') if windows? # rubocop:disable Style/StringLiterals
226
226
  expect(output).to include("#{appbundler_path} '#{project_dir}' '#{bin_dir}'")
227
227
  end
228
228
  end
@@ -173,6 +173,26 @@ module Omnibus
173
173
  end
174
174
  end
175
175
 
176
+ context "when use_internal_sources is true and no internal source url" do
177
+ before { Omnibus::Config.use_internal_sources(true) }
178
+
179
+ it "raises an exception" do
180
+ expect { fetch! }.to raise_error(InternalSourceMissing)
181
+ end
182
+ end
183
+
184
+ context "when use_internal_sources is true and internal source url given" do
185
+ before { Omnibus::Config.use_internal_sources(true) }
186
+ let(:source) do
187
+ { url: source_url, md5: source_md5, internal: true }
188
+ end
189
+
190
+ it "downloads the file" do
191
+ fetch!
192
+ expect(downloaded_file).to be_a_file
193
+ end
194
+ end
195
+
176
196
  context "source with sha1" do
177
197
  let(:source) do
178
198
  { url: source_url, sha1: source_sha1 }
@@ -60,7 +60,7 @@ RSpec.shared_examples "a software" do |name = "chefdk"|
60
60
 
61
61
  allow(software).to receive(:embedded_bin) do |binary|
62
62
  p = File.join(embedded_bin_dir, binary)
63
- p.gsub!(%r{/}, '\\') if windows?
63
+ p.gsub!(%r{/}, '\\') if windows? # rubocop:disable Style/StringLiterals
64
64
  p
65
65
  end
66
66
  end
@@ -14,7 +14,7 @@ module Omnibus
14
14
  # If we asked for Windows, we should also specify that magical
15
15
  # +File::ALT_SEPARATOR+ variable
16
16
  if options[:platform] && options[:platform] == "windows"
17
- stub_const("File::ALT_SEPARATOR", '\\')
17
+ stub_const("File::ALT_SEPARATOR", '\\') # rubocop:disable Style/StringLiterals
18
18
  end
19
19
  end
20
20
  end
@@ -23,7 +23,7 @@ module Omnibus
23
23
  allow(subject).to receive(:windows?).and_return(on_windows)
24
24
  allow(subject).to receive(:windows_safe_path) do |*args|
25
25
  path = File.join(*args)
26
- path.gsub!(File::SEPARATOR, '\\') if on_windows
26
+ path.gsub!(File::SEPARATOR, '\\') if on_windows # rubocop:disable Style/StringLiterals
27
27
  end
28
28
  end
29
29
 
@@ -171,7 +171,7 @@ module Omnibus
171
171
  context "when :bin is present" do
172
172
  it "uses the custom bin" do
173
173
  expect(subject).to receive(:command)
174
- .with("/path/to/make", in_msys_bash: true)
174
+ .with("/path/to/make", { in_msys_bash: true })
175
175
  subject.make(bin: "/path/to/make")
176
176
  end
177
177
  end
@@ -185,7 +185,7 @@ module Omnibus
185
185
 
186
186
  it "uses gmake and sets MAKE=gmake" do
187
187
  expect(subject).to receive(:command)
188
- .with("gmake", env: { "MAKE" => "gmake" }, in_msys_bash: true)
188
+ .with("gmake", { env: { "MAKE" => "gmake" }, in_msys_bash: true } )
189
189
  subject.make
190
190
  end
191
191
  end
@@ -198,26 +198,26 @@ module Omnibus
198
198
 
199
199
  it "uses make" do
200
200
  expect(subject).to receive(:command)
201
- .with("make", in_msys_bash: true)
201
+ .with("make", { in_msys_bash: true } )
202
202
  subject.make
203
203
  end
204
204
  end
205
205
 
206
206
  it "accepts 0 options" do
207
207
  expect(subject).to receive(:command)
208
- .with("make", in_msys_bash: true)
208
+ .with("make", { in_msys_bash: true } )
209
209
  expect { subject.make }.to_not raise_error
210
210
  end
211
211
 
212
212
  it "accepts an additional command string" do
213
213
  expect(subject).to receive(:command)
214
- .with("make install", in_msys_bash: true)
214
+ .with("make install", { in_msys_bash: true } )
215
215
  expect { subject.make("install") }.to_not raise_error
216
216
  end
217
217
 
218
218
  it "persists given options" do
219
219
  expect(subject).to receive(:command)
220
- .with("make", timeout: 3600, in_msys_bash: true)
220
+ .with("make", { timeout: 3600, in_msys_bash: true } )
221
221
  subject.make(timeout: 3600)
222
222
  end
223
223
  end
@@ -242,7 +242,7 @@ module Omnibus
242
242
 
243
243
  it "appends platform host to the options" do
244
244
  expect(subject).to receive(:command)
245
- .with("./configure --build=x86_64-w64-mingw32 --prefix=#{project_dir}/embedded", in_msys_bash: true)
245
+ .with("./configure --build=x86_64-w64-mingw32 --prefix=#{project_dir}/embedded", { in_msys_bash: true } )
246
246
  subject.configure
247
247
  end
248
248
  end
@@ -258,7 +258,7 @@ module Omnibus
258
258
 
259
259
  it "appends platform host to the options" do
260
260
  expect(subject).to receive(:command)
261
- .with("./configure --build=i686-w64-mingw32 --prefix=#{project_dir}/embedded", in_msys_bash: true)
261
+ .with("./configure --build=i686-w64-mingw32 --prefix=#{project_dir}/embedded", { in_msys_bash: true } )
262
262
  subject.configure
263
263
  end
264
264
  end
@@ -266,7 +266,7 @@ module Omnibus
266
266
  context "when :bin is present" do
267
267
  it "uses the custom bin" do
268
268
  expect(subject).to receive(:command)
269
- .with("/path/to/configure --prefix=#{project_dir}/embedded", in_msys_bash: true)
269
+ .with("/path/to/configure --prefix=#{project_dir}/embedded", { in_msys_bash: true } )
270
270
  subject.configure(bin: "/path/to/configure")
271
271
  end
272
272
  end
@@ -274,32 +274,32 @@ module Omnibus
274
274
  context "when :prefix is present" do
275
275
  it "emits non-empty prefix" do
276
276
  expect(subject).to receive(:command)
277
- .with("./configure --prefix=/some/prefix", in_msys_bash: true)
277
+ .with("./configure --prefix=/some/prefix", { in_msys_bash: true } )
278
278
  subject.configure(prefix: "/some/prefix")
279
279
  end
280
280
 
281
281
  it "omits prefix if empty" do
282
282
  expect(subject).to receive(:command)
283
- .with("./configure", in_msys_bash: true)
283
+ .with("./configure", { in_msys_bash: true } )
284
284
  subject.configure(prefix: "")
285
285
  end
286
286
  end
287
287
 
288
288
  it "accepts 0 options" do
289
289
  expect(subject).to receive(:command)
290
- .with("./configure --prefix=#{project_dir}/embedded", in_msys_bash: true)
290
+ .with("./configure --prefix=#{project_dir}/embedded", { in_msys_bash: true } )
291
291
  expect { subject.configure }.to_not raise_error
292
292
  end
293
293
 
294
294
  it "accepts an additional command string" do
295
295
  expect(subject).to receive(:command)
296
- .with("./configure --prefix=#{project_dir}/embedded --myopt", in_msys_bash: true)
296
+ .with("./configure --prefix=#{project_dir}/embedded --myopt", { in_msys_bash: true } )
297
297
  expect { subject.configure("--myopt") }.to_not raise_error
298
298
  end
299
299
 
300
300
  it "persists given options" do
301
301
  expect(subject).to receive(:command)
302
- .with("./configure --prefix=#{project_dir}/embedded", timeout: 3600, in_msys_bash: true)
302
+ .with("./configure --prefix=#{project_dir}/embedded", { timeout: 3600, in_msys_bash: true } )
303
303
  subject.configure(timeout: 3600)
304
304
  end
305
305
  end
@@ -321,28 +321,28 @@ module Omnibus
321
321
  it "invokes patch with patch level 1 unless specified" do
322
322
  expect { subject.patch(source: "good_patch") }.to_not raise_error
323
323
  expect(subject).to receive(:shellout!)
324
- .with("patch -p1 -i #{project_dir}/patch_location2/good_patch", in_msys_bash: true)
324
+ .with("patch -p1 -i #{project_dir}/patch_location2/good_patch", { in_msys_bash: true } )
325
325
  run_build_command
326
326
  end
327
327
 
328
328
  it "invokes patch with patch level provided" do
329
329
  expect { subject.patch(source: "good_patch", plevel: 0) }.to_not raise_error
330
330
  expect(subject).to receive(:shellout!)
331
- .with("patch -p0 -i #{project_dir}/patch_location2/good_patch", in_msys_bash: true)
331
+ .with("patch -p0 -i #{project_dir}/patch_location2/good_patch", { in_msys_bash: true } )
332
332
  run_build_command
333
333
  end
334
334
 
335
335
  it "invokes patch differently if target is provided" do
336
336
  expect { subject.patch(source: "good_patch", target: "target/path") }.to_not raise_error
337
337
  expect(subject).to receive(:shellout!)
338
- .with("cat #{project_dir}/patch_location2/good_patch | patch -p1 target/path", in_msys_bash: true)
338
+ .with("cat #{project_dir}/patch_location2/good_patch | patch -p1 target/path", { in_msys_bash: true } )
339
339
  run_build_command
340
340
  end
341
341
 
342
342
  it "persists other options" do
343
343
  expect { subject.patch(source: "good_patch", timeout: 3600) }.to_not raise_error
344
344
  expect(subject).to receive(:shellout!)
345
- .with("patch -p1 -i #{project_dir}/patch_location2/good_patch", timeout: 3600, in_msys_bash: true)
345
+ .with("patch -p1 -i #{project_dir}/patch_location2/good_patch", { timeout: 3600, in_msys_bash: true } )
346
346
  run_build_command
347
347
  end
348
348
  end
@@ -45,6 +45,7 @@ module Omnibus
45
45
  include_examples "a configurable", :fetcher_read_timeout, 60
46
46
  include_examples "a configurable", :fetcher_retries, 5
47
47
  include_examples "a configurable", :fatal_licensing_warnings, false
48
+ include_examples "a configurable", :health_check, true
48
49
  include_examples "a configurable", :fips_mode, false
49
50
 
50
51
  describe "#workers" do
@@ -421,19 +421,19 @@ module Omnibus
421
421
  it_behaves_like "an extractor", "zip", {},
422
422
  ['7z.exe x C:\\file.zip -oC:\\tmp\\project -r -y']
423
423
  it_behaves_like "an extractor", "tar", {},
424
- [['tar xf C:\\file.tar -CC:\\tmp\\project', { returns: [0] }]]
424
+ [["tar xf C:/file.tar --force-local -CC:/tmp/project", { returns: [0] }]]
425
425
  it_behaves_like "an extractor", "tgz", {},
426
- [['tar zxf C:\\file.tgz -CC:\\tmp\\project', { returns: [0] }]]
426
+ [["tar zxf C:/file.tgz --force-local -CC:/tmp/project", { returns: [0] }]]
427
427
  it_behaves_like "an extractor", "tar.gz", {},
428
- [['tar zxf C:\\file.tar.gz -CC:\\tmp\\project', { returns: [0] }]]
428
+ [["tar zxf C:/file.tar.gz --force-local -CC:/tmp/project", { returns: [0] }]]
429
429
  it_behaves_like "an extractor", "tar.bz2", {},
430
- [['tar jxf C:\\file.tar.bz2 -CC:\\tmp\\project', { returns: [0] }]]
430
+ [["tar jxf C:/file.tar.bz2 --force-local -CC:/tmp/project", { returns: [0] }]]
431
431
  it_behaves_like "an extractor", "txz", {},
432
- [['tar Jxf C:\\file.txz -CC:\\tmp\\project', { returns: [0] }]]
432
+ [["tar Jxf C:/file.txz --force-local -CC:/tmp/project", { returns: [0] }]]
433
433
  it_behaves_like "an extractor", "tar.xz", {},
434
- [['tar Jxf C:\\file.tar.xz -CC:\\tmp\\project', { returns: [0] }]]
434
+ [["tar Jxf C:/file.tar.xz --force-local -CC:/tmp/project", { returns: [0] }]]
435
435
  it_behaves_like "an extractor", "tar.lzma", {},
436
- [['tar --lzma -xf C:\\file.tar.lzma -CC:\\tmp\\project', { returns: [0] }]]
436
+ [["tar --lzma -xf C:/file.tar.lzma --force-local -CC:/tmp/project", { returns: [0] }]]
437
437
  end
438
438
 
439
439
  context "when seven_zip extract strategy is chosen" do
@@ -469,19 +469,19 @@ module Omnibus
469
469
  it_behaves_like "an extractor", "zip", { extract: :lax_tar },
470
470
  ['7z.exe x C:\\file.zip -oC:\\tmp\\project -r -y']
471
471
  it_behaves_like "an extractor", "tar", { extract: :lax_tar },
472
- [['tar xf C:\\file.tar -CC:\\tmp\\project', { returns: [0, 1] }]]
472
+ [["tar xf C:/file.tar --force-local -CC:/tmp/project", { returns: [0, 1] }]]
473
473
  it_behaves_like "an extractor", "tgz", { extract: :lax_tar },
474
- [['tar zxf C:\\file.tgz -CC:\\tmp\\project', { returns: [0, 1] }]]
474
+ [["tar zxf C:/file.tgz --force-local -CC:/tmp/project", { returns: [0, 1] }]]
475
475
  it_behaves_like "an extractor", "tar.gz", { extract: :lax_tar },
476
- [['tar zxf C:\\file.tar.gz -CC:\\tmp\\project', { returns: [0, 1] }]]
476
+ [["tar zxf C:/file.tar.gz --force-local -CC:/tmp/project", { returns: [0, 1] }]]
477
477
  it_behaves_like "an extractor", "tar.bz2", { extract: :lax_tar },
478
- [['tar jxf C:\\file.tar.bz2 -CC:\\tmp\\project', { returns: [0, 1] }]]
478
+ [["tar jxf C:/file.tar.bz2 --force-local -CC:/tmp/project", { returns: [0, 1] }]]
479
479
  it_behaves_like "an extractor", "txz", { extract: :lax_tar },
480
- [['tar Jxf C:\\file.txz -CC:\\tmp\\project', { returns: [0, 1] }]]
480
+ [["tar Jxf C:/file.txz --force-local -CC:/tmp/project", { returns: [0, 1] }]]
481
481
  it_behaves_like "an extractor", "tar.xz", { extract: :lax_tar },
482
- [['tar Jxf C:\\file.tar.xz -CC:\\tmp\\project', { returns: [0, 1] }]]
482
+ [["tar Jxf C:/file.tar.xz --force-local -CC:/tmp/project", { returns: [0, 1] }]]
483
483
  it_behaves_like "an extractor", "tar.lzma", { extract: :lax_tar },
484
- [['tar --lzma -xf C:\\file.tar.lzma -CC:\\tmp\\project', { returns: [0, 1] }]]
484
+ [["tar --lzma -xf C:/file.tar.lzma --force-local -CC:/tmp/project", { returns: [0, 1] }]]
485
485
  end
486
486
  end
487
487
 
@@ -229,7 +229,7 @@ module Omnibus
229
229
 
230
230
  context "when on Windows" do
231
231
  before { stub_ohai(platform: "windows", version: "2019") }
232
- before { stub_const("File::ALT_SEPARATOR", '\\') }
232
+ before { stub_const("File::ALT_SEPARATOR", '\\') } # rubocop:disable Style/StringLiterals
233
233
  it "returns a Windows iteration" do
234
234
  expect(subject.build_iteration).to eq(1)
235
235
  end
@@ -16,10 +16,18 @@ module Omnibus
16
16
  }
17
17
  end
18
18
 
19
+ let(:internal_source) do
20
+ {
21
+ url: "http://internal.com/",
22
+ md5: "efgh5678",
23
+ }
24
+ end
25
+
19
26
  let(:rel_path) { "software" }
20
27
 
21
28
  subject do
22
29
  local_source = source
30
+ local_internal_source = internal_source
23
31
  local_rel_path = rel_path
24
32
 
25
33
  described_class.new(project).evaluate do
@@ -27,6 +35,7 @@ module Omnibus
27
35
  default_version "1.2.3"
28
36
 
29
37
  source local_source
38
+ internal_source local_internal_source
30
39
  relative_path local_rel_path
31
40
  end
32
41
  end
@@ -239,7 +248,7 @@ module Omnibus
239
248
  "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
240
249
  "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
241
250
  "CXX" => "clang++",
242
- "LDFLAGS" => "-L/opt/project/embedded/lib",
251
+ "LDFLAGS" => "-L/opt/project/embedded/lib -Wl,-rpath,/opt/project/embedded/lib",
243
252
  "LD_RUN_PATH" => "/opt/project/embedded/lib",
244
253
  "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
245
254
  "OMNIBUS_INSTALL_DIR" => "/opt/project"
@@ -543,7 +552,7 @@ module Omnibus
543
552
 
544
553
  it "fetches from a fully expanded git path" do
545
554
  expect(subject.source).to eq(git: "https://github.com/chef/ohai.git")
546
- expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", git: "https://github.com/chef/ohai.git").and_return("1.2.8")
555
+ expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", { git: "https://github.com/chef/ohai.git" } ).and_return("1.2.8")
547
556
  subject.send(:fetcher)
548
557
  end
549
558
 
@@ -552,7 +561,7 @@ module Omnibus
552
561
 
553
562
  it "fetches from the override path" do
554
563
  expect(subject.source).to eq(git: "https://blah.com/git.git")
555
- expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", git: "https://blah.com/git.git").and_return("1.2.8")
564
+ expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", { git: "https://blah.com/git.git" } ).and_return("1.2.8")
556
565
  subject.send(:fetcher)
557
566
  end
558
567
  end
@@ -562,7 +571,7 @@ module Omnibus
562
571
 
563
572
  it "fetches from the override path" do
564
573
  expect(subject.source).to eq(git: "https://github.com/a/b.git")
565
- expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", git: "https://github.com/a/b.git").and_return("1.2.8")
574
+ expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", { git: "https://github.com/a/b.git" } ).and_return("1.2.8")
566
575
  subject.send(:fetcher)
567
576
  end
568
577
  end
@@ -577,7 +586,7 @@ module Omnibus
577
586
 
578
587
  it "fetches from the git spec" do
579
588
  expect(subject.source).to eq(git: "https://blah.com/git.git")
580
- expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", git: "https://blah.com/git.git").and_return("1.2.8")
589
+ expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", { git: "https://blah.com/git.git" } ).and_return("1.2.8")
581
590
  subject.send(:fetcher)
582
591
  end
583
592
 
@@ -586,12 +595,20 @@ module Omnibus
586
595
 
587
596
  it "fetches from the override path" do
588
597
  expect(subject.source).to eq(git: "https://github.com/a/b.git")
589
- expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", git: "https://github.com/a/b.git").and_return("1.2.8")
598
+ expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", { git: "https://github.com/a/b.git" } ).and_return("1.2.8")
590
599
  subject.send(:fetcher)
591
600
  end
592
601
  end
593
602
  end
594
603
 
604
+ context "when software internal_source is given" do
605
+ before { Omnibus::Config.use_internal_sources(true) }
606
+
607
+ it "sets the source with internal: true" do
608
+ expect(subject.source).to eq(url: "http://internal.com/", md5: "efgh5678", internal: true)
609
+ end
610
+ end
611
+
595
612
  describe "#fetcher" do
596
613
  before do
597
614
  expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", source).and_return("1.2.8")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnibus
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.3.2
4
+ version: 9.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-15 00:00:00.000000000 Z
11
+ date: 2022-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1'
19
+ version: 1.116.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1'
26
+ version: 1.116.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: chef-utils
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -174,6 +174,20 @@ dependencies:
174
174
  - - "<"
175
175
  - !ruby/object:Gem::Version
176
176
  version: 0.17.0
177
+ - !ruby/object:Gem::Dependency
178
+ name: rexml
179
+ requirement: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - "~>"
182
+ - !ruby/object:Gem::Version
183
+ version: '3.2'
184
+ type: :runtime
185
+ prerelease: false
186
+ version_requirements: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - "~>"
189
+ - !ruby/object:Gem::Version
190
+ version: '3.2'
177
191
  - !ruby/object:Gem::Dependency
178
192
  name: mixlib-versioning
179
193
  requirement: !ruby/object:Gem::Requirement
@@ -236,14 +250,14 @@ dependencies:
236
250
  requirements:
237
251
  - - '='
238
252
  - !ruby/object:Gem::Version
239
- version: 1.7.5
253
+ version: 2.2.2
240
254
  type: :development
241
255
  prerelease: false
242
256
  version_requirements: !ruby/object:Gem::Requirement
243
257
  requirements:
244
258
  - - '='
245
259
  - !ruby/object:Gem::Version
246
- version: 1.7.5
260
+ version: 2.2.2
247
261
  - !ruby/object:Gem::Dependency
248
262
  name: fauxhai-ng
249
263
  requirement: !ruby/object:Gem::Requirement