autoproj 2.14.0 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) 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 +22 -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 +185 -182
  15. data/bin/autoproj_bootstrap.in +7 -8
  16. data/bin/autoproj_install +184 -181
  17. data/bin/autoproj_install.in +6 -7
  18. data/lib/autoproj/aruba_minitest.rb +6 -11
  19. data/lib/autoproj/autobuild.rb +5 -6
  20. data/lib/autoproj/autobuild_extensions/archive_importer.rb +10 -11
  21. data/lib/autoproj/autobuild_extensions/dsl.rb +38 -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/svn.rb +1 -2
  25. data/lib/autoproj/base.rb +1 -1
  26. data/lib/autoproj/bash_completion.rb +5 -6
  27. data/lib/autoproj/build_option.rb +22 -24
  28. data/lib/autoproj/cli/base.rb +26 -26
  29. data/lib/autoproj/cli/bootstrap.rb +14 -16
  30. data/lib/autoproj/cli/build.rb +10 -7
  31. data/lib/autoproj/cli/cache.rb +11 -11
  32. data/lib/autoproj/cli/clean.rb +10 -10
  33. data/lib/autoproj/cli/commit.rb +7 -8
  34. data/lib/autoproj/cli/doc.rb +2 -2
  35. data/lib/autoproj/cli/envsh.rb +1 -2
  36. data/lib/autoproj/cli/exec.rb +60 -20
  37. data/lib/autoproj/cli/inspection_tool.rb +13 -7
  38. data/lib/autoproj/cli/locate.rb +30 -41
  39. data/lib/autoproj/cli/log.rb +7 -7
  40. data/lib/autoproj/cli/main.rb +213 -204
  41. data/lib/autoproj/cli/main_doc.rb +22 -21
  42. data/lib/autoproj/cli/main_global.rb +44 -19
  43. data/lib/autoproj/cli/main_plugin.rb +18 -18
  44. data/lib/autoproj/cli/main_test.rb +28 -27
  45. data/lib/autoproj/cli/manifest.rb +7 -7
  46. data/lib/autoproj/cli/osdeps.rb +12 -11
  47. data/lib/autoproj/cli/patcher.rb +2 -3
  48. data/lib/autoproj/cli/query.rb +17 -18
  49. data/lib/autoproj/cli/reconfigure.rb +1 -2
  50. data/lib/autoproj/cli/reset.rb +9 -12
  51. data/lib/autoproj/cli/show.rb +38 -39
  52. data/lib/autoproj/cli/status.rb +45 -39
  53. data/lib/autoproj/cli/switch_config.rb +5 -6
  54. data/lib/autoproj/cli/tag.rb +12 -11
  55. data/lib/autoproj/cli/test.rb +7 -7
  56. data/lib/autoproj/cli/update.rb +35 -37
  57. data/lib/autoproj/cli/utility.rb +11 -10
  58. data/lib/autoproj/cli/version.rb +42 -40
  59. data/lib/autoproj/cli/versions.rb +14 -15
  60. data/lib/autoproj/cli/watch.rb +33 -37
  61. data/lib/autoproj/cli/which.rb +16 -20
  62. data/lib/autoproj/cli.rb +4 -2
  63. data/lib/autoproj/configuration.rb +77 -84
  64. data/lib/autoproj/environment.rb +28 -13
  65. data/lib/autoproj/exceptions.rb +9 -3
  66. data/lib/autoproj/find_workspace.rb +20 -25
  67. data/lib/autoproj/git_server_configuration.rb +40 -44
  68. data/lib/autoproj/gitorious.rb +1 -1
  69. data/lib/autoproj/installation_manifest.rb +64 -29
  70. data/lib/autoproj/local_package_set.rb +13 -11
  71. data/lib/autoproj/manifest.rb +132 -130
  72. data/lib/autoproj/metapackage.rb +2 -6
  73. data/lib/autoproj/ops/atomic_write.rb +7 -6
  74. data/lib/autoproj/ops/build.rb +4 -6
  75. data/lib/autoproj/ops/cache.rb +41 -43
  76. data/lib/autoproj/ops/cached_env.rb +5 -4
  77. data/lib/autoproj/ops/configuration.rb +511 -506
  78. data/lib/autoproj/ops/import.rb +73 -63
  79. data/lib/autoproj/ops/install.rb +178 -174
  80. data/lib/autoproj/ops/loader.rb +77 -76
  81. data/lib/autoproj/ops/main_config_switcher.rb +36 -45
  82. data/lib/autoproj/ops/phase_reporting.rb +4 -4
  83. data/lib/autoproj/ops/snapshot.rb +250 -247
  84. data/lib/autoproj/ops/tools.rb +76 -78
  85. data/lib/autoproj/ops/watch.rb +6 -6
  86. data/lib/autoproj/ops/which.rb +17 -14
  87. data/lib/autoproj/options.rb +13 -2
  88. data/lib/autoproj/os_package_installer.rb +102 -92
  89. data/lib/autoproj/os_package_query.rb +7 -13
  90. data/lib/autoproj/os_package_resolver.rb +189 -140
  91. data/lib/autoproj/os_repository_installer.rb +4 -4
  92. data/lib/autoproj/os_repository_resolver.rb +8 -6
  93. data/lib/autoproj/package_definition.rb +12 -13
  94. data/lib/autoproj/package_managers/apt_dpkg_manager.rb +10 -10
  95. data/lib/autoproj/package_managers/bundler_manager.rb +147 -111
  96. data/lib/autoproj/package_managers/debian_version.rb +25 -21
  97. data/lib/autoproj/package_managers/emerge_manager.rb +2 -3
  98. data/lib/autoproj/package_managers/gem_manager.rb +68 -77
  99. data/lib/autoproj/package_managers/homebrew_manager.rb +3 -4
  100. data/lib/autoproj/package_managers/manager.rb +8 -3
  101. data/lib/autoproj/package_managers/pacman_manager.rb +2 -3
  102. data/lib/autoproj/package_managers/pip_manager.rb +20 -22
  103. data/lib/autoproj/package_managers/pkg_manager.rb +3 -4
  104. data/lib/autoproj/package_managers/port_manager.rb +2 -3
  105. data/lib/autoproj/package_managers/shell_script_manager.rb +32 -22
  106. data/lib/autoproj/package_managers/unknown_os_manager.rb +5 -8
  107. data/lib/autoproj/package_managers/yum_manager.rb +12 -15
  108. data/lib/autoproj/package_managers/zypper_manager.rb +11 -14
  109. data/lib/autoproj/package_manifest.rb +27 -26
  110. data/lib/autoproj/package_selection.rb +187 -187
  111. data/lib/autoproj/package_set.rb +127 -113
  112. data/lib/autoproj/python.rb +55 -55
  113. data/lib/autoproj/query_base.rb +20 -14
  114. data/lib/autoproj/reporter.rb +19 -19
  115. data/lib/autoproj/repository_managers/apt.rb +101 -67
  116. data/lib/autoproj/repository_managers/unknown_os_manager.rb +3 -3
  117. data/lib/autoproj/shell_completion.rb +16 -13
  118. data/lib/autoproj/source_package_query.rb +29 -36
  119. data/lib/autoproj/system.rb +32 -21
  120. data/lib/autoproj/test.rb +127 -104
  121. data/lib/autoproj/variable_expansion.rb +7 -9
  122. data/lib/autoproj/vcs_definition.rb +35 -32
  123. data/lib/autoproj/version.rb +1 -1
  124. data/lib/autoproj/workspace.rb +123 -107
  125. data/lib/autoproj/zsh_completion.rb +8 -9
  126. data/lib/autoproj.rb +53 -55
  127. data/samples/autoproj/init.rb +1 -2
  128. metadata +53 -51
  129. data/.travis.yml +0 -24
@@ -1,6 +1,6 @@
1
- require 'autoproj/repository_managers/manager'
2
- require 'autoproj/repository_managers/unknown_os_manager'
3
- require 'autoproj/repository_managers/apt'
1
+ require "autoproj/repository_managers/manager"
2
+ require "autoproj/repository_managers/unknown_os_manager"
3
+ require "autoproj/repository_managers/apt"
4
4
 
5
5
  module Autoproj
6
6
  class OSRepositoryInstaller
@@ -11,7 +11,7 @@ module Autoproj
11
11
  attr_reader :repository_managers
12
12
 
13
13
  OS_REPOSITORY_MANAGERS = {
14
- 'debian' => RepositoryManagers::APT
14
+ "debian" => RepositoryManagers::APT
15
15
  }.freeze
16
16
 
17
17
  def initialize(ws)
@@ -1,5 +1,5 @@
1
- require 'tempfile'
2
- require 'json'
1
+ require "tempfile"
2
+ require "json"
3
3
 
4
4
  module Autoproj
5
5
  # Manager for OS repository provided by package sets
@@ -11,7 +11,9 @@ module Autoproj
11
11
  attr_accessor :operating_system
12
12
 
13
13
  def self.load(file)
14
- raise ArgumentError, "no such file or directory: #{file}" unless File.file?(file)
14
+ unless File.file?(file)
15
+ raise ArgumentError, "no such file or directory: #{file}"
16
+ end
15
17
 
16
18
  error_t = if defined? Psych::SyntaxError
17
19
  [ArgumentError, Psych::SyntaxError]
@@ -62,12 +64,12 @@ module Autoproj
62
64
  end
63
65
 
64
66
  def entry_matches?(entry, identifiers)
65
- !(entry.keys.first.split(',').map(&:strip) & identifiers).empty?
67
+ !(entry.keys.first.split(",").map(&:strip) & identifiers).empty?
66
68
  end
67
69
 
68
70
  def resolved_entries
69
71
  os_name, os_version = operating_system
70
- os_version << 'default' unless os_version.include?('default')
72
+ os_version << "default" unless os_version.include?("default")
71
73
 
72
74
  distribution_filtered = definitions.select do |entry|
73
75
  entry_matches?(entry, os_name)
@@ -131,7 +133,7 @@ module Autoproj
131
133
  return if obj.is_a?(type)
132
134
 
133
135
  raise ArgumentError, "invalid osrepos definition in #{path.join('/')}: "\
134
- "expected a #{type}, found a #{obj.class}"
136
+ "expected a #{type}, found a #{obj.class}"
135
137
  end
136
138
  end
137
139
  end
@@ -15,6 +15,7 @@ module Autoproj
15
15
  # @return [String] path to the file that contains this package's
16
16
  # definition
17
17
  attr_reader :file
18
+
18
19
  # Whether this package is completely setup
19
20
  #
20
21
  # If the package is set up, its importer as well as all target
@@ -48,7 +49,7 @@ module Autoproj
48
49
  # @return [Array<String>]
49
50
  def modes
50
51
  @modes + autobuild.utilities
51
- .values.find_all(&:enabled?).map(&:name)
52
+ .values.find_all(&:enabled?).map(&:name)
52
53
  end
53
54
 
54
55
  # The package name
@@ -83,19 +84,17 @@ module Autoproj
83
84
  def apply_dependencies_from_manifest
84
85
  manifest = autobuild.description
85
86
  manifest.each_dependency(modes) do |name, is_optional|
86
- begin
87
- if is_optional
88
- autobuild.optional_dependency name
89
- else
90
- autobuild.depends_on name
91
- end
92
- rescue ConfigError => e
93
- raise PackageNotFound.new(manifest.path),
94
- "manifest #{manifest.path} of #{self.name} from "\
95
- "#{package_set.name} lists '#{name}' as dependency, "\
96
- 'but it is neither a normal package nor an osdeps '\
97
- "package. osdeps reports: #{e.message}", e.backtrace
87
+ if is_optional
88
+ autobuild.optional_dependency name
89
+ else
90
+ autobuild.depends_on name
98
91
  end
92
+ rescue ConfigError => e
93
+ raise PackageNotFound.new(manifest.path),
94
+ "manifest #{manifest.path} of #{self.name} from "\
95
+ "#{package_set.name} lists '#{name}' as dependency, "\
96
+ "but it is neither a normal package nor an osdeps "\
97
+ "package. osdeps reports: #{e.message}", e.backtrace
99
98
  end
100
99
  end
101
100
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'autoproj/package_managers/debian_version'
3
+ require "autoproj/package_managers/debian_version"
4
4
 
5
5
  module Autoproj
6
6
  module PackageManagers
@@ -21,19 +21,19 @@ module Autoproj
21
21
  def configure_manager
22
22
  super
23
23
  ws.config.declare(
24
- 'apt_dpkg_update', 'boolean',
25
- default: 'yes',
26
- doc: ['Would you like autoproj to keep apt packages up-to-date?']
24
+ "apt_dpkg_update", "boolean",
25
+ default: "yes",
26
+ doc: ["Would you like autoproj to keep apt packages up-to-date?"]
27
27
  )
28
28
  keep_uptodate?
29
29
  end
30
30
 
31
31
  def keep_uptodate?
32
- ws.config.get('apt_dpkg_update')
32
+ ws.config.get("apt_dpkg_update")
33
33
  end
34
34
 
35
35
  def keep_uptodate=(flag)
36
- ws.config.set('apt_dpkg_update', flag, true)
36
+ ws.config.set("apt_dpkg_update", flag, true)
37
37
  end
38
38
 
39
39
  def self.parse_package_status(
@@ -48,7 +48,7 @@ module Autoproj
48
48
  end
49
49
  end
50
50
  if virtual && paragraph =~ /^Provides: (.*)$/
51
- installed_packages.merge($1.split(',').map(&:strip))
51
+ installed_packages.merge($1.split(",").map(&:strip))
52
52
  end
53
53
  end
54
54
  end
@@ -76,7 +76,7 @@ module Autoproj
76
76
  end
77
77
 
78
78
  def self.parse_apt_cache_paragraph(paragraph)
79
- version = '0'
79
+ version = "0"
80
80
  if (paragraph_m = /^Package: (.*)$/.match(paragraph))
81
81
  package_name = paragraph_m[1]
82
82
  version_m = /^Version: (.*)$/.match(paragraph)
@@ -87,7 +87,7 @@ module Autoproj
87
87
 
88
88
  def self.parse_packages_versions(packages)
89
89
  packages_versions = {}
90
- apt_cache_show = `apt-cache show --no-all-versions #{packages.join(' ')}`
90
+ apt_cache_show = `apt-cache show --no-all-versions #{packages.join(" ")}`
91
91
  apt_cache_show = StringScanner.new(apt_cache_show)
92
92
  return packages_versions unless apt_cache_show.scan(/Package: /)
93
93
 
@@ -115,7 +115,7 @@ module Autoproj
115
115
  # On a dpkg-enabled system, checks if the provided package is installed
116
116
  # and returns true if it is the case
117
117
  def installed?(package_name, filter_uptodate_packages: false,
118
- install_only: false)
118
+ install_only: false)
119
119
  unless @installed_packages && @installed_versions
120
120
  @installed_packages, @installed_versions =
121
121
  self.class.parse_dpkg_status(status_file)