autoproj 2.0.0.rc26 → 2.0.0.rc27

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
  SHA1:
3
- metadata.gz: 491dfe3641e05b794fe4ebca4b1bd3a48032cdfe
4
- data.tar.gz: 726cec0a9378e474a9699b1269035ba0b6fcfb0a
3
+ metadata.gz: e43ece02cf158c387946061509fabaac433aaf36
4
+ data.tar.gz: 81dae227e65b0f8584bfb96f4ab7c0978b5979c3
5
5
  SHA512:
6
- metadata.gz: b963b9f5dd9d599d692f8b47d58ee3f1c30d79a12078d3d409b88ae895cbe0b285549055bd154fceffc8488b4c24259f2c8f87e63543a9a1fe943941e5b58e36
7
- data.tar.gz: 3b9ac577b4cfc306b5177573322f7bf823ccb00e4ce7a7eb9e26841feaa5b4706570badb43dce56163152ebb3ae5779d6a7527ad720fdb979f7a2f153b172dad
6
+ metadata.gz: 281464e3457065d796ffd7a6834ac47e107d12b2222cf08ea9c73486fd628699986dd7a577ca83da715b258d26e2648981347ed6282281d6b02f2bba268e47dc
7
+ data.tar.gz: 9ffa7fce1ebc1e0f38487efa4dad6c067f8b078aa1a69be0aee63a254f76db796e750def42fad371ba877b95b5ae72effa6f4ac5c2a0a3af4ca831043ad49cdf
data/.travis.yml CHANGED
@@ -1,9 +1,14 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.0.0
5
- - 2.1.6
6
- - 2.2.2
4
+ - '2.0'
5
+ - '2.1'
6
+ - '2.2'
7
+ - '2.3.1'
8
+ - 'jruby-9.1.2.0'
9
+ matrix:
10
+ allow_failures:
11
+ - rvm: 'jruby-9.1.2.0'
7
12
  script:
8
13
  - bundler exec rake
9
14
  - bundler exec rake test
@@ -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.exists?(pcfile)
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.exists?(path)
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.exists?(File.join(root_dir, 'autoproj', "manifest"))
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
@@ -17,6 +17,7 @@ def initialize_and_load(options = Hash.new)
17
17
  end
18
18
  end
19
19
  ws.load_package_sets(mainline: mainline)
20
+ ws.config.save
20
21
  ws.setup_all_package_directories
21
22
  end
22
23
  end
@@ -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.exists?(target_dir)
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
@@ -77,6 +77,7 @@ def run(selected_packages, options)
77
77
  reset: options[:reset],
78
78
  ignore_errors: options[:keep_going],
79
79
  retry_count: options[:retry_count])
80
+ ws.config.save
80
81
  if !update_packages
81
82
  return [], [], true
82
83
  end
@@ -157,7 +157,7 @@ def load(options = Hash.new)
157
157
 
158
158
  def reconfigure!
159
159
  new_config = Hash.new
160
- config.each do |key, (value, user_validated)|
160
+ config.each do |key, (value, _user_validated)|
161
161
  new_config[key] = [value, false]
162
162
  end
163
163
  @config = new_config
@@ -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
  #
@@ -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.exists?(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
- source_packages = osdeps_overrides[:packages].inject([]) do |result, src_pkg_name|
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 layout = data['layout']
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.exists?(raw_local_dir)
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 not_processed_yet = pkg_set.imports.find { |imported_set| !topological.include?(imported_set) }
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
@@ -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, time, result, reason = completion_queue.pop
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 |pkg|
233
- ws.manifest.excluded?(pkg.name) || ws.manifest.ignored?(pkg.name)
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 |pkg_name|
271
- if !manifest.ignored?(pkg_name) && !manifest.excluded?(pkg_name)
272
- pkg.depends_on pkg_name
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 |pkg_name|
276
- if !manifest.ignored?(pkg_name) && !manifest.excluded?(pkg_name)
277
- pkg.os_packages << pkg_name
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.exists?(versions_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
@@ -60,10 +60,6 @@ def self.save_config
60
60
  config.save
61
61
  end
62
62
 
63
- def self.config
64
- workspace.config
65
- end
66
-
67
63
  def self.load_config
68
64
  workspace.load_config
69
65
  end
@@ -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
- [package_managers[handler_name], list]
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
- [package_managers[handler_name], list]
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.exists?('/etc/debian_version')
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.exists?('/etc/redhat-release')
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.exists?('/etc/gentoo-release')
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.exists?('/etc/arch-release')
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.exists?('/etc/SuSE-release')
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.exists?(file) && !names.include?(name)
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.exists?('/etc/debian_version')
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.exists?(filename)
407
+ return if !File.exist?(filename)
407
408
 
408
409
  fields = Hash.new
409
410
  File.readlines(filename).each do |line|
@@ -33,6 +33,7 @@ def initialize(autobuild, package_set, file)
33
33
  autobuild, package_set, file
34
34
  @user_blocks = []
35
35
  @modes = ['import', 'build']
36
+ @setup = false
36
37
  end
37
38
 
38
39
  # The modes in which this package will be used
@@ -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.exists?(gemfile)
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
- osdeps_gemfile_lines = gems.sort.map do |name|
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 => e
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)
@@ -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.exists?(File.join(raw_local_dir, "overrides.rb")) &&
131
- !File.exists?(File.join(raw_local_dir, "init.rb"))
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.exists?(master_source_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
@@ -45,7 +45,7 @@ module SelfTest
45
45
  def setup
46
46
  @tmpdir = Array.new
47
47
  @ws = Workspace.new('/test/dir')
48
- ws.config = Configuration.new
48
+ ws.load_config
49
49
  Autoproj.workspace = ws
50
50
 
51
51
  super
@@ -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 /(.|^)\$(\w+)/ do |constant_name|
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])
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "2.0.0.rc26"
2
+ VERSION = "2.0.0.rc27"
3
3
  end
@@ -195,7 +195,7 @@ def load_config(reconfigure = false)
195
195
  end
196
196
 
197
197
  def load_manifest
198
- if File.exists?(manifest_file_path)
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, srcdir = Autoproj.package_handler_for(full_path)
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
- # We finished loading the configuration files. Not all configuration
481
- # is done (since we need to process the package setup blocks), but
482
- # save the current state of the configuration anyway.
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 availability = os_package_resolver.availability_of(osdep_name)
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.rc26
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-06-10 00:00:00.000000000 Z
11
+ date: 2016-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: autobuild