autoproj 2.0.0.rc26 → 2.0.0.rc27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -3
- data/lib/autoproj/autobuild.rb +2 -2
- data/lib/autoproj/cli/bootstrap.rb +1 -1
- data/lib/autoproj/cli/inspection_tool.rb +1 -0
- data/lib/autoproj/cli/snapshot.rb +1 -1
- data/lib/autoproj/cli/update.rb +1 -0
- data/lib/autoproj/configuration.rb +1 -1
- data/lib/autoproj/installation_manifest.rb +3 -7
- data/lib/autoproj/manifest.rb +4 -4
- data/lib/autoproj/ops/configuration.rb +2 -2
- data/lib/autoproj/ops/import.rb +9 -9
- data/lib/autoproj/ops/snapshot.rb +1 -1
- data/lib/autoproj/options.rb +0 -4
- data/lib/autoproj/os_package_installer.rb +2 -3
- data/lib/autoproj/os_package_resolver.rb +9 -8
- data/lib/autoproj/package_definition.rb +1 -0
- data/lib/autoproj/package_managers/apt_dpkg_manager.rb +1 -0
- data/lib/autoproj/package_managers/bundler_manager.rb +4 -4
- data/lib/autoproj/package_set.rb +3 -3
- data/lib/autoproj/test.rb +1 -1
- data/lib/autoproj/variable_expansion.rb +1 -1
- data/lib/autoproj/version.rb +1 -1
- data/lib/autoproj/workspace.rb +6 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e43ece02cf158c387946061509fabaac433aaf36
|
4
|
+
data.tar.gz: 81dae227e65b0f8584bfb96f4ab7c0978b5979c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 281464e3457065d796ffd7a6834ac47e107d12b2222cf08ea9c73486fd628699986dd7a577ca83da715b258d26e2648981347ed6282281d6b02f2bba268e47dc
|
7
|
+
data.tar.gz: 9ffa7fce1ebc1e0f38487efa4dad6c067f8b078aa1a69be0aee63a254f76db796e750def42fad371ba877b95b5ae72effa6f4ac5c2a0a3af4ca831043ad49cdf
|
data/.travis.yml
CHANGED
data/lib/autoproj/autobuild.rb
CHANGED
@@ -77,7 +77,7 @@ def remove_obsolete_installed_orogen_package(name)
|
|
77
77
|
FileUtils.rm_f pcfile
|
78
78
|
end
|
79
79
|
pcfile = File.join(path, "orogen-project-#{name}.pc")
|
80
|
-
if File.
|
80
|
+
if File.exist?(pcfile)
|
81
81
|
Autoproj.message " removing obsolete file #{pcfile}", :bold
|
82
82
|
FileUtils.rm_f pcfile
|
83
83
|
end
|
@@ -89,7 +89,7 @@ def remove_obsolete_installed_orogen_package(name)
|
|
89
89
|
def remove_obsolete_installed_file(*path)
|
90
90
|
post_install do
|
91
91
|
path = File.join(prefix, *path)
|
92
|
-
if File.
|
92
|
+
if File.exist?(path)
|
93
93
|
Autoproj.message " removing obsolete file #{path}", :bold
|
94
94
|
FileUtils.rm_f path
|
95
95
|
end
|
@@ -11,7 +11,7 @@ class Bootstrap
|
|
11
11
|
attr_reader :root_dir
|
12
12
|
|
13
13
|
def initialize(root_dir = Dir.pwd)
|
14
|
-
if File.
|
14
|
+
if File.exist?(File.join(root_dir, 'autoproj', "manifest"))
|
15
15
|
raise ConfigError, "this installation is already bootstrapped. Remove the autoproj directory if it is not the case"
|
16
16
|
end
|
17
17
|
@root_dir = root_dir
|
@@ -29,7 +29,7 @@ def run(target_dir, options)
|
|
29
29
|
#
|
30
30
|
# This must be done first as the snapshot calls might copy stuff in
|
31
31
|
# there
|
32
|
-
if File.
|
32
|
+
if File.exist?(target_dir)
|
33
33
|
raise ArgumentError, "#{target_dir} already exists"
|
34
34
|
end
|
35
35
|
FileUtils.cp_r Autoproj.config_dir, target_dir
|
data/lib/autoproj/cli/update.rb
CHANGED
@@ -14,6 +14,9 @@ def exist?
|
|
14
14
|
File.exist?(path)
|
15
15
|
end
|
16
16
|
|
17
|
+
# Returns information about a given package
|
18
|
+
#
|
19
|
+
# @return [Package]
|
17
20
|
def [](name)
|
18
21
|
packages[name]
|
19
22
|
end
|
@@ -67,13 +70,6 @@ def each(&block)
|
|
67
70
|
packages.each_value(&block)
|
68
71
|
end
|
69
72
|
|
70
|
-
# Returns information about a given package
|
71
|
-
#
|
72
|
-
# @return [Package]
|
73
|
-
def [](name)
|
74
|
-
packages[name]
|
75
|
-
end
|
76
|
-
|
77
73
|
# Returns the default Autoproj installation manifest path for a given
|
78
74
|
# autoproj workspace root
|
79
75
|
#
|
data/lib/autoproj/manifest.rb
CHANGED
@@ -28,12 +28,12 @@ def self.load(file)
|
|
28
28
|
|
29
29
|
# Load the manifest data contained in +file+
|
30
30
|
def load(file)
|
31
|
-
if !File.
|
31
|
+
if !File.exist?(file)
|
32
32
|
raise ConfigError.new(File.dirname(file)), "expected an autoproj configuration in #{File.dirname(file)}, but #{file} does not exist"
|
33
33
|
end
|
34
34
|
|
35
35
|
data = Autoproj.in_file(file, Autoproj::YAML_LOAD_ERROR) do
|
36
|
-
YAML.load(File.read(file))
|
36
|
+
YAML.load(File.read(file)) || Hash.new
|
37
37
|
end
|
38
38
|
|
39
39
|
@file = file
|
@@ -677,7 +677,7 @@ def resolve_package_name_as_osdep(name)
|
|
677
677
|
(osdeps_availability == OSPackageResolver::IGNORE)
|
678
678
|
osdeps_overrides = self.osdeps_overrides[name]
|
679
679
|
if osdeps_overrides && (!osdeps_available || osdeps_overrides[:force])
|
680
|
-
|
680
|
+
return osdeps_overrides[:packages].inject([]) do |result, src_pkg_name|
|
681
681
|
result.concat(resolve_package_name_as_source_package(src_pkg_name))
|
682
682
|
end.uniq
|
683
683
|
elsif !osdeps_available && (pkg = find_autobuild_package(name))
|
@@ -864,7 +864,7 @@ def all_selected_packages(validate = true)
|
|
864
864
|
# Returns the set of packages that should be built if the user does not
|
865
865
|
# specify any on the command line
|
866
866
|
def default_packages(validate = true)
|
867
|
-
if
|
867
|
+
if data['layout']
|
868
868
|
return layout_packages(validate)
|
869
869
|
else
|
870
870
|
result = PackageSelection.new
|
@@ -132,7 +132,7 @@ def update_remote_package_set(vcs, options = Hash.new)
|
|
132
132
|
name = PackageSet.name_of(ws.manifest, vcs)
|
133
133
|
raw_local_dir = PackageSet.raw_local_dir_of(vcs)
|
134
134
|
|
135
|
-
return if options[:checkout_only] && File.
|
135
|
+
return if options[:checkout_only] && File.exist?(raw_local_dir)
|
136
136
|
|
137
137
|
# YUK. I am stopping there in the refactoring
|
138
138
|
# TODO: figure out a better way
|
@@ -342,7 +342,7 @@ def sort_package_sets_by_import_order(package_sets, root_pkg_set)
|
|
342
342
|
queue = Array.new
|
343
343
|
while !pending.empty?
|
344
344
|
pkg_set = pending.shift
|
345
|
-
if
|
345
|
+
if pkg_set.imports.any? { |imported_set| !topological.include?(imported_set) }
|
346
346
|
queue.push(pkg_set)
|
347
347
|
else
|
348
348
|
topological << pkg_set
|
data/lib/autoproj/ops/import.rb
CHANGED
@@ -198,7 +198,7 @@ def import_selected_packages(selection, updated_packages, options = Hash.new)
|
|
198
198
|
end
|
199
199
|
|
200
200
|
# And wait one to finish
|
201
|
-
pkg,
|
201
|
+
pkg, _time, _result, reason = completion_queue.pop
|
202
202
|
pending_packages.delete(pkg)
|
203
203
|
if reason
|
204
204
|
if reason.kind_of?(Autobuild::InteractionRequired)
|
@@ -229,8 +229,8 @@ def import_selected_packages(selection, updated_packages, options = Hash.new)
|
|
229
229
|
raise ImportFailed, "import of #{failures.size} packages failed: #{failures.keys.map(&:name).sort.join(", ")}"
|
230
230
|
end
|
231
231
|
|
232
|
-
all_processed_packages.delete_if do |
|
233
|
-
ws.manifest.excluded?(
|
232
|
+
all_processed_packages.delete_if do |processed_pkg|
|
233
|
+
ws.manifest.excluded?(processed_pkg.name) || ws.manifest.ignored?(processed_pkg.name)
|
234
234
|
end
|
235
235
|
all_processed_packages
|
236
236
|
|
@@ -267,14 +267,14 @@ def finalize_package_load(processed_packages)
|
|
267
267
|
end
|
268
268
|
|
269
269
|
packages, osdeps = pkg.partition_optional_dependencies
|
270
|
-
packages.each do |
|
271
|
-
if !manifest.ignored?(
|
272
|
-
pkg.depends_on
|
270
|
+
packages.each do |dep_pkg_name|
|
271
|
+
if !manifest.ignored?(dep_pkg_name) && !manifest.excluded?(dep_pkg_name)
|
272
|
+
pkg.depends_on dep_pkg_name
|
273
273
|
end
|
274
274
|
end
|
275
|
-
osdeps.each do |
|
276
|
-
if !manifest.ignored?(
|
277
|
-
pkg.os_packages <<
|
275
|
+
osdeps.each do |osdep_pkg_name|
|
276
|
+
if !manifest.ignored?(osdep_pkg_name) && !manifest.excluded?(osdep_pkg_name)
|
277
|
+
pkg.os_packages << osdep_pkg_name
|
278
278
|
end
|
279
279
|
end
|
280
280
|
|
@@ -48,7 +48,7 @@ def save_versions( versions, versions_file, options = Hash.new )
|
|
48
48
|
replace: false
|
49
49
|
|
50
50
|
existing_versions = Array.new
|
51
|
-
if !options[:replace] && File.
|
51
|
+
if !options[:replace] && File.exist?(versions_file)
|
52
52
|
existing_versions = YAML.load( File.read( versions_file ) ) ||
|
53
53
|
Array.new
|
54
54
|
end
|
data/lib/autoproj/options.rb
CHANGED
@@ -299,7 +299,7 @@ def pristine(packages, options = Hash.new)
|
|
299
299
|
|
300
300
|
packages = packages.map do |handler_name, list|
|
301
301
|
if manager = package_managers[handler_name]
|
302
|
-
[
|
302
|
+
[manager, list]
|
303
303
|
else
|
304
304
|
raise ArgumentError, "no package manager called #{handler_name} found"
|
305
305
|
end
|
@@ -317,14 +317,13 @@ def pristine(packages, options = Hash.new)
|
|
317
317
|
# Requests the installation of the given set of packages
|
318
318
|
def install(osdep_packages, install_only: false, **options)
|
319
319
|
osdep_packages = osdep_packages.to_set - installed_packages
|
320
|
-
return if osdep_packages.empty?
|
321
320
|
|
322
321
|
setup_package_managers(**options)
|
323
322
|
|
324
323
|
packages = os_package_resolver.resolve_os_packages(osdep_packages)
|
325
324
|
packages = packages.map do |handler_name, list|
|
326
325
|
if manager = package_managers[handler_name]
|
327
|
-
[
|
326
|
+
[manager, list]
|
328
327
|
else
|
329
328
|
raise ArgumentError, "no package manager called #{handler_name} found"
|
330
329
|
end
|
@@ -258,13 +258,13 @@ def supported_operating_system?
|
|
258
258
|
end
|
259
259
|
|
260
260
|
def self.guess_operating_system
|
261
|
-
if File.
|
261
|
+
if File.exist?('/etc/debian_version')
|
262
262
|
versions = [File.read('/etc/debian_version').strip]
|
263
263
|
if versions.first =~ /sid/
|
264
264
|
versions = ["unstable", "sid"]
|
265
265
|
end
|
266
266
|
[['debian'], versions]
|
267
|
-
elsif File.
|
267
|
+
elsif File.exist?('/etc/redhat-release')
|
268
268
|
release_string = File.read('/etc/redhat-release').strip
|
269
269
|
release_string =~ /(.*) release ([\d.]+)/
|
270
270
|
name = $1.downcase
|
@@ -273,12 +273,12 @@ def self.guess_operating_system
|
|
273
273
|
name = 'rhel'
|
274
274
|
end
|
275
275
|
[[name], [version]]
|
276
|
-
elsif File.
|
276
|
+
elsif File.exist?('/etc/gentoo-release')
|
277
277
|
release_string = File.read('/etc/gentoo-release').strip
|
278
278
|
release_string =~ /^.*([^\s]+)$/
|
279
279
|
version = $1
|
280
280
|
[['gentoo'], [version]]
|
281
|
-
elsif File.
|
281
|
+
elsif File.exist?('/etc/arch-release')
|
282
282
|
[['arch'], []]
|
283
283
|
elsif Autobuild.macos?
|
284
284
|
version=`sw_vers | head -2 | tail -1`.split(":")[1]
|
@@ -300,7 +300,7 @@ def self.guess_operating_system
|
|
300
300
|
[[*managers, 'darwin'], [version.strip]]
|
301
301
|
elsif Autobuild.windows?
|
302
302
|
[['windows'], []]
|
303
|
-
elsif File.
|
303
|
+
elsif File.exist?('/etc/SuSE-release')
|
304
304
|
version = File.read('/etc/SuSE-release').strip
|
305
305
|
version =~/.*VERSION\s+=\s+([^\s]+)/
|
306
306
|
version = $1
|
@@ -320,7 +320,7 @@ def self.ensure_derivatives_refer_to_their_parents(names)
|
|
320
320
|
'/etc/arch-release' => 'arch',
|
321
321
|
'/etc/SuSE-release' => 'opensuse']
|
322
322
|
version_files.each do |file, name|
|
323
|
-
if File.
|
323
|
+
if File.exist?(file) && !names.include?(name)
|
324
324
|
names << name
|
325
325
|
end
|
326
326
|
end
|
@@ -349,6 +349,7 @@ def operating_system=(values)
|
|
349
349
|
def self.operating_system
|
350
350
|
@operating_system
|
351
351
|
end
|
352
|
+
@operating_system = nil
|
352
353
|
|
353
354
|
def self.operating_system=(values)
|
354
355
|
@operating_system = values
|
@@ -387,7 +388,7 @@ def self.autodetect_operating_system
|
|
387
388
|
# flavour. it seems that "/etc/debian_version" does not contain
|
388
389
|
# "sid" (but "8.0" for example) during the feature freeze
|
389
390
|
# phase...
|
390
|
-
if File.
|
391
|
+
if File.exist?('/etc/debian_version')
|
391
392
|
debian_versions = [File.read('/etc/debian_version').strip]
|
392
393
|
if debian_versions.first =~ /sid/
|
393
394
|
versions = ["unstable", "sid"]
|
@@ -403,7 +404,7 @@ def self.autodetect_operating_system
|
|
403
404
|
end
|
404
405
|
|
405
406
|
def self.os_from_os_release(filename = '/etc/os-release')
|
406
|
-
return if !File.
|
407
|
+
return if !File.exist?(filename)
|
407
408
|
|
408
409
|
fields = Hash.new
|
409
410
|
File.readlines(filename).each do |line|
|
@@ -7,6 +7,7 @@ class AptDpkgManager < ShellScriptManager
|
|
7
7
|
|
8
8
|
def initialize(ws, status_file = "/var/lib/dpkg/status")
|
9
9
|
@status_file = status_file
|
10
|
+
@installed_packages = nil
|
10
11
|
super(ws, true,
|
11
12
|
"apt-get install '%s'",
|
12
13
|
"export DEBIAN_FRONTEND=noninteractive; apt-get install -y '%s'")
|
@@ -75,14 +75,13 @@ def initialize_environment
|
|
75
75
|
|
76
76
|
ws.config.each_reused_autoproj_installation do |p|
|
77
77
|
reused_w = ws.new(p)
|
78
|
-
reused_c = reused_w.load_config
|
79
78
|
env.add_path 'PATH', File.join(reused_w.prefix_dir, 'gems', 'bin')
|
80
79
|
end
|
81
80
|
|
82
81
|
prefix_gems = File.join(ws.prefix_dir, "gems")
|
83
82
|
FileUtils.mkdir_p prefix_gems
|
84
83
|
gemfile = File.join(prefix_gems, 'Gemfile')
|
85
|
-
if !File.
|
84
|
+
if !File.exist?(gemfile)
|
86
85
|
File.open(gemfile, 'w') do |io|
|
87
86
|
io.puts "eval_gemfile \"#{File.join(ws.dot_autoproj_dir, 'autoproj', 'Gemfile')}\""
|
88
87
|
end
|
@@ -211,6 +210,7 @@ def merge_gemfiles(*path, unlock: [])
|
|
211
210
|
if d.source
|
212
211
|
options = d.source.options.dup
|
213
212
|
options.delete 'root_path'
|
213
|
+
options.delete 'uri'
|
214
214
|
options = options.map { |k, v| "#{k}: \"#{v}\"" }
|
215
215
|
end
|
216
216
|
contents << [" #{platform_indent}gem \"#{d.name}\", \"#{d.requirement}\"", *options].join(", ")
|
@@ -257,7 +257,7 @@ def install(gems, filter_uptodate_packages: false, install_only: false)
|
|
257
257
|
# Save the osdeps entries in a temporary gemfile and finally
|
258
258
|
# merge the whole lot of it
|
259
259
|
gemfile_contents = Tempfile.open 'autoproj-gemfile' do |io|
|
260
|
-
|
260
|
+
gems.sort.each do |name|
|
261
261
|
name, version = parse_package_entry(name)
|
262
262
|
io.puts "gem \"#{name}\", \"#{version || ">= 0"}\""
|
263
263
|
end
|
@@ -292,7 +292,7 @@ def install(gems, filter_uptodate_packages: false, install_only: false)
|
|
292
292
|
raise NotCleanState, "bundler executed successfully, but the result was not in a clean state"
|
293
293
|
end
|
294
294
|
|
295
|
-
rescue Exception
|
295
|
+
rescue Exception
|
296
296
|
Autoproj.warn "saved the new Gemfile in #{gemfile_path}.FAILED and restored the last Gemfile version"
|
297
297
|
FileUtils.cp gemfile_path, "#{gemfile_path}.FAILED"
|
298
298
|
backup_restore(backups)
|
data/lib/autoproj/package_set.rb
CHANGED
@@ -127,8 +127,8 @@ def local?; vcs.local? end
|
|
127
127
|
def empty?
|
128
128
|
!source_definition['version_control'] && overrides.empty?
|
129
129
|
!each_package.find { true } &&
|
130
|
-
!File.
|
131
|
-
!File.
|
130
|
+
!File.exist?(File.join(raw_local_dir, "overrides.rb")) &&
|
131
|
+
!File.exist?(File.join(raw_local_dir, "init.rb"))
|
132
132
|
end
|
133
133
|
|
134
134
|
# Defined for coherence with the API on {PackageDefinition}
|
@@ -278,7 +278,7 @@ def raw_description_file
|
|
278
278
|
end
|
279
279
|
|
280
280
|
master_source_file = File.join(raw_local_dir, PackageSet.master_source_file)
|
281
|
-
if !File.
|
281
|
+
if !File.exist?(master_source_file)
|
282
282
|
raise ConfigError.new, "source #{vcs.type}:#{vcs.url} should have a source.yml file, but does not"
|
283
283
|
end
|
284
284
|
|
data/lib/autoproj/test.rb
CHANGED
@@ -61,7 +61,7 @@ def self.single_expansion(data, definitions, options = Hash.new)
|
|
61
61
|
end
|
62
62
|
definitions = { 'HOME' => ENV['HOME'] }.merge(definitions)
|
63
63
|
|
64
|
-
data = data.gsub
|
64
|
+
data = data.gsub(/(.|^)\$(\w+)/) do |constant_name|
|
65
65
|
prefix = constant_name[0, 1]
|
66
66
|
if prefix == "\\"
|
67
67
|
next(constant_name[1..-1])
|
data/lib/autoproj/version.rb
CHANGED
data/lib/autoproj/workspace.rb
CHANGED
@@ -195,7 +195,7 @@ def load_config(reconfigure = false)
|
|
195
195
|
end
|
196
196
|
|
197
197
|
def load_manifest
|
198
|
-
if File.
|
198
|
+
if File.exist?(manifest_file_path)
|
199
199
|
manifest.load(manifest_file_path)
|
200
200
|
end
|
201
201
|
end
|
@@ -423,9 +423,6 @@ def load_package_sets(options = Hash.new)
|
|
423
423
|
|
424
424
|
# Loads OS package definitions once and for all
|
425
425
|
load_osdeps_from_package_sets
|
426
|
-
# And exclude any package that is not available on this particular
|
427
|
-
# configuration
|
428
|
-
mark_unavailable_osdeps_as_excluded
|
429
426
|
|
430
427
|
# Load the required autobuild definitions
|
431
428
|
Autoproj.message("autoproj: loading ...", :bold)
|
@@ -459,7 +456,7 @@ def load_package_sets(options = Hash.new)
|
|
459
456
|
full_path = File.expand_path(File.join(root_dir, layout_level, pkg_or_set))
|
460
457
|
next if !File.directory?(full_path)
|
461
458
|
|
462
|
-
handler,
|
459
|
+
handler, _srcdir = Autoproj.package_handler_for(full_path)
|
463
460
|
if handler
|
464
461
|
Autoproj.message " auto-adding #{pkg_or_set} #{"in #{layout_level} " if layout_level != "/"}using the #{handler.gsub(/_package/, '')} package handler"
|
465
462
|
in_package_set(manifest.local_package_set, manifest.file) do
|
@@ -477,10 +474,9 @@ def load_package_sets(options = Hash.new)
|
|
477
474
|
end
|
478
475
|
end
|
479
476
|
|
480
|
-
#
|
481
|
-
#
|
482
|
-
|
483
|
-
config.save
|
477
|
+
# And exclude any package that is not available on this particular
|
478
|
+
# configuration
|
479
|
+
mark_unavailable_osdeps_as_excluded
|
484
480
|
end
|
485
481
|
|
486
482
|
def mark_unavailable_osdeps_as_excluded
|
@@ -492,7 +488,7 @@ def mark_unavailable_osdeps_as_excluded
|
|
492
488
|
next
|
493
489
|
end
|
494
490
|
|
495
|
-
case
|
491
|
+
case os_package_resolver.availability_of(osdep_name)
|
496
492
|
when OSPackageResolver::UNKNOWN_OS
|
497
493
|
manifest.add_exclusion(osdep_name, "this operating system is unknown to autoproj")
|
498
494
|
when OSPackageResolver::WRONG_OS
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autoproj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.rc27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: autobuild
|