autoproj 2.13.0 → 2.15.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/lint.yml +25 -0
  3. data/.github/workflows/test.yml +30 -0
  4. data/.rubocop.yml +79 -91
  5. data/.rubocop_todo.yml +1473 -0
  6. data/Gemfile +9 -9
  7. data/Rakefile +24 -24
  8. data/autoproj.gemspec +24 -22
  9. data/bin/alocate +4 -4
  10. data/bin/alog +5 -7
  11. data/bin/amake +4 -4
  12. data/bin/aup +4 -4
  13. data/bin/autoproj +3 -3
  14. data/bin/autoproj_bootstrap +224 -199
  15. data/bin/autoproj_bootstrap.in +7 -8
  16. data/bin/autoproj_install +223 -198
  17. data/bin/autoproj_install.in +6 -7
  18. data/lib/autoproj/aruba_minitest.rb +6 -11
  19. data/lib/autoproj/autobuild.rb +9 -6
  20. data/lib/autoproj/autobuild_extensions/archive_importer.rb +10 -11
  21. data/lib/autoproj/autobuild_extensions/dsl.rb +64 -34
  22. data/lib/autoproj/autobuild_extensions/git.rb +27 -26
  23. data/lib/autoproj/autobuild_extensions/package.rb +23 -22
  24. data/lib/autoproj/autobuild_extensions/python.rb +18 -0
  25. data/lib/autoproj/autobuild_extensions/svn.rb +1 -2
  26. data/lib/autoproj/base.rb +1 -1
  27. data/lib/autoproj/bash_completion.rb +5 -6
  28. data/lib/autoproj/build_option.rb +22 -24
  29. data/lib/autoproj/cli/base.rb +26 -26
  30. data/lib/autoproj/cli/bootstrap.rb +14 -16
  31. data/lib/autoproj/cli/build.rb +10 -7
  32. data/lib/autoproj/cli/cache.rb +11 -11
  33. data/lib/autoproj/cli/clean.rb +10 -10
  34. data/lib/autoproj/cli/commit.rb +7 -8
  35. data/lib/autoproj/cli/doc.rb +2 -2
  36. data/lib/autoproj/cli/envsh.rb +1 -2
  37. data/lib/autoproj/cli/exec.rb +60 -20
  38. data/lib/autoproj/cli/inspection_tool.rb +13 -7
  39. data/lib/autoproj/cli/locate.rb +30 -41
  40. data/lib/autoproj/cli/log.rb +7 -7
  41. data/lib/autoproj/cli/main.rb +213 -204
  42. data/lib/autoproj/cli/main_doc.rb +22 -21
  43. data/lib/autoproj/cli/main_global.rb +44 -19
  44. data/lib/autoproj/cli/main_plugin.rb +18 -18
  45. data/lib/autoproj/cli/main_test.rb +28 -27
  46. data/lib/autoproj/cli/manifest.rb +7 -7
  47. data/lib/autoproj/cli/osdeps.rb +12 -11
  48. data/lib/autoproj/cli/patcher.rb +2 -3
  49. data/lib/autoproj/cli/query.rb +17 -18
  50. data/lib/autoproj/cli/reconfigure.rb +1 -2
  51. data/lib/autoproj/cli/reset.rb +9 -12
  52. data/lib/autoproj/cli/show.rb +38 -39
  53. data/lib/autoproj/cli/status.rb +45 -39
  54. data/lib/autoproj/cli/switch_config.rb +5 -6
  55. data/lib/autoproj/cli/tag.rb +12 -11
  56. data/lib/autoproj/cli/test.rb +7 -7
  57. data/lib/autoproj/cli/update.rb +35 -37
  58. data/lib/autoproj/cli/utility.rb +11 -10
  59. data/lib/autoproj/cli/version.rb +42 -40
  60. data/lib/autoproj/cli/versions.rb +14 -15
  61. data/lib/autoproj/cli/watch.rb +33 -37
  62. data/lib/autoproj/cli/which.rb +16 -20
  63. data/lib/autoproj/cli.rb +4 -2
  64. data/lib/autoproj/configuration.rb +77 -85
  65. data/lib/autoproj/default.osdeps +18 -3
  66. data/lib/autoproj/environment.rb +42 -23
  67. data/lib/autoproj/exceptions.rb +9 -3
  68. data/lib/autoproj/find_workspace.rb +20 -25
  69. data/lib/autoproj/git_server_configuration.rb +40 -44
  70. data/lib/autoproj/gitorious.rb +1 -1
  71. data/lib/autoproj/installation_manifest.rb +64 -29
  72. data/lib/autoproj/local_package_set.rb +13 -11
  73. data/lib/autoproj/manifest.rb +137 -130
  74. data/lib/autoproj/metapackage.rb +2 -6
  75. data/lib/autoproj/ops/atomic_write.rb +7 -6
  76. data/lib/autoproj/ops/build.rb +4 -6
  77. data/lib/autoproj/ops/cache.rb +41 -43
  78. data/lib/autoproj/ops/cached_env.rb +5 -4
  79. data/lib/autoproj/ops/configuration.rb +525 -507
  80. data/lib/autoproj/ops/import.rb +76 -64
  81. data/lib/autoproj/ops/install.rb +217 -191
  82. data/lib/autoproj/ops/loader.rb +77 -76
  83. data/lib/autoproj/ops/main_config_switcher.rb +36 -45
  84. data/lib/autoproj/ops/phase_reporting.rb +4 -4
  85. data/lib/autoproj/ops/snapshot.rb +250 -247
  86. data/lib/autoproj/ops/tools.rb +76 -78
  87. data/lib/autoproj/ops/watch.rb +6 -6
  88. data/lib/autoproj/ops/which.rb +17 -14
  89. data/lib/autoproj/options.rb +13 -2
  90. data/lib/autoproj/os_package_installer.rb +102 -92
  91. data/lib/autoproj/os_package_query.rb +7 -13
  92. data/lib/autoproj/os_package_resolver.rb +189 -140
  93. data/lib/autoproj/os_repository_installer.rb +4 -4
  94. data/lib/autoproj/os_repository_resolver.rb +8 -6
  95. data/lib/autoproj/package_definition.rb +12 -13
  96. data/lib/autoproj/package_managers/apt_dpkg_manager.rb +19 -11
  97. data/lib/autoproj/package_managers/bundler_manager.rb +186 -129
  98. data/lib/autoproj/package_managers/debian_version.rb +25 -21
  99. data/lib/autoproj/package_managers/emerge_manager.rb +2 -3
  100. data/lib/autoproj/package_managers/gem_manager.rb +68 -77
  101. data/lib/autoproj/package_managers/homebrew_manager.rb +3 -4
  102. data/lib/autoproj/package_managers/manager.rb +8 -3
  103. data/lib/autoproj/package_managers/pacman_manager.rb +2 -3
  104. data/lib/autoproj/package_managers/pip_manager.rb +30 -28
  105. data/lib/autoproj/package_managers/pkg_manager.rb +3 -4
  106. data/lib/autoproj/package_managers/port_manager.rb +2 -3
  107. data/lib/autoproj/package_managers/shell_script_manager.rb +47 -25
  108. data/lib/autoproj/package_managers/unknown_os_manager.rb +5 -8
  109. data/lib/autoproj/package_managers/yum_manager.rb +12 -15
  110. data/lib/autoproj/package_managers/zypper_manager.rb +11 -14
  111. data/lib/autoproj/package_manifest.rb +28 -74
  112. data/lib/autoproj/package_selection.rb +187 -187
  113. data/lib/autoproj/package_set.rb +144 -113
  114. data/lib/autoproj/python.rb +297 -0
  115. data/lib/autoproj/query_base.rb +20 -14
  116. data/lib/autoproj/reporter.rb +19 -19
  117. data/lib/autoproj/repository_managers/apt.rb +102 -68
  118. data/lib/autoproj/repository_managers/unknown_os_manager.rb +3 -3
  119. data/lib/autoproj/ros_condition_parser.rb +84 -0
  120. data/lib/autoproj/ros_package_manifest.rb +125 -0
  121. data/lib/autoproj/shell_completion.rb +16 -13
  122. data/lib/autoproj/source_package_query.rb +29 -36
  123. data/lib/autoproj/system.rb +32 -21
  124. data/lib/autoproj/test.rb +127 -104
  125. data/lib/autoproj/variable_expansion.rb +7 -9
  126. data/lib/autoproj/vcs_definition.rb +35 -32
  127. data/lib/autoproj/version.rb +1 -1
  128. data/lib/autoproj/workspace.rb +142 -108
  129. data/lib/autoproj/zsh_completion.rb +8 -9
  130. data/lib/autoproj.rb +55 -55
  131. data/samples/autoproj/init.rb +1 -2
  132. metadata +80 -46
  133. data/.travis.yml +0 -24
data/Gemfile CHANGED
@@ -1,14 +1,14 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
- gem 'autobuild', git: 'https://github.com/rock-core/autobuild', branch: 'master'
3
+ gem "autobuild", git: "https://github.com/rock-core/autobuild", branch: "master"
4
4
 
5
5
  group :vscode do
6
- gem 'pry'
7
- gem 'pry-byebug'
8
- gem 'rubocop', '>= 0.6.0'
9
- gem 'rubocop-rock'
10
- gem 'ruby-debug-ide', '>= 0.6.0'
11
- gem 'debase', '>= 0.2.2.beta10'
12
- gem 'solargraph'
6
+ gem "debase", ">= 0.2.2.beta10"
7
+ gem "pry"
8
+ gem "pry-byebug"
9
+ gem "rubocop", ">= 0.6.0"
10
+ gem "rubocop-rock"
11
+ gem "ruby-debug-ide", ">= 0.6.0"
12
+ gem "solargraph"
13
13
  end
14
14
  gemspec
data/Rakefile CHANGED
@@ -1,45 +1,45 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
3
 
4
- task 'default'
5
- task 'gem' => 'build'
4
+ task "default"
5
+ task "gem" => "build"
6
6
 
7
7
  Rake::TestTask.new(:test) do |t|
8
8
  t.libs << "lib" << Dir.pwd
9
- t.test_files = FileList['test/**/test_*.rb']
9
+ t.test_files = FileList["test/**/test_*.rb"]
10
10
  end
11
11
 
12
12
  desc "generate the bootstrap script"
13
- task 'bootstrap' do
14
- require 'yaml'
15
- autoproj_ops_install = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'ops', 'install.rb'))
13
+ task "bootstrap" do
14
+ require "yaml"
15
+ autoproj_ops_install = File.read(File.join(Dir.pwd, "lib", "autoproj", "ops", "install.rb"))
16
16
  # Since we are using gsub to replace the content in the bootstrap file,
17
17
  # we have to quote all \
18
- autoproj_ops_install.gsub! /\\/, '\\\\\\\\'
18
+ autoproj_ops_install.gsub!(/\\/, "\\\\\\\\")
19
19
 
20
- %w{bootstrap install}.each do |install_script|
21
- bootstrap_code = File.read(File.join(Dir.pwd, 'bin', "autoproj_#{install_script}.in")).
22
- gsub("require 'autoproj/ops/install'", autoproj_ops_install)
23
- File.open(File.join(Dir.pwd, 'bin', "autoproj_#{install_script}"), 'w') do |io|
20
+ %w[bootstrap install].each do |install_script|
21
+ bootstrap_code = File.read(File.join(Dir.pwd, "bin", "autoproj_#{install_script}.in"))
22
+ .gsub("require 'autoproj/ops/install'", autoproj_ops_install)
23
+ File.open(File.join(Dir.pwd, "bin", "autoproj_#{install_script}"), "w") do |io|
24
24
  io.write bootstrap_code
25
25
  end
26
26
  end
27
27
  end
28
28
 
29
- require 'autoproj/bash_completion'
30
- require 'autoproj/zsh_completion'
29
+ require "autoproj/bash_completion"
30
+ require "autoproj/zsh_completion"
31
31
 
32
- shells = [['bash', Autoproj::BashCompletion], ['zsh', Autoproj::ZshCompletion]]
32
+ shells = [["bash", Autoproj::BashCompletion], ["zsh", Autoproj::ZshCompletion]]
33
33
  clis = [%w[alocate locate], %w[alog log], %w[amake build], %w[aup update],
34
- ['autoproj', nil]]
34
+ ["autoproj", nil]]
35
35
 
36
- shell_dir = File.join(Dir.pwd, 'shell')
37
- completion_dir = File.join(shell_dir, 'completion')
36
+ shell_dir = File.join(Dir.pwd, "shell")
37
+ completion_dir = File.join(shell_dir, "completion")
38
38
 
39
- desc 'generate the shell helpers scripts'
40
- task 'helpers' do
41
- require 'erb'
42
- templates_dir = File.join(Dir.pwd, 'lib', 'autoproj', 'templates')
39
+ desc "generate the shell helpers scripts"
40
+ task "helpers" do
41
+ require "erb"
42
+ templates_dir = File.join(Dir.pwd, "lib", "autoproj", "templates")
43
43
  FileUtils.mkdir_p(completion_dir)
44
44
 
45
45
  shells.each do |shell|
@@ -47,13 +47,13 @@ task 'helpers' do
47
47
  completion = shell[1].new(cli[0], command: cli[1])
48
48
  completion_file = File.join(completion_dir, "#{cli[0]}_#{shell[0]}")
49
49
 
50
- IO.write(completion_file, completion.generate)
50
+ File.write(completion_file, completion.generate)
51
51
  end
52
52
  erb = File.read(File.join(templates_dir, "helpers.#{shell[0]}.erb"))
53
53
  helper_file = File.join(shell_dir, "autoproj_#{shell[0]}")
54
54
 
55
- IO.write(helper_file, ::ERB.new(erb, nil, '-').result(binding))
55
+ File.write(helper_file, ::ERB.new(erb, nil, "-").result(binding))
56
56
  end
57
57
  end
58
58
 
59
- file 'bin/autoproj_bootstrap' => 'bootstrap'
59
+ file "bin/autoproj_bootstrap" => "bootstrap"
data/autoproj.gemspec CHANGED
@@ -1,15 +1,16 @@
1
1
  # coding: utf-8
2
- require 'rbconfig'
3
2
 
4
- lib = File.expand_path('../lib', __FILE__)
3
+ require "rbconfig"
4
+
5
+ lib = File.expand_path("../lib", __FILE__)
5
6
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
- require 'autoproj/version'
7
+ require "autoproj/version"
7
8
 
8
9
  Gem::Specification.new do |s|
9
10
  s.name = "autoproj"
10
11
  # The envvar is here for the benefit of tests that require to create gems
11
12
  # with a "fake" version
12
- s.version = ENV['__AUTOPROJ_TEST_FAKE_VERSION'] || Autoproj::VERSION
13
+ s.version = ENV["__AUTOPROJ_TEST_FAKE_VERSION"] || Autoproj::VERSION
13
14
  s.authors = ["Sylvain Joyeux"]
14
15
  s.email = "sylvain.joyeux@m4x.org"
15
16
  s.summary = "Easy installation and management of sets of software packages"
@@ -17,29 +18,30 @@ Gem::Specification.new do |s|
17
18
  s.homepage = "http://rock-robotics.org"
18
19
  s.licenses = ["BSD"]
19
20
 
20
- s.required_ruby_version = '>= 2.1.0'
21
- s.bindir = 'bin'
22
- s.executables = ['autoproj', 'aup', 'amake', 'alocate', 'alog']
21
+ s.required_ruby_version = ">= 2.5.0"
22
+ s.bindir = "bin"
23
+ s.executables = %w[autoproj aup amake alocate alog]
23
24
  s.require_paths = ["lib"]
24
25
  s.extensions = []
25
- s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
27
 
27
- s.add_runtime_dependency "bundler"
28
28
  s.add_runtime_dependency "autobuild", ">= 1.21.0"
29
- s.add_runtime_dependency "backports", '~> 3.0'
30
- s.add_runtime_dependency "utilrb", '~> 3.0.0', ">= 3.0.0"
31
- s.add_runtime_dependency "thor", '~> 1.0'
32
- s.add_runtime_dependency 'concurrent-ruby', '~> 1.1'
33
- s.add_runtime_dependency 'tty-color', '~> 0.5.0'
34
- s.add_runtime_dependency 'tty-prompt', '~> 0.21.0'
35
- s.add_runtime_dependency 'tty-spinner', '~> 0.9.0'
36
- s.add_runtime_dependency 'rb-inotify' if RbConfig::CONFIG['target_os'] =~ /linux/
37
- s.add_runtime_dependency 'xdg', '= 2.2.5'
38
- s.add_development_dependency "flexmock", '~> 2.0', ">= 2.0.0"
29
+ s.add_runtime_dependency "backports", "~> 3.0"
30
+ s.add_runtime_dependency "bundler"
31
+ s.add_runtime_dependency "concurrent-ruby", "~> 1.1"
32
+ s.add_runtime_dependency "parslet"
33
+ s.add_runtime_dependency "rb-inotify" if RbConfig::CONFIG["target_os"] =~ /linux/
34
+ s.add_runtime_dependency "rgl", "~> 0.5.7"
35
+ s.add_runtime_dependency "thor", "~> 1.0"
36
+ s.add_runtime_dependency "tty-color", "~> 0.5.0"
37
+ s.add_runtime_dependency "tty-prompt", "~> 0.21.0"
38
+ s.add_runtime_dependency "tty-spinner", "~> 0.9.0"
39
+ s.add_runtime_dependency "utilrb", "~> 3.0.0", ">= 3.0.0"
40
+ s.add_runtime_dependency "xdg", "= 2.2.5"
41
+ s.add_development_dependency "aruba"
42
+ s.add_development_dependency "flexmock", "~> 2.0", ">= 2.0.0"
39
43
  s.add_development_dependency "minitest", "~> 5.0", ">= 5.0"
40
44
  s.add_development_dependency "simplecov"
41
- s.add_development_dependency "aruba"
42
- s.add_development_dependency "tty-cursor"
43
45
  s.add_development_dependency "timecop"
46
+ s.add_development_dependency "tty-cursor"
44
47
  end
45
-
data/bin/alocate CHANGED
@@ -1,6 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
- require 'autoproj/cli/main'
3
+ require "autoproj/cli/main"
4
4
  argv = Autoproj::CLI.basic_setup
5
5
 
6
6
  class Alocate < Autoproj::CLI::Main
@@ -10,10 +10,10 @@ class Alocate < Autoproj::CLI::Main
10
10
  end
11
11
 
12
12
  begin
13
- if argv.include?('--help') || argv.include?('help')
14
- Alocate.start(['help', 'locate'])
13
+ if argv.include?("--help") || argv.include?("help")
14
+ Alocate.start(%w[help locate])
15
15
  else
16
- Alocate.start(['locate', *argv])
16
+ Alocate.start(["locate", *argv])
17
17
  end
18
18
  rescue Interrupt
19
19
  # Already notified in the reporting infrastructure
data/bin/alog CHANGED
@@ -1,10 +1,10 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
- require 'autoproj/cli/main'
4
- require 'autoproj/cli/locate'
3
+ require "autoproj/cli/main"
4
+ require "autoproj/cli/locate"
5
5
 
6
6
  argv = Autoproj::CLI.basic_setup
7
- if argv.include?('--help') || argv.include?('help')
7
+ if argv.include?("--help") || argv.include?("help")
8
8
  puts "Usage:"
9
9
  puts " alog [package]"
10
10
  puts
@@ -16,9 +16,7 @@ Autoproj.report(silent: true) do
16
16
  cli = Autoproj::CLI::Locate.new
17
17
 
18
18
  arg = argv.first || Dir.pwd
19
- if File.directory?(arg)
20
- arg = "#{File.expand_path(arg)}/"
21
- end
19
+ arg = "#{File.expand_path(arg)}/" if File.directory?(arg)
22
20
  log_files = cli.logs_of(arg, log: nil)
23
21
 
24
22
  if log_files.size == 1
@@ -31,6 +29,6 @@ Autoproj.report(silent: true) do
31
29
  rescue Interrupt
32
30
  end
33
31
  elsif log_files.empty?
34
- raise "no logs found for #{string}"
32
+ raise "no logs found for #{arg}"
35
33
  end
36
34
  end
data/bin/amake CHANGED
@@ -1,6 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
- require 'autoproj/cli/main'
3
+ require "autoproj/cli/main"
4
4
 
5
5
  argv = Autoproj::CLI.basic_setup
6
6
  class Amake < Autoproj::CLI::Main
@@ -10,10 +10,10 @@ class Amake < Autoproj::CLI::Main
10
10
  end
11
11
 
12
12
  begin
13
- if argv.include?('--help') || argv.include?('help')
14
- Amake.start(['help', 'build'])
13
+ if argv.include?("--help") || argv.include?("help")
14
+ Amake.start(%w[help build])
15
15
  else
16
- Amake.start(['build', '--amake', *argv])
16
+ Amake.start(["build", "--amake", *argv])
17
17
  end
18
18
  rescue Interrupt
19
19
  # Already notified in the reporting infrastructure
data/bin/aup CHANGED
@@ -1,6 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
- require 'autoproj/cli/main'
3
+ require "autoproj/cli/main"
4
4
 
5
5
  argv = Autoproj::CLI.basic_setup
6
6
 
@@ -11,10 +11,10 @@ class Aup < Autoproj::CLI::Main
11
11
  end
12
12
 
13
13
  begin
14
- if argv.include?('--help') || argv.include?('help')
15
- Aup.start(['help', 'update'])
14
+ if argv.include?("--help") || argv.include?("help")
15
+ Aup.start(%w[help update])
16
16
  else
17
- Aup.start(['update', *argv, '--aup'])
17
+ Aup.start(["update", *argv, "--aup"])
18
18
  end
19
19
  rescue Interrupt
20
20
  # Already notified in the reporting infrastructure
data/bin/autoproj CHANGED
@@ -1,11 +1,11 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
- require 'autoproj/cli'
4
- require 'autoproj/cli/main'
3
+ require "autoproj/cli"
4
+ require "autoproj/cli/main"
5
5
  argv = Autoproj::CLI.basic_setup
6
6
 
7
7
  begin
8
8
  Autoproj::CLI::Main.start(argv)
9
- rescue Interrupt # rubocop:disable Lint/HandleExceptions
9
+ rescue Interrupt
10
10
  # Already notified in the reporting infrastructure
11
11
  end