vanagon 0.18.1 → 0.19.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 +4 -4
- data/bin/build +3 -1
- data/bin/build_host_info +3 -1
- data/bin/build_requirements +3 -1
- data/bin/inspect +3 -1
- data/bin/render +3 -1
- data/bin/repo +3 -1
- data/bin/ship +3 -1
- data/bin/sign +3 -1
- data/lib/vanagon/cli.rb +4 -2
- data/lib/vanagon/cli/build.rb +2 -1
- data/lib/vanagon/cli/build_host_info.rb +3 -2
- data/lib/vanagon/cli/build_requirements.rb +4 -4
- data/lib/vanagon/cli/completion.rb +4 -3
- data/lib/vanagon/cli/inspect.rb +3 -2
- data/lib/vanagon/cli/list.rb +5 -6
- data/lib/vanagon/cli/render.rb +2 -1
- data/lib/vanagon/cli/ship.rb +5 -4
- data/lib/vanagon/cli/sign.rb +3 -2
- data/lib/vanagon/component.rb +11 -9
- data/lib/vanagon/component/dsl.rb +6 -5
- data/lib/vanagon/component/source.rb +2 -1
- data/lib/vanagon/component/source/git.rb +7 -6
- data/lib/vanagon/component/source/http.rb +3 -2
- data/lib/vanagon/component/source/local.rb +2 -1
- data/lib/vanagon/component/source/rewrite.rb +3 -2
- data/lib/vanagon/driver.rb +20 -23
- data/lib/vanagon/engine/always_be_scheduling.rb +12 -11
- data/lib/vanagon/engine/docker.rb +2 -1
- data/lib/vanagon/engine/ec2.rb +5 -4
- data/lib/vanagon/engine/hardware.rb +4 -3
- data/lib/vanagon/engine/pooler.rb +6 -5
- data/lib/vanagon/environment.rb +3 -2
- data/lib/vanagon/logger.rb +31 -0
- data/lib/vanagon/platform.rb +6 -5
- data/lib/vanagon/platform/dsl.rb +5 -4
- data/lib/vanagon/platform/windows.rb +3 -1
- data/lib/vanagon/project.rb +20 -14
- data/lib/vanagon/project/dsl.rb +6 -5
- data/lib/vanagon/utilities.rb +5 -4
- data/resources/deb/control.erb +1 -1
- data/resources/osx/postinstall.erb +6 -2
- data/resources/rpm/project.spec.erb +1 -1
- data/resources/solaris/10/depend.erb +2 -2
- data/resources/solaris/10/postinstall.erb +11 -3
- data/resources/solaris/11/p5m.erb +2 -2
- data/spec/lib/vanagon/cli_spec.rb +1 -4
- data/spec/lib/vanagon/component/dsl_spec.rb +9 -2
- data/spec/lib/vanagon/component_spec.rb +3 -2
- data/spec/lib/vanagon/engine/always_be_scheduling_spec.rb +4 -4
- metadata +33 -32
data/lib/vanagon/environment.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'forwardable'
|
2
2
|
require 'vanagon/extensions/string'
|
3
|
+
require 'vanagon/logger'
|
3
4
|
|
4
5
|
class Vanagon
|
5
6
|
# Environment is a validating wrapper around a delegated Hash,
|
@@ -147,7 +148,7 @@ class Vanagon
|
|
147
148
|
update your project's parameters.
|
148
149
|
WARNING
|
149
150
|
|
150
|
-
|
151
|
+
VanagonLogger.info warning.join("\n")
|
151
152
|
str.gsub(pattern, '$(shell \1)')
|
152
153
|
end
|
153
154
|
private :sanitize_subshells
|
@@ -165,7 +166,7 @@ class Vanagon
|
|
165
166
|
update your project's parameters.
|
166
167
|
WARNING
|
167
168
|
|
168
|
-
|
169
|
+
VanagonLogger.info warning.join("\n")
|
169
170
|
str.gsub(pattern, '$(\1)')
|
170
171
|
end
|
171
172
|
private :sanitize_variables
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'logger'
|
2
|
+
|
3
|
+
class VanagonLogger < ::Logger
|
4
|
+
def self.logger
|
5
|
+
@@logger ||= VanagonLogger.new
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.debug_logger
|
9
|
+
@@debug_logger ||= VanagonLogger.new(STDERR)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.info(msg)
|
13
|
+
VanagonLogger.debug_logger.info msg
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.warn(msg)
|
17
|
+
VanagonLogger.logger.warn msg
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.error(msg)
|
21
|
+
VanagonLogger.logger.error msg
|
22
|
+
end
|
23
|
+
|
24
|
+
def initialize(output = STDOUT)
|
25
|
+
super(output)
|
26
|
+
self.level = ::Logger::INFO
|
27
|
+
self.formatter = proc do |severity, datetime, progname, msg|
|
28
|
+
"#{msg}\n"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/vanagon/platform.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'vanagon/environment'
|
2
2
|
require 'vanagon/platform/dsl'
|
3
3
|
require 'vanagon/utilities'
|
4
|
+
require 'vanagon/logger'
|
4
5
|
|
5
6
|
class Vanagon
|
6
7
|
class Platform
|
@@ -152,9 +153,9 @@ class Vanagon
|
|
152
153
|
dsl.instance_eval(File.read(platfile), platfile, 1)
|
153
154
|
dsl._platform
|
154
155
|
rescue StandardError => e
|
155
|
-
|
156
|
-
|
157
|
-
|
156
|
+
VanagonLogger.error "Error loading platform '#{name}' using '#{platfile}':"
|
157
|
+
VanagonLogger.error(e)
|
158
|
+
VanagonLogger.error e.backtrace.join("\n")
|
158
159
|
raise e
|
159
160
|
end
|
160
161
|
|
@@ -401,7 +402,7 @@ class Vanagon
|
|
401
402
|
# @deprecated Please use is_macos? instead
|
402
403
|
# @return [true, false] true if it is an osx variety, false otherwise
|
403
404
|
def is_osx?
|
404
|
-
|
405
|
+
VanagonLogger.info "is_osx? is a deprecated method, please use #is_macos? instead."
|
405
406
|
is_macos?
|
406
407
|
end
|
407
408
|
|
@@ -539,7 +540,7 @@ class Vanagon
|
|
539
540
|
match = version_string.match(VERSION_REGEX)
|
540
541
|
|
541
542
|
if match.nil?
|
542
|
-
|
543
|
+
VanagonLogger.info "Passing a version without an operator is deprecated!"
|
543
544
|
operator = default
|
544
545
|
version = version_string
|
545
546
|
end
|
data/lib/vanagon/platform/dsl.rb
CHANGED
@@ -8,6 +8,7 @@ require 'vanagon/platform/osx'
|
|
8
8
|
require 'vanagon/platform/solaris_10'
|
9
9
|
require 'vanagon/platform/solaris_11'
|
10
10
|
require 'vanagon/platform/windows'
|
11
|
+
require 'vanagon/logger'
|
11
12
|
require 'securerandom'
|
12
13
|
require 'uri'
|
13
14
|
|
@@ -259,7 +260,7 @@ class Vanagon
|
|
259
260
|
# @param name [String] name that the pooler uses for this platform
|
260
261
|
# @deprecated Please use vmpooler_template instead, this will be removed in a future vanagon release.
|
261
262
|
def vcloud_name(cloud_name)
|
262
|
-
|
263
|
+
VanagonLogger.info "vcloud_name is a deprecated platform DSL method, and will be removed in a future vanagon release. Please use vmpooler_template instead."
|
263
264
|
self.vmpooler_template(cloud_name)
|
264
265
|
end
|
265
266
|
|
@@ -394,7 +395,7 @@ class Vanagon
|
|
394
395
|
# @param gpg_key [String] optional gpg key to be fetched via curl and installed
|
395
396
|
# @deprecated Please use the add_build_repository DSL method instead. apt_repo will be removed in a future vanagon release.
|
396
397
|
def apt_repo(definition, gpg_key = nil)
|
397
|
-
|
398
|
+
VanagonLogger.info "Please use the add_build_repository DSL method instead. apt_repo will be removed in a future vanagon release."
|
398
399
|
self.add_build_repository(definition, gpg_key)
|
399
400
|
end
|
400
401
|
|
@@ -403,7 +404,7 @@ class Vanagon
|
|
403
404
|
# @param definition [String] the repo setup URI or RPM file
|
404
405
|
# @deprecated Please use the add_build_repository DSL method instead. yum_repo will be removed in a future vanagon release.
|
405
406
|
def yum_repo(definition)
|
406
|
-
|
407
|
+
VanagonLogger.info "Please use the add_build_repository DSL method instead. yum_repo will be removed in a future vanagon release."
|
407
408
|
self.add_build_repository(definition)
|
408
409
|
end
|
409
410
|
|
@@ -412,7 +413,7 @@ class Vanagon
|
|
412
413
|
# @param definition [String] the repo setup URI or RPM file
|
413
414
|
# @deprecated Please use the add_build_repository DSL method instead. zypper_repo will be removed in a future vanagon release.
|
414
415
|
def zypper_repo(definition)
|
415
|
-
|
416
|
+
VanagonLogger.info "Please use the add_build_repository DSL method instead. zypper_repo will be removed in a future vanagon release."
|
416
417
|
self.add_build_repository(definition)
|
417
418
|
end
|
418
419
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'vanagon/logger'
|
2
|
+
|
1
3
|
class Vanagon
|
2
4
|
class Platform
|
3
5
|
class Windows < Vanagon::Platform
|
@@ -231,7 +233,7 @@ class Vanagon
|
|
231
233
|
]
|
232
234
|
end
|
233
235
|
rescue RuntimeError
|
234
|
-
|
236
|
+
VanagonLogger.error "Unable to connect to #{project.signing_username}@#{project.signing_hostname}, skipping signing extra files: #{project.extra_files_to_sign.join(',')}"
|
235
237
|
end
|
236
238
|
end
|
237
239
|
make_commands << [
|
data/lib/vanagon/project.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'vanagon/component'
|
2
2
|
require 'vanagon/environment'
|
3
|
+
require 'vanagon/logger'
|
3
4
|
require 'vanagon/platform'
|
4
5
|
require 'vanagon/project/dsl'
|
5
6
|
require 'vanagon/utilities'
|
@@ -130,9 +131,9 @@ class Vanagon
|
|
130
131
|
dsl.instance_eval(File.read(projfile), projfile, 1)
|
131
132
|
dsl._project
|
132
133
|
rescue StandardError => e
|
133
|
-
|
134
|
-
|
135
|
-
|
134
|
+
VanagonLogger.error "Error loading project '#{name}' using '#{projfile}':"
|
135
|
+
VanagonLogger.error(e)
|
136
|
+
VanagonLogger.error e.backtrace.join("\n")
|
136
137
|
raise e
|
137
138
|
end
|
138
139
|
|
@@ -296,10 +297,14 @@ class Vanagon
|
|
296
297
|
#
|
297
298
|
# @return [Array] array of runtime requirements for the project
|
298
299
|
def get_requires
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
300
|
+
requires = []
|
301
|
+
requires << @requires.flatten
|
302
|
+
requires << components.flat_map(&:requires)
|
303
|
+
requires.flatten!
|
304
|
+
requires.each do |requirement|
|
305
|
+
requirement.version = @platform.version_munger(requirement.version, default: '<') if requirement.version
|
306
|
+
end
|
307
|
+
requires.uniq
|
303
308
|
end
|
304
309
|
|
305
310
|
# Collects all of the replacements for the project and its components
|
@@ -307,8 +312,8 @@ class Vanagon
|
|
307
312
|
# @return [Array] array of package level replacements for the project
|
308
313
|
def get_replaces
|
309
314
|
replaces = []
|
310
|
-
replaces
|
311
|
-
replaces
|
315
|
+
replaces << @replaces.flatten
|
316
|
+
replaces << components.flat_map(&:replaces)
|
312
317
|
replaces.flatten!
|
313
318
|
replaces.each do |replace|
|
314
319
|
# TODO: Make this a more reasonable default before 1.0.0
|
@@ -324,8 +329,9 @@ class Vanagon
|
|
324
329
|
|
325
330
|
# Collects all of the conflicts for the project and its components
|
326
331
|
def get_conflicts
|
327
|
-
conflicts =
|
328
|
-
|
332
|
+
conflicts = []
|
333
|
+
conflicts << @conflicts.flatten
|
334
|
+
conflicts << components.flat_map(&:conflicts)
|
329
335
|
conflicts.flatten!
|
330
336
|
conflicts.each do |conflict|
|
331
337
|
# TODO: Make this a more reasonable default before 1.0.0
|
@@ -360,8 +366,8 @@ class Vanagon
|
|
360
366
|
# @return [Array] array of package level provides for the project
|
361
367
|
def get_provides
|
362
368
|
provides = []
|
363
|
-
provides
|
364
|
-
provides
|
369
|
+
provides << @provides.flatten
|
370
|
+
provides << components.flat_map(&:provides)
|
365
371
|
provides.flatten!
|
366
372
|
provides.each do |provide|
|
367
373
|
# TODO: Make this a more reasonable default before 1.0.0
|
@@ -841,7 +847,7 @@ class Vanagon
|
|
841
847
|
end
|
842
848
|
|
843
849
|
def load_upstream_metadata(metadata_uri)
|
844
|
-
|
850
|
+
VanagonLogger.info "Loading metadata from #{metadata_uri}"
|
845
851
|
case metadata_uri
|
846
852
|
when /^http/
|
847
853
|
@upstream_metadata = JSON.parse(Net::HTTP.get(URI(metadata_uri)))
|
data/lib/vanagon/project/dsl.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'vanagon/errors'
|
2
|
+
require 'vanagon/logger'
|
2
3
|
require 'vanagon/project'
|
3
4
|
require 'vanagon/utilities'
|
4
5
|
require 'vanagon/component/source'
|
@@ -109,8 +110,8 @@ class Vanagon
|
|
109
110
|
# Sets the run time requirements for the project. Mainly for use in packaging.
|
110
111
|
#
|
111
112
|
# @param req [String] of requirements of the project
|
112
|
-
def requires(
|
113
|
-
@project.requires <<
|
113
|
+
def requires(requirement, version = nil)
|
114
|
+
@project.requires << OpenStruct.new(:requirement => requirement, :version => version)
|
114
115
|
end
|
115
116
|
|
116
117
|
# Indicates that this component replaces a system level package. Replaces can be collected and used by the project and package.
|
@@ -185,7 +186,7 @@ class Vanagon
|
|
185
186
|
last_tag = repo_object.describe('HEAD', { :abbrev => 0 })
|
186
187
|
release(repo_object.rev_list("#{last_tag}..HEAD", { :count => true }))
|
187
188
|
rescue Git::GitExecuteError
|
188
|
-
|
189
|
+
VanagonLogger.error "Directory '#{File.expand_path('..', @configdir)}' cannot be versioned by git. Maybe it hasn't been tagged yet?"
|
189
190
|
end
|
190
191
|
|
191
192
|
# Sets the version for the project based on a git describe of the
|
@@ -196,7 +197,7 @@ class Vanagon
|
|
196
197
|
git_version = Git.open(File.expand_path("..", @configdir)).describe('HEAD', tags: true)
|
197
198
|
version(git_version.split('-').reject(&:empty?).join('.'))
|
198
199
|
rescue Git::GitExecuteError
|
199
|
-
|
200
|
+
VanagonLogger.error "Directory '#{File.expand_path('..', @configdir)}' cannot be versioned by git. Maybe it hasn't been tagged yet?"
|
200
201
|
end
|
201
202
|
|
202
203
|
# Get the version string from a git branch name. This will look for a '.'
|
@@ -268,7 +269,7 @@ class Vanagon
|
|
268
269
|
#
|
269
270
|
# @param name [String] name of component to add. must be present in configdir/components and named $name.rb currently
|
270
271
|
def component(name)
|
271
|
-
|
272
|
+
VanagonLogger.info "Loading #{name}" if @project.settings[:verbose]
|
272
273
|
if @include_components.empty? or @include_components.include?(name)
|
273
274
|
component = Vanagon::Component.load_component(name, File.join(@configdir, "components"), @project.settings, @project.platform)
|
274
275
|
@project.components << component
|
data/lib/vanagon/utilities.rb
CHANGED
@@ -9,6 +9,7 @@ require 'timeout'
|
|
9
9
|
# but it provides a wealth of useful constants
|
10
10
|
require 'English'
|
11
11
|
require 'vanagon/extensions/string'
|
12
|
+
require 'vanagon/logger'
|
12
13
|
|
13
14
|
class Vanagon
|
14
15
|
module Utilities
|
@@ -165,7 +166,7 @@ class Vanagon
|
|
165
166
|
yield
|
166
167
|
return true
|
167
168
|
rescue StandardError => e
|
168
|
-
|
169
|
+
VanagonLogger.error 'An error was encountered evaluating block. Retrying..'
|
169
170
|
error = e
|
170
171
|
end
|
171
172
|
end
|
@@ -238,7 +239,7 @@ class Vanagon
|
|
238
239
|
# output of the command if return_command_output is true
|
239
240
|
# @raise [RuntimeError] If there is no target given or the command fails an exception is raised
|
240
241
|
def remote_ssh_command(target, command, port = 22, return_command_output: false)
|
241
|
-
|
242
|
+
VanagonLogger.info "Executing '#{command}' on '#{target}'"
|
242
243
|
if return_command_output
|
243
244
|
ret = %x(#{ssh_command(port)} -T #{target} '#{command.gsub("'", "'\\\\''")}').chomp
|
244
245
|
if $CHILD_STATUS.success?
|
@@ -261,7 +262,7 @@ class Vanagon
|
|
261
262
|
# @raise [RuntimeError] If the command fails an exception is raised
|
262
263
|
def local_command(command, return_command_output: false)
|
263
264
|
clean_environment do
|
264
|
-
|
265
|
+
VanagonLogger.info "Executing '#{command}' locally"
|
265
266
|
if return_command_output
|
266
267
|
ret = %x(#{command}).chomp
|
267
268
|
if $CHILD_STATUS.success?
|
@@ -305,7 +306,7 @@ class Vanagon
|
|
305
306
|
outfile ||= File.join(Dir.mktmpdir, File.basename(erbfile).sub(File.extname(erbfile), ""))
|
306
307
|
output = erb_string(erbfile, opts[:binding])
|
307
308
|
File.open(outfile, 'w') { |f| f.write output }
|
308
|
-
|
309
|
+
VanagonLogger.info "Generated: #{outfile}"
|
309
310
|
FileUtils.rm_rf erbfile if remove_orig
|
310
311
|
outfile
|
311
312
|
end
|
data/resources/deb/control.erb
CHANGED
@@ -18,7 +18,7 @@ Breaks: <%= get_replaces.map { |replace| "#{replace.replacement} #{replace.versi
|
|
18
18
|
Conflicts: <%= get_conflicts.map { |conflict| "#{conflict.pkgname} #{conflict.version ? "(#{conflict.version})" : ""}" }.join(", ") %>
|
19
19
|
<%- end -%>
|
20
20
|
<%- unless get_requires.empty? -%>
|
21
|
-
Depends: <%= get_requires.join(", ") %>
|
21
|
+
Depends: <%= get_requires.map { |req| "#{req.requirement} #{req.version ? "(#{req.version})" : ""}" }.join(", ") %>
|
22
22
|
<%- end -%>
|
23
23
|
<%- unless get_provides.empty? -%>
|
24
24
|
Provides: <%= get_provides.map { |prov| prov.provide }.join(", ") %>
|
@@ -5,8 +5,12 @@
|
|
5
5
|
<%- get_configfiles.each do |config|
|
6
6
|
dest_file = config.path.gsub(/\.pristine$/, '') -%>
|
7
7
|
|
8
|
-
if [ -f "<%= dest_file %>" ]
|
9
|
-
|
8
|
+
if [ -f "<%= dest_file %>" ]; then
|
9
|
+
if diff "<%= config.path %>" "<%= dest_file %>" > /dev/null; then
|
10
|
+
rm -f "<%= config.path %>"
|
11
|
+
else
|
12
|
+
echo "Detected file at '<%= dest_file %>'; updated file at '<%= config.path %>'."
|
13
|
+
fi
|
10
14
|
else
|
11
15
|
mv '<%= config.path %>' '<%= dest_file %>'
|
12
16
|
fi
|
@@ -77,7 +77,7 @@ Source1: file-list-for-rpm
|
|
77
77
|
Autoprov: 0
|
78
78
|
Autoreq: 0
|
79
79
|
<%- get_requires.each do |requires| -%>
|
80
|
-
Requires: <%= requires %>
|
80
|
+
Requires: <%= requires.requirement %><%= requires.version ? " #{requires.version}" : "" %>
|
81
81
|
<%- end -%>
|
82
82
|
|
83
83
|
# All rpm packages built by vanagon have the pre-/post-install script
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%- get_requires.each do |
|
2
|
-
P <%= requirement %>
|
1
|
+
<%- get_requires.each do |requires| -%>
|
2
|
+
P <%= requires.requirement %>
|
3
3
|
<%- end -%>
|
@@ -9,8 +9,12 @@
|
|
9
9
|
<%- get_configfiles.each do |config|
|
10
10
|
dest_file = config.path.gsub(/\.pristine$/, '') -%>
|
11
11
|
|
12
|
-
if [ -f "<%= dest_file %>" ]
|
13
|
-
|
12
|
+
if [ -f "<%= dest_file %>" ]; then
|
13
|
+
if diff "<%= config.path %>" "<%= dest_file %>" > /dev/null; then
|
14
|
+
rm -f "<%= config.path %>"
|
15
|
+
else
|
16
|
+
echo "Detected file at '<%= dest_file %>'; updated file at '<%= config.path %>'."
|
17
|
+
fi
|
14
18
|
else
|
15
19
|
cp -pr '<%= config.path %>' '<%= dest_file %>'
|
16
20
|
fi
|
@@ -19,7 +23,11 @@ fi
|
|
19
23
|
|
20
24
|
# Set up any specific permissions needed...
|
21
25
|
<%- (get_directories + get_configfiles + get_files).select { |pathname| pathname.has_overrides? }.uniq.each do |file_or_directory| -%>
|
22
|
-
|
26
|
+
<%- if file_or_directory.mode -%>
|
27
|
+
if [ -f "<%= file_or_directory.path %>" ] || [ -d "<%= file_or_directory.path %>" ]; then
|
28
|
+
chmod '<%= file_or_directory.mode %>' '<%= file_or_directory.path %>'
|
29
|
+
fi
|
30
|
+
<%- end -%>
|
23
31
|
<%- if file_or_directory.owner -%>
|
24
32
|
if getent passwd '<%= file_or_directory.owner %>' &> /dev/null; then
|
25
33
|
chown '<%= file_or_directory.owner %>' '<%= file_or_directory.path %>'
|
@@ -17,8 +17,8 @@ set name=variant.opensolaris.zone value=global value=nonglobal
|
|
17
17
|
%>
|
18
18
|
|
19
19
|
# Add any needed dependencies
|
20
|
-
<%- get_requires.each do |
|
21
|
-
depend fmri=pkg:/<%= requirement %> type=require
|
20
|
+
<%- get_requires.each do |requires| -%>
|
21
|
+
depend fmri=pkg:/<%= requires.requirement %> type=require
|
22
22
|
<%- end -%>
|
23
23
|
|
24
24
|
# Always drop /etc, /usr, and /var, it will cause conflicts with other system packages
|
@@ -313,11 +313,18 @@ end" }
|
|
313
313
|
comp = Vanagon::Component::DSL.new('requires-test', {}, {})
|
314
314
|
comp.requires('library1')
|
315
315
|
comp.requires('library2')
|
316
|
-
expect(comp._component.requires).to include('library1')
|
317
|
-
expect(comp._component.requires).to include('library2')
|
316
|
+
expect(comp._component.requires.first.requirement).to include('library1')
|
317
|
+
expect(comp._component.requires.last.requirement).to include('library2')
|
318
318
|
end
|
319
319
|
end
|
320
320
|
|
321
|
+
it 'supports versioned requires' do
|
322
|
+
comp = Vanagon::Component::DSL.new('requires-test', {}, {})
|
323
|
+
comp.requires('library1', '1.2.3')
|
324
|
+
expect(comp._component.requires.first.requirement).to eq('library1')
|
325
|
+
expect(comp._component.requires.first.version).to eq('1.2.3')
|
326
|
+
end
|
327
|
+
|
321
328
|
describe '#provides' do
|
322
329
|
it 'adds the package provide to the list of provides' do
|
323
330
|
comp = Vanagon::Component::DSL.new('provides-test', {}, {})
|
@@ -5,8 +5,9 @@ describe "Vanagon::Component" do
|
|
5
5
|
describe "#get_environment" do
|
6
6
|
subject { Vanagon::Component.new('env-test', {}, {}) }
|
7
7
|
|
8
|
-
it "
|
9
|
-
expect
|
8
|
+
it "logs a deprecation warning with VanagonLogger.info" do
|
9
|
+
expect(VanagonLogger).to receive(:info).with(/deprecated/)
|
10
|
+
subject.get_environment
|
10
11
|
end
|
11
12
|
|
12
13
|
it "returns a makefile compatible environment" do
|