omnibus 6.0.1 → 6.0.24

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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/lib/omnibus/build_version.rb +1 -1
  4. data/lib/omnibus/builder.rb +1 -1
  5. data/lib/omnibus/changelog.rb +1 -1
  6. data/lib/omnibus/compressors/dmg.rb +18 -6
  7. data/lib/omnibus/core_extensions/open_uri.rb +1 -1
  8. data/lib/omnibus/exceptions.rb +103 -103
  9. data/lib/omnibus/fetchers/net_fetcher.rb +8 -6
  10. data/lib/omnibus/generator_files/.kitchen.local.yml.erb +10 -0
  11. data/lib/omnibus/generator_files/.kitchen.yml.erb +41 -0
  12. data/lib/omnibus/generator_files/Gemfile.erb +3 -3
  13. data/lib/omnibus/git_repository.rb +1 -1
  14. data/lib/omnibus/licensing.rb +1 -0
  15. data/lib/omnibus/metadata.rb +15 -15
  16. data/lib/omnibus/packager.rb +11 -10
  17. data/lib/omnibus/packagers/appx.rb +4 -4
  18. data/lib/omnibus/packagers/base.rb +19 -0
  19. data/lib/omnibus/packagers/bff.rb +13 -13
  20. data/lib/omnibus/packagers/deb.rb +14 -14
  21. data/lib/omnibus/packagers/ips.rb +7 -7
  22. data/lib/omnibus/packagers/msi.rb +73 -25
  23. data/lib/omnibus/packagers/pkg.rb +10 -10
  24. data/lib/omnibus/packagers/pkgsrc.rb +5 -5
  25. data/lib/omnibus/packagers/rpm.rb +31 -31
  26. data/lib/omnibus/packagers/solaris.rb +2 -2
  27. data/lib/omnibus/packagers/windows_base.rb +2 -2
  28. data/lib/omnibus/project.rb +4 -0
  29. data/lib/omnibus/publishers/artifactory_publisher.rb +17 -17
  30. data/lib/omnibus/publishers/s3_publisher.rb +20 -6
  31. data/lib/omnibus/s3_cache.rb +5 -5
  32. data/lib/omnibus/s3_helpers.rb +6 -4
  33. data/lib/omnibus/software.rb +7 -12
  34. data/lib/omnibus/version.rb +1 -1
  35. data/lib/omnibus/whitelist.rb +1 -0
  36. data/omnibus.gemspec +6 -7
  37. data/spec/functional/builder_spec.rb +1 -1
  38. data/spec/functional/licensing_spec.rb +49 -49
  39. data/spec/functional/templating_spec.rb +3 -3
  40. data/spec/support/git_helpers.rb +5 -5
  41. data/spec/unit/changelog_spec.rb +7 -7
  42. data/spec/unit/changelogprinter_spec.rb +5 -5
  43. data/spec/unit/compressors/dmg_spec.rb +7 -2
  44. data/spec/unit/generator_spec.rb +6 -34
  45. data/spec/unit/manifest_diff_spec.rb +18 -18
  46. data/spec/unit/metadata_spec.rb +10 -19
  47. data/spec/unit/packager_spec.rb +7 -7
  48. data/spec/unit/packagers/base_spec.rb +17 -0
  49. data/spec/unit/packagers/deb_spec.rb +1 -1
  50. data/spec/unit/packagers/ips_spec.rb +1 -1
  51. data/spec/unit/packagers/msi_spec.rb +45 -0
  52. data/spec/unit/packagers/pkg_spec.rb +1 -1
  53. data/spec/unit/packagers/rpm_spec.rb +1 -46
  54. data/spec/unit/packagers/solaris_spec.rb +3 -3
  55. data/spec/unit/software_spec.rb +2 -53
  56. data/spec/unit/util_spec.rb +1 -1
  57. metadata +21 -28
@@ -31,13 +31,6 @@ module Omnibus
31
31
  end
32
32
  end
33
33
 
34
- context "on Solaris 10" do
35
- before { stub_ohai(platform: "solaris2", version: "5.10") }
36
- it "prefers Solaris" do
37
- expect(described_class.for_current_system).to eq([Packager::Solaris])
38
- end
39
- end
40
-
41
34
  context "on AIX" do
42
35
  before { stub_ohai(platform: "aix", version: "7.1") }
43
36
  it "prefers BFF" do
@@ -52,6 +45,13 @@ module Omnibus
52
45
  end
53
46
  end
54
47
 
48
+ context "on Amazon Linux 2" do
49
+ before { stub_ohai(platform: "amazon", version: "2") }
50
+ it "prefers RPM" do
51
+ expect(described_class.for_current_system).to eq([Packager::RPM])
52
+ end
53
+ end
54
+
55
55
  context "on Debian" do
56
56
  before { stub_ohai(platform: "debian", version: "8.11") }
57
57
  it "prefers RPM" do
@@ -87,6 +87,23 @@ module Omnibus
87
87
  end
88
88
  end
89
89
 
90
+ describe "#skip_packager" do
91
+ it "is a DSL method" do
92
+ expect(subject).to have_exposed_method(:skip_packager)
93
+ end
94
+
95
+ it "requires the value to be a TrueClass or a FalseClass" do
96
+ expect do
97
+ subject.skip_packager(Object.new)
98
+ end.to raise_error(InvalidValue)
99
+ end
100
+
101
+ it "returns the given value" do
102
+ subject.skip_packager(true)
103
+ expect(subject.skip_packager).to be_truthy
104
+ end
105
+ end
106
+
90
107
  describe "#run!" do
91
108
  before do
92
109
  allow(subject).to receive(:remove_directory)
@@ -451,7 +451,7 @@ module Omnibus
451
451
  end
452
452
 
453
453
  describe "#safe_architecture" do
454
- let(:shellout) { double("Mixlib::ShellOut", :run_command => true, :error! => nil) }
454
+ let(:shellout) { double("Mixlib::ShellOut", run_command: true, error!: nil) }
455
455
 
456
456
  before do
457
457
  allow(Mixlib::ShellOut).to receive(:new).and_return(shellout)
@@ -21,7 +21,7 @@ module Omnibus
21
21
  let(:source_dir) { File.join(staging_dir, "proto_install") }
22
22
  let(:repo_dir) { File.join(staging_dir, "publish/repo") }
23
23
  let(:architecture) { "i86pc" }
24
- let(:shellout) { double("Mixlib::ShellOut", :run_command => true, :error! => nil) }
24
+ let(:shellout) { double("Mixlib::ShellOut", run_command: true, error!: nil) }
25
25
 
26
26
  before do
27
27
  Config.project_root(project_root)
@@ -90,6 +90,29 @@ module Omnibus
90
90
  end
91
91
  end
92
92
 
93
+ describe "#localization" do
94
+ it "is a DSL method" do
95
+ expect(subject).to have_exposed_method(:localization)
96
+ end
97
+
98
+ it "defaults to String en-us" do
99
+ expect(subject.localization).to be_a(String)
100
+ expect(subject.localization).to eq("en-us")
101
+ end
102
+
103
+ it "requires the value to be a String" do
104
+ expect do
105
+ subject.localization(Object.new)
106
+ end.to raise_error(InvalidValue)
107
+ end
108
+
109
+ it "returns the given value" do
110
+ loc = "te-st"
111
+ subject.localization(loc)
112
+ expect(subject.localization).to eq(loc)
113
+ end
114
+ end
115
+
93
116
  describe "#package_name" do
94
117
  before do
95
118
  allow(Config).to receive(:windows_arch).and_return(:foo_arch)
@@ -269,6 +292,28 @@ module Omnibus
269
292
  end
270
293
  end
271
294
 
295
+ describe "#wix_light_delay_validation" do
296
+ it "is a DSL method" do
297
+ expect(subject).to have_exposed_method(:wix_light_delay_validation)
298
+ end
299
+
300
+ it "requires the value to be a TrueClass or a FalseClass" do
301
+ expect do
302
+ subject.wix_light_delay_validation(Object.new)
303
+ end.to raise_error(InvalidValue)
304
+ end
305
+
306
+ it "defaults to an empty String" do
307
+ expect(subject.wix_light_delay_validation).to be_a(String)
308
+ expect(subject.wix_light_delay_validation).to be_empty
309
+ end
310
+
311
+ it "returns the string `-sval` when true" do
312
+ subject.wix_light_delay_validation(true)
313
+ expect(subject.wix_light_delay_validation).to eq("-sval")
314
+ end
315
+ end
316
+
272
317
  describe "#wix_candle_extension" do
273
318
  it "is a DSL method" do
274
319
  expect(subject).to have_exposed_method(:wix_candle_extension)
@@ -167,7 +167,7 @@ module Omnibus
167
167
  --resources "#{staging_dir}/Resources" \\
168
168
  --sign "My Special Identity" \\
169
169
  "#{package_dir}/project-full-name-1.2.3-2.pkg"
170
- EOH
170
+ EOH
171
171
  subject.build_product_pkg
172
172
  end
173
173
  end
@@ -267,7 +267,7 @@ module Omnibus
267
267
  end
268
268
 
269
269
  context "when scripts are given" do
270
- let(:scripts) { %w{ pre post preun postun verifyscript pretans posttrans } }
270
+ let(:scripts) { %w{ pre post preun postun verifyscript pretrans posttrans } }
271
271
 
272
272
  before do
273
273
  scripts.each do |script_name|
@@ -348,21 +348,6 @@ module Omnibus
348
348
  end
349
349
  end
350
350
 
351
- context "when the platform_family is wrlinux" do
352
- let(:spec_file) { "#{staging_dir}/SPECS/project-1.2.3-2.nexus5.x86_64.rpm.spec" }
353
-
354
- before do
355
- stub_ohai(platform: "nexus", version: "5")
356
- end
357
-
358
- it "writes out a spec file with no BuildArch" do
359
- subject.write_rpm_spec
360
- contents = File.read(spec_file)
361
-
362
- expect(contents).not_to include("BuildArch")
363
- end
364
- end
365
-
366
351
  context "when dist_tag is disabled" do
367
352
  let(:spec_file) { "#{staging_dir}/SPECS/project-1.2.3-2.x86_64.rpm.spec" }
368
353
 
@@ -499,36 +484,6 @@ module Omnibus
499
484
  expect(output).to include("The `version' component of RPM package names can only include")
500
485
  end
501
486
  end
502
-
503
- context "when the build is for nexus" do
504
- before do
505
- project.build_version("1.2-3")
506
- stub_ohai(platform: "nexus", version: "5")
507
- end
508
-
509
- it "returns the value while logging a message" do
510
- output = capture_logging do
511
- expect(subject.safe_version).to eq("1.2_3")
512
- end
513
-
514
- expect(output).to include("rpmbuild on Wind River Linux does not support this")
515
- end
516
- end
517
-
518
- context "when the build is for ios_xr" do
519
- before do
520
- project.build_version("1.2-3")
521
- stub_ohai(platform: "ios_xr", version: "6.0.0.14I")
522
- end
523
-
524
- it "returns the value while logging a message" do
525
- output = capture_logging do
526
- expect(subject.safe_version).to eq("1.2_3")
527
- end
528
-
529
- expect(output).to include("rpmbuild on Wind River Linux does not support this")
530
- end
531
- end
532
487
  end
533
488
 
534
489
  describe "#safe_architecture" do
@@ -117,9 +117,9 @@ module Omnibus
117
117
  before do
118
118
  allow(subject).to receive(:shellout!)
119
119
  File.open("#{staging_dir}/files", "w+") do |f|
120
- f.write <<-EOF
121
- /foo/bar/baz
122
- /a file with spaces
120
+ f.write <<~EOF
121
+ /foo/bar/baz
122
+ /a file with spaces
123
123
  EOF
124
124
  end
125
125
  end
@@ -190,63 +190,12 @@ module Omnibus
190
190
  end
191
191
  end
192
192
 
193
- context "on solaris_10" do
194
- before do
195
- stub_ohai(platform: "solaris2", version: "5.10") do |data|
196
- # For some reason, this isn't set in Fauxhai
197
- data["platform"] = "solaris2"
198
- end
199
- end
200
-
201
- it "sets the defaults" do
202
- expect(subject.with_standard_compiler_flags).to eq(
203
- "CC" => "gcc -static-libgcc",
204
- "LDFLAGS" => "-R/opt/project/embedded/lib -L/opt/project/embedded/lib -static-libgcc",
205
- "CFLAGS" => "-I/opt/project/embedded/include -O2",
206
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
207
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
208
- "LD_RUN_PATH" => "/opt/project/embedded/lib",
209
- "LD_OPTIONS" => "-R/opt/project/embedded/lib",
210
- "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
211
- "OMNIBUS_INSTALL_DIR" => "/opt/project"
212
- )
213
- end
214
-
215
- context "when loader mapping file is specified" do
216
- # Let the unit tests run on windows where auto-path translation occurs.
217
- let(:project_root) { File.join(tmp_path, "/root/project") }
218
- before do
219
- stub_ohai(platform: "solaris2", version: "5.10") do |data|
220
- # For some reason, this isn't set in Fauxhai
221
- data["platform"] = "solaris2"
222
- end
223
- Config.project_root(project_root)
224
- Config.solaris_linker_mapfile("files/mapfile/solaris")
225
- allow(File).to receive(:exist?).and_return(true)
226
- end
227
-
228
- it "sets LD_OPTIONS correctly" do
229
- expect(subject.with_standard_compiler_flags).to eq(
230
- "CC" => "gcc -static-libgcc",
231
- "LDFLAGS" => "-R/opt/project/embedded/lib -L/opt/project/embedded/lib -static-libgcc",
232
- "CFLAGS" => "-I/opt/project/embedded/include -O2",
233
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
234
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
235
- "LD_RUN_PATH" => "/opt/project/embedded/lib",
236
- "LD_OPTIONS" => "-R/opt/project/embedded/lib -M #{project_root}/files/mapfile/solaris",
237
- "PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
238
- "OMNIBUS_INSTALL_DIR" => "/opt/project"
239
- )
240
- end
241
- end
242
- end
243
-
244
193
  context "on mac_os_x" do
245
194
  before { stub_ohai(platform: "mac_os_x", version: "10.13") }
246
195
 
247
196
  it "sets the defaults" do
248
197
  expect(subject.with_standard_compiler_flags).to eq(
249
- "LDFLAGS" => "-L/opt/project/embedded/lib",
198
+ "LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
250
199
  "CFLAGS" => "-I/opt/project/embedded/include -O2",
251
200
  "CXXFLAGS" => "-I/opt/project/embedded/include -O2",
252
201
  "CPPFLAGS" => "-I/opt/project/embedded/include -O2",
@@ -373,7 +322,7 @@ module Omnibus
373
322
  before do
374
323
  # sles identifies as suse
375
324
  stub_ohai(platform: "suse", version: "12.2")
376
- allow(subject).to receive(:which).with("gcc-4.8").and_return(false)
325
+ allow(subject).to receive(:which).with("gcc-4.8").and_return(true)
377
326
  end
378
327
 
379
328
  it "sets the defaults" do
@@ -44,7 +44,7 @@ module Omnibus
44
44
  timeout: 7_200,
45
45
  exitstatus: 32,
46
46
  environment: {
47
- "TICKLE_ME" => "elmo",
47
+ "TICKLE_ME" => "elmo",
48
48
  "I_LOVE_YOU" => "barney",
49
49
  }
50
50
  )
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnibus
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.0.24
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: 2018-08-10 00:00:00.000000000 Z
11
+ date: 2019-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: aws-sdk
14
+ name: aws-sdk-s3
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2'
19
+ version: '1'
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: '2'
26
+ version: '1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: chef-sugar
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -70,16 +70,22 @@ dependencies:
70
70
  name: mixlib-shellout
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '2.0'
76
+ - - "<"
77
+ - !ruby/object:Gem::Version
78
+ version: '4.0'
76
79
  type: :runtime
77
80
  prerelease: false
78
81
  version_requirements: !ruby/object:Gem::Requirement
79
82
  requirements:
80
- - - "~>"
83
+ - - ">="
81
84
  - !ruby/object:Gem::Version
82
85
  version: '2.0'
86
+ - - "<"
87
+ - !ruby/object:Gem::Version
88
+ version: '4.0'
83
89
  - !ruby/object:Gem::Dependency
84
90
  name: ohai
85
91
  requirement: !ruby/object:Gem::Requirement
@@ -89,7 +95,7 @@ dependencies:
89
95
  version: '13'
90
96
  - - "<"
91
97
  - !ruby/object:Gem::Version
92
- version: '15'
98
+ version: '16'
93
99
  type: :runtime
94
100
  prerelease: false
95
101
  version_requirements: !ruby/object:Gem::Requirement
@@ -99,7 +105,7 @@ dependencies:
99
105
  version: '13'
100
106
  - - "<"
101
107
  - !ruby/object:Gem::Version
102
- version: '15'
108
+ version: '16'
103
109
  - !ruby/object:Gem::Dependency
104
110
  name: ruby-progressbar
105
111
  requirement: !ruby/object:Gem::Requirement
@@ -170,20 +176,6 @@ dependencies:
170
176
  - - ">="
171
177
  - !ruby/object:Gem::Version
172
178
  version: '0'
173
- - !ruby/object:Gem::Dependency
174
- name: bundler
175
- requirement: !ruby/object:Gem::Requirement
176
- requirements:
177
- - - ">="
178
- - !ruby/object:Gem::Version
179
- version: '0'
180
- type: :development
181
- prerelease: false
182
- version_requirements: !ruby/object:Gem::Requirement
183
- requirements:
184
- - - ">="
185
- - !ruby/object:Gem::Version
186
- version: '0'
187
179
  - !ruby/object:Gem::Dependency
188
180
  name: artifactory
189
181
  requirement: !ruby/object:Gem::Requirement
@@ -218,14 +210,14 @@ dependencies:
218
210
  requirements:
219
211
  - - '='
220
212
  - !ruby/object:Gem::Version
221
- version: '0.6'
213
+ version: '0.12'
222
214
  type: :development
223
215
  prerelease: false
224
216
  version_requirements: !ruby/object:Gem::Requirement
225
217
  requirements:
226
218
  - - '='
227
219
  - !ruby/object:Gem::Version
228
- version: '0.6'
220
+ version: '0.12'
229
221
  - !ruby/object:Gem::Dependency
230
222
  name: fauxhai
231
223
  requirement: !ruby/object:Gem::Requirement
@@ -370,6 +362,8 @@ files:
370
362
  - lib/omnibus/fetchers/path_fetcher.rb
371
363
  - lib/omnibus/file_syncer.rb
372
364
  - lib/omnibus/generator.rb
365
+ - lib/omnibus/generator_files/.kitchen.local.yml.erb
366
+ - lib/omnibus/generator_files/.kitchen.yml.erb
373
367
  - lib/omnibus/generator_files/Berksfile.erb
374
368
  - lib/omnibus/generator_files/Gemfile.erb
375
369
  - lib/omnibus/generator_files/README.md.erb
@@ -541,7 +535,7 @@ files:
541
535
  - spec/unit/util_spec.rb
542
536
  homepage: https://github.com/chef/omnibus
543
537
  licenses:
544
- - Apache 2.0
538
+ - Apache-2.0
545
539
  metadata: {}
546
540
  post_install_message:
547
541
  rdoc_options: []
@@ -558,8 +552,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
558
552
  - !ruby/object:Gem::Version
559
553
  version: '0'
560
554
  requirements: []
561
- rubyforge_project:
562
- rubygems_version: 2.7.6
555
+ rubygems_version: 3.0.3
563
556
  signing_key:
564
557
  specification_version: 4
565
558
  summary: Omnibus is a framework for building self-installing, full-stack software