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
@@ -1,13 +1,13 @@
1
- require 'autoproj/shell_completion'
1
+ require "autoproj/shell_completion"
2
2
 
3
3
  module Autoproj
4
4
  # This class generates shell completion for code for a given Thor subclasss
5
5
  class BashCompletion < ShellCompletion
6
- MAIN_FUNCTION_TEMPLATE = 'main.bash.erb'
7
- SUBCOMMAND_FUNCTION_TEMPLATE = 'subcommand.bash.erb'
6
+ MAIN_FUNCTION_TEMPLATE = "main.bash.erb"
7
+ SUBCOMMAND_FUNCTION_TEMPLATE = "subcommand.bash.erb"
8
8
 
9
9
  def setup_file_completion(metadata)
10
- metadata[:completer] = '_filedir'
10
+ metadata[:completer] = "_filedir"
11
11
  end
12
12
 
13
13
  def setup_executable_completion(metadata)
@@ -15,7 +15,7 @@ module Autoproj
15
15
  end
16
16
 
17
17
  def setup_package_completion(metadata)
18
- metadata[:completer] = '_autoproj_installed_packages'
18
+ metadata[:completer] = "_autoproj_installed_packages"
19
19
  end
20
20
 
21
21
  def disable_completion(metadata)
@@ -23,4 +23,3 @@ module Autoproj
23
23
  end
24
24
  end
25
25
  end
26
-
@@ -8,24 +8,28 @@ module Autoproj
8
8
 
9
9
  attr_reader :validator
10
10
 
11
- TRUE_STRINGS = %w{on yes y true}
12
- FALSE_STRINGS = %w{off no n false}
11
+ TRUE_STRINGS = %w[on yes y true]
12
+ FALSE_STRINGS = %w[off no n false]
13
13
  def initialize(name, type, options, validator)
14
- @name, @type, @options = name.to_str, type.to_str, options.to_hash
14
+ @name = name.to_str
15
+ @type = type.to_str
16
+ @options = options.to_hash
15
17
  @validator = validator.to_proc if validator
16
- if !BuildOption.respond_to?("validate_#{type}")
18
+ unless BuildOption.respond_to?("validate_#{type}")
17
19
  raise ConfigError.new, "invalid option type #{type}"
18
20
  end
19
21
  end
20
22
 
21
23
  def short_doc
22
- if short_doc = options[:short_doc]
24
+ if (short_doc = options[:short_doc])
23
25
  short_doc
24
- elsif doc = options[:doc]
26
+ elsif (doc = options[:doc])
25
27
  if doc.respond_to?(:to_ary) then doc.first
26
- else doc
28
+ else
29
+ doc
27
30
  end
28
- else "#{name} (no documentation for this option)"
31
+ else
32
+ "#{name} (no documentation for this option)"
29
33
  end
30
34
  end
31
35
 
@@ -38,7 +42,7 @@ module Autoproj
38
42
  first_line
39
43
  else
40
44
  remaining = remaining.join("\n").split("\n").join("\n ")
41
- Autoproj.color(first_line, :bold) + "\n " + remaining
45
+ "#{Autoproj.color(first_line, :bold)}\n#{remaining}"
42
46
  end
43
47
  else
44
48
  doc
@@ -52,11 +56,11 @@ module Autoproj
52
56
  # default value
53
57
  def ensure_value(current_value)
54
58
  if !current_value.nil?
55
- return current_value.to_s, false
59
+ [current_value.to_s, false]
56
60
  elsif options[:default]
57
- return options[:default].to_str, true
61
+ [options[:default].to_str, true]
58
62
  else
59
- return '', true
63
+ ["", true]
60
64
  end
61
65
  end
62
66
 
@@ -67,16 +71,13 @@ module Autoproj
67
71
  # @param [String] current_value the option's current value
68
72
  # @param [String] doc a string to override the default option banner
69
73
  def ask(current_value, doc = nil)
70
- value,_ = ensure_value(current_value)
74
+ value, = ensure_value(current_value)
71
75
 
72
76
  STDOUT.print " #{doc || self.doc} [#{value}] "
73
77
  STDOUT.flush
74
78
  answer = STDIN.readline.chomp
75
- if answer == ''
76
- answer = value
77
- end
79
+ answer = value if answer == ""
78
80
  validate(answer)
79
-
80
81
  rescue InputError => e
81
82
  Autoproj.message("invalid value: #{e.message}", :red)
82
83
  retry
@@ -84,9 +85,7 @@ module Autoproj
84
85
 
85
86
  def validate(value)
86
87
  value = BuildOption.send("validate_#{type}", value, options)
87
- if validator
88
- value = validator[value]
89
- end
88
+ value = validator[value] if validator
90
89
  value
91
90
  end
92
91
 
@@ -96,19 +95,19 @@ module Autoproj
96
95
  elsif FALSE_STRINGS.include?(value.downcase)
97
96
  false
98
97
  else
99
- raise InputError, "invalid boolean value '#{value}', accepted values are '#{TRUE_STRINGS.join(", ")}' for true, and '#{FALSE_STRINGS.join(", ")} for false"
98
+ raise InputError, "invalid boolean value '#{value}', accepted values are '#{TRUE_STRINGS.join(', ')}' for true, and '#{FALSE_STRINGS.join(', ')} for false"
100
99
  end
101
100
  end
102
101
 
103
102
  def self.validate_string(value, options)
104
- if possible_values = options[:possible_values]
103
+ if (possible_values = options[:possible_values])
105
104
  if options[:lowercase]
106
105
  value = value.downcase
107
106
  elsif options[:uppercase]
108
107
  value = value.upcase
109
108
  end
110
109
 
111
- if !possible_values.include?(value)
110
+ unless possible_values.include?(value)
112
111
  raise InputError, "invalid value '#{value}', accepted values are '#{possible_values.join("', '")}' (without the quotes)"
113
112
  end
114
113
  end
@@ -116,4 +115,3 @@ module Autoproj
116
115
  end
117
116
  end
118
117
  end
119
-
@@ -1,7 +1,7 @@
1
- require 'tty/color'
2
- require 'autoproj'
3
- require 'autoproj/autobuild'
4
- require 'autoproj/cli'
1
+ require "tty/color"
2
+ require "autoproj"
3
+ require "autoproj/autobuild"
4
+ require "autoproj/cli"
5
5
 
6
6
  module Autoproj
7
7
  module CLI
@@ -30,7 +30,7 @@ module Autoproj
30
30
  def normalize_command_line_package_selection(selection)
31
31
  selection = selection.map do |name|
32
32
  if File.directory?(name)
33
- File.expand_path(name) + "/"
33
+ "#{File.expand_path(name)}/"
34
34
  else
35
35
  name
36
36
  end
@@ -39,7 +39,7 @@ module Autoproj
39
39
  config_selected = false
40
40
  selection.delete_if do |name|
41
41
  if name =~ /^#{Regexp.quote(ws.config_dir)}(?:#{File::SEPARATOR}|$)/ ||
42
- name =~ /^#{Regexp.quote(ws.remotes_dir)}(?:#{File::SEPARATOR}|$)/
42
+ name =~ /^#{Regexp.quote(ws.remotes_dir)}(?:#{File::SEPARATOR}|$)/
43
43
  config_selected = true
44
44
  elsif (ws.config_dir + File::SEPARATOR) =~ /^#{Regexp.quote(name)}/
45
45
  config_selected = true
@@ -47,7 +47,7 @@ module Autoproj
47
47
  end
48
48
  end
49
49
 
50
- return selection, config_selected
50
+ [selection, config_selected]
51
51
  end
52
52
 
53
53
  # Resolve a user-provided selection
@@ -64,7 +64,7 @@ module Autoproj
64
64
  raise CLIInvalidSelection, e.message, e.backtrace
65
65
  end
66
66
  if Autoproj.verbose
67
- Autoproj.message "selected packages: #{selection.each_package_name.to_a.sort.join(", ")}"
67
+ Autoproj.message "selected packages: #{selection.each_package_name.to_a.sort.join(', ')}"
68
68
  end
69
69
  return selection, []
70
70
  end
@@ -79,8 +79,9 @@ module Autoproj
79
79
  # Try to auto-add stuff if nonresolved
80
80
  nonresolved.delete_if do |sel|
81
81
  sel = File.expand_path(sel)
82
- next if !File.directory?(sel)
83
- while sel != '/'
82
+ next unless File.directory?(sel)
83
+
84
+ while sel != "/"
84
85
  handler, srcdir = Autoproj.package_handler_for(sel)
85
86
  if handler
86
87
  Autoproj.message " auto-adding #{srcdir} using the #{handler.gsub(/_package/, '')} package handler"
@@ -99,9 +100,9 @@ module Autoproj
99
100
  end
100
101
 
101
102
  if Autoproj.verbose
102
- Autoproj.message "selected packages: #{selected_packages.each_package_name.to_a.sort.join(", ")}"
103
+ Autoproj.message "selected packages: #{selected_packages.each_package_name.to_a.sort.join(', ')}"
103
104
  end
104
- return selected_packages, nonresolved
105
+ [selected_packages, nonresolved]
105
106
  end
106
107
 
107
108
  # Resolves the user-provided selection into the set of packages that
@@ -139,7 +140,7 @@ module Autoproj
139
140
  #
140
141
  # @see resolve_user_selection
141
142
  def resolve_selection(user_selection, checkout_only: true, only_local: false, recursive: true, non_imported_packages: :ignore, auto_exclude: false)
142
- resolved_selection, _ = resolve_user_selection(user_selection, filter: false)
143
+ resolved_selection, = resolve_user_selection(user_selection, filter: false)
143
144
 
144
145
  ops = Ops::Import.new(ws)
145
146
  source_packages, osdep_packages = ops.import_packages(
@@ -149,7 +150,8 @@ module Autoproj
149
150
  recursive: recursive,
150
151
  warn_about_ignored_packages: false,
151
152
  non_imported_packages: non_imported_packages,
152
- auto_exclude: auto_exclude)
153
+ auto_exclude: auto_exclude
154
+ )
153
155
 
154
156
  [source_packages, osdep_packages, resolved_selection]
155
157
  rescue ExcludedSelection => e
@@ -169,8 +171,8 @@ module Autoproj
169
171
  !(resolved_selection.ignored?(pkg_name) ||
170
172
  resolved_selection.excluded?(pkg_name))
171
173
  end
172
- if !not_matched.empty?
173
- raise CLIInvalidArguments, "autoproj: wrong package selection on command line, cannot find a match for #{not_matched.to_a.sort.join(", ")}"
174
+ unless not_matched.empty?
175
+ raise CLIInvalidArguments, "autoproj: wrong package selection on command line, cannot find a match for #{not_matched.to_a.sort.join(', ')}"
174
176
  end
175
177
  end
176
178
 
@@ -182,12 +184,12 @@ module Autoproj
182
184
 
183
185
  def self.validate_options(args, options)
184
186
  options, remaining = filter_options options,
185
- silent: false,
186
- verbose: false,
187
- debug: false,
188
- color: TTY::Color.color?,
189
- progress: TTY::Color.color?,
190
- parallel: nil
187
+ silent: false,
188
+ verbose: false,
189
+ debug: false,
190
+ color: TTY::Color.color?,
191
+ progress: TTY::Color.color?,
192
+ parallel: nil
191
193
 
192
194
  Autoproj.silent = options[:silent]
193
195
  Autobuild.color = options[:color]
@@ -207,13 +209,12 @@ module Autoproj
207
209
  Autobuild.debug = true
208
210
  end
209
211
 
210
-
211
- if level = options[:parallel]
212
+ if (level = options[:parallel])
212
213
  Autobuild.parallel_build_level = Integer(level)
213
214
  remaining[:parallel] = Integer(level)
214
215
  end
215
216
 
216
- return args, remaining.to_sym_keys
217
+ [args, remaining.to_sym_keys]
217
218
  end
218
219
 
219
220
  def export_env_sh(shell_helpers: ws.config.shell_helpers?)
@@ -239,4 +240,3 @@ module Autoproj
239
240
  end
240
241
  end
241
242
  end
242
-
@@ -1,7 +1,7 @@
1
- require 'autoproj'
2
- require 'autoproj/cli/base'
3
- require 'autoproj/ops/tools'
4
- require 'autoproj/ops/main_config_switcher'
1
+ require "autoproj"
2
+ require "autoproj/cli/base"
3
+ require "autoproj/ops/tools"
4
+ require "autoproj/ops/main_config_switcher"
5
5
 
6
6
  module Autoproj
7
7
  module CLI
@@ -11,26 +11,26 @@ module Autoproj
11
11
  attr_reader :root_dir
12
12
 
13
13
  def initialize(root_dir = Dir.pwd)
14
- if File.exist?(File.join(root_dir, 'autoproj', "manifest"))
14
+ if File.exist?(File.join(root_dir, "autoproj", "manifest"))
15
15
  raise CLIException, "this installation is already bootstrapped. Remove the autoproj directory if it is not the case"
16
16
  end
17
+
17
18
  @root_dir = root_dir
18
19
  end
19
20
 
20
21
  def validate_options(args, options)
21
22
  args, options = Base.validate_options(args, options)
22
- if path = options[:reuse]
23
- if path == 'reuse'
24
- path = ENV['AUTOPROJ_CURRENT_ROOT']
25
- end
23
+ if (path = options[:reuse])
24
+ path = ENV["AUTOPROJ_CURRENT_ROOT"] if path == "reuse"
26
25
 
27
26
  path = File.expand_path(path)
28
- if !File.directory?(path) || !File.directory?(File.join(path, 'autoproj'))
27
+ if !File.directory?(path) || !File.directory?(File.join(path, "autoproj"))
29
28
  raise CLIInvalidArguments, "#{path} does not look like an autoproj installation"
30
29
  end
30
+
31
31
  options[:reuse] = [path]
32
32
  end
33
- return args, options
33
+ [args, options]
34
34
  end
35
35
 
36
36
  def run(buildconf_info, interactive: nil, **options)
@@ -46,10 +46,10 @@ module Autoproj
46
46
 
47
47
  begin
48
48
  switcher.bootstrap(buildconf_info,
49
- check_root_dir_empty: check_root_dir_empty,
50
- **options)
49
+ check_root_dir_empty: check_root_dir_empty,
50
+ **options)
51
51
  if seed_config
52
- FileUtils.cp seed_config, File.join(ws.config_dir, 'config.yml')
52
+ FileUtils.cp seed_config, File.join(ws.config_dir, "config.yml")
53
53
  end
54
54
 
55
55
  STDOUT.puts <<-EOTEXT
@@ -73,7 +73,6 @@ The resulting software is installed in
73
73
  #{ws.prefix_dir}
74
74
 
75
75
  EOTEXT
76
-
77
76
  rescue RuntimeError
78
77
  STDERR.puts <<-EOTEXT
79
78
  #{Autoproj.color('autoproj bootstrap failed', :red, :bold)}
@@ -92,4 +91,3 @@ autoproj bootstrap '#{ARGV.join("'")}'
92
91
  end
93
92
  end
94
93
  end
95
-
@@ -1,5 +1,5 @@
1
- require 'autoproj/cli/update'
2
- require 'autoproj/ops/build'
1
+ require "autoproj/cli/update"
2
+ require "autoproj/ops/build"
3
3
 
4
4
  module Autoproj
5
5
  module CLI
@@ -7,7 +7,8 @@ module Autoproj
7
7
  def validate_options(selected_packages, options)
8
8
  selected_packages, options =
9
9
  super(selected_packages, options.merge(
10
- checkout_only: true, aup: options[:amake]))
10
+ checkout_only: true, aup: options[:amake]
11
+ ))
11
12
 
12
13
  options[:deps] = false if options[:no_deps_shortcut]
13
14
  if options[:deps].nil?
@@ -54,21 +55,23 @@ module Autoproj
54
55
  packages_to_rebuild =
55
56
  if options[:deps] || command_line_selection.empty?
56
57
  source_packages
57
- else command_line_selection
58
+ else
59
+ command_line_selection
58
60
  end
59
61
 
60
62
  if command_line_selection.empty?
61
63
  # If we don't have an explicit package selection, we want to
62
64
  # make sure that the user really wants this
63
- mode_name = if build_options[:rebuild] then 'rebuild'
64
- else 'force-build'
65
+ mode_name = if build_options[:rebuild] then "rebuild"
66
+ else
67
+ "force-build"
65
68
  end
66
69
  if build_options[:confirm] != false
67
70
  opt = BuildOption.new(
68
71
  "", "boolean",
69
72
  {
70
73
  doc: "this is going to trigger a #{mode_name} "\
71
- "of all packages. Is that really what you want ?"
74
+ "of all packages. Is that really what you want ?"
72
75
  }, nil
73
76
  )
74
77
  raise Interrupt unless opt.ask(false)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'autoproj/cli/inspection_tool'
4
- require 'autoproj/ops/cache'
3
+ require "autoproj/cli/inspection_tool"
4
+ require "autoproj/ops/cache"
5
5
 
6
6
  module Autoproj
7
7
  module CLI
@@ -13,17 +13,17 @@ module Autoproj
13
13
  level = 0
14
14
  artifacts = []
15
15
  artifact_include = nil
16
- artifact_name = ''.dup
16
+ artifact_name = "".dup
17
17
  until scanner.eos?
18
18
  c = scanner.getch
19
19
  if level == 0
20
- raise ArgumentError, "expected '[' but got '#{c}'" unless c == '['
20
+ raise ArgumentError, "expected '[' but got '#{c}'" unless c == "["
21
21
 
22
22
  level = 1
23
23
  include_c = scanner.getch
24
24
  if %w[+ -].include?(include_c)
25
- artifact_include = (include_c == '+')
26
- elsif include_c == ']'
25
+ artifact_include = (include_c == "+")
26
+ elsif include_c == "]"
27
27
  raise ArgumentError, "empty [] found in '#{string}'"
28
28
  else
29
29
  raise ArgumentError,
@@ -32,11 +32,11 @@ module Autoproj
32
32
  next
33
33
  end
34
34
 
35
- if c == ']'
35
+ if c == "]"
36
36
  level -= 1
37
37
  if level == 0
38
38
  artifacts << [artifact_include, artifact_name]
39
- artifact_name = ''.dup
39
+ artifact_name = "".dup
40
40
  next
41
41
  end
42
42
  end
@@ -75,9 +75,9 @@ module Autoproj
75
75
  end
76
76
 
77
77
  def run(cache_dir, *package_names,
78
- keep_going: false,
79
- packages: true, all: true, checkout_only: false,
80
- gems: false, gems_compile: [], gems_compile_force: false)
78
+ keep_going: false,
79
+ packages: true, all: true, checkout_only: false,
80
+ gems: false, gems_compile: [], gems_compile_force: false)
81
81
  initialize_and_load
82
82
  finalize_setup
83
83
 
@@ -1,5 +1,5 @@
1
- require 'autoproj/cli/inspection_tool'
2
- require 'tty/prompt'
1
+ require "autoproj/cli/inspection_tool"
2
+ require "tty/prompt"
3
3
 
4
4
  module Autoproj
5
5
  module CLI
@@ -8,16 +8,16 @@ module Autoproj
8
8
  packages, options = super
9
9
  if packages.empty? && !options[:all]
10
10
  prompt = TTY::Prompt.new
11
- if !prompt.yes?("this is going to clean all packages. Is that really what you want ?")
11
+ unless prompt.yes?("this is going to clean all packages. Is that really what you want ?")
12
12
  raise Interrupt
13
13
  end
14
14
  end
15
- return packages, options
15
+ [packages, options]
16
16
  end
17
17
 
18
18
  def run(selection, options = Hash.new)
19
19
  initialize_and_load
20
- packages, _ = normalize_command_line_package_selection(selection)
20
+ packages, = normalize_command_line_package_selection(selection)
21
21
 
22
22
  deps = if options.has_key?(:deps)
23
23
  options[:deps]
@@ -27,17 +27,17 @@ module Autoproj
27
27
 
28
28
  source_packages, * = resolve_selection(
29
29
  packages,
30
- recursive: deps)
30
+ recursive: deps
31
+ )
31
32
  if source_packages.empty?
32
- raise CLIInvalidArguments, "no packages or OS packages match #{selection.join(" ")}"
33
+ raise CLIInvalidArguments, "no packages or OS packages match #{selection.join(' ')}"
33
34
  end
34
35
 
35
36
  source_packages.each do |pkg_name|
36
- ws.manifest.find_autobuild_package(pkg_name).
37
- prepare_for_rebuild
37
+ ws.manifest.find_autobuild_package(pkg_name)
38
+ .prepare_for_rebuild
38
39
  end
39
40
  end
40
41
  end
41
42
  end
42
43
  end
43
-
@@ -1,6 +1,6 @@
1
- require 'autoproj/cli/inspection_tool'
2
- require 'autoproj/cli/versions'
3
- require 'autoproj/ops/snapshot'
1
+ require "autoproj/cli/inspection_tool"
2
+ require "autoproj/cli/versions"
3
+ require "autoproj/ops/snapshot"
4
4
 
5
5
  module Autoproj
6
6
  module CLI
@@ -9,7 +9,7 @@ module Autoproj
9
9
  if tag_name
10
10
  "autoproj created tag #{tag_name}"
11
11
  else
12
- 'autoproj created version commit'
12
+ "autoproj created version commit"
13
13
  end
14
14
  end
15
15
 
@@ -43,13 +43,12 @@ module Autoproj
43
43
  keep_going: options[:keep_going],
44
44
  deps: options[:deps])
45
45
 
46
- importer.run_git(pkg, 'add', versions_file)
46
+ importer.run_git(pkg, "add", versions_file)
47
47
  message = options[:message] || default_message(tag_name)
48
48
 
49
- importer.run_git(pkg, 'commit', '-m', message)
50
- importer.run_git(pkg, 'tag', tag_name) unless tag_name.nil?
49
+ importer.run_git(pkg, "commit", "-m", message)
50
+ importer.run_git(pkg, "tag", tag_name) unless tag_name.nil?
51
51
  end
52
52
  end
53
53
  end
54
54
  end
55
-
@@ -1,9 +1,9 @@
1
- require 'autoproj/cli/utility'
1
+ require "autoproj/cli/utility"
2
2
 
3
3
  module Autoproj
4
4
  module CLI
5
5
  class Doc < Utility
6
- def initialize(ws = Workspace.default, name: 'doc')
6
+ def initialize(ws = Workspace.default, name: "doc")
7
7
  super
8
8
  end
9
9
  end
@@ -1,4 +1,4 @@
1
- require 'autoproj/cli/inspection_tool'
1
+ require "autoproj/cli/inspection_tool"
2
2
  module Autoproj
3
3
  module CLI
4
4
  class Envsh < InspectionTool
@@ -16,4 +16,3 @@ module Autoproj
16
16
  end
17
17
  end
18
18
  end
19
-