autoproj 2.3.1 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -3
  3. data/.vscode/launch.json +25 -0
  4. data/Gemfile +10 -3
  5. data/autoproj.gemspec +1 -1
  6. data/bin/autoproj_bootstrap +5 -3
  7. data/bin/autoproj_bootstrap.in +5 -3
  8. data/bin/autoproj_install +2 -2
  9. data/bin/autoproj_install.in +2 -2
  10. data/lib/autoproj.rb +3 -1
  11. data/lib/autoproj/build_option.rb +4 -4
  12. data/lib/autoproj/cli.rb +10 -1
  13. data/lib/autoproj/cli/base.rb +14 -4
  14. data/lib/autoproj/cli/bootstrap.rb +2 -2
  15. data/lib/autoproj/cli/cache.rb +4 -10
  16. data/lib/autoproj/cli/clean.rb +1 -1
  17. data/lib/autoproj/cli/commit.rb +1 -1
  18. data/lib/autoproj/cli/exec.rb +11 -5
  19. data/lib/autoproj/cli/locate.rb +12 -12
  20. data/lib/autoproj/cli/log.rb +1 -2
  21. data/lib/autoproj/cli/main.rb +23 -4
  22. data/lib/autoproj/cli/main_plugin.rb +2 -2
  23. data/lib/autoproj/cli/manifest.rb +6 -3
  24. data/lib/autoproj/cli/query.rb +71 -10
  25. data/lib/autoproj/cli/reset.rb +4 -4
  26. data/lib/autoproj/cli/switch_config.rb +2 -2
  27. data/lib/autoproj/cli/tag.rb +2 -2
  28. data/lib/autoproj/cli/update.rb +2 -0
  29. data/lib/autoproj/cli/which.rb +17 -0
  30. data/lib/autoproj/exceptions.rb +9 -4
  31. data/lib/autoproj/git_server_configuration.rb +80 -53
  32. data/lib/autoproj/manifest.rb +1 -1
  33. data/lib/autoproj/ops/cache.rb +21 -10
  34. data/lib/autoproj/ops/main_config_switcher.rb +6 -9
  35. data/lib/autoproj/os_package_query.rb +99 -0
  36. data/lib/autoproj/package_managers/bundler_manager.rb +8 -1
  37. data/lib/autoproj/package_managers/yum_manager.rb +2 -2
  38. data/lib/autoproj/package_managers/zypper_manager.rb +2 -2
  39. data/lib/autoproj/query_base.rb +128 -0
  40. data/lib/autoproj/reporter.rb +12 -0
  41. data/lib/autoproj/{query.rb → source_package_query.rb} +15 -81
  42. data/lib/autoproj/version.rb +1 -1
  43. data/lib/autoproj/workspace.rb +38 -0
  44. metadata +8 -5
  45. data/lib/autoproj/cli/snapshot.rb +0 -66
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "2.3.1"
2
+ VERSION = "2.4.0"
3
3
  end
@@ -701,6 +701,44 @@ def register_package(package, block = nil, package_set = manifest.main_package_s
701
701
  pkg.autobuild.ws = self
702
702
  pkg
703
703
  end
704
+
705
+ class ExecutableNotFound < ArgumentError
706
+ end
707
+
708
+ # Find the given executable file in PATH
709
+ #
710
+ # If `cmd` is an absolute path, it will either return it or raise if
711
+ # `cmd` is not executable. Otherwise, looks for an executable named
712
+ # `cmd` in PATH and returns it, or raises if it cannot be found. The
713
+ # exception contains a more detailed reason for failure
714
+ #
715
+ #
716
+ # @param [String] cmd
717
+ # @return [String] the resolved program
718
+ # @raise [ExecutableNotFound] if an executable file named `cmd` cannot
719
+ # be found
720
+ def which(cmd)
721
+ path = Pathname.new(cmd)
722
+ if path.absolute?
723
+ if path.file? && path.executable?
724
+ return cmd
725
+ elsif path.exist?
726
+ raise ExecutableNotFound.new(cmd), "given command `#{cmd}` exists but is not an executable file"
727
+ else
728
+ raise ExecutableNotFound.new(cmd), "given command `#{cmd}` does not exist, an executable file was expected"
729
+ end
730
+ else
731
+ env = full_env
732
+ absolute = env.find_executable_in_path(cmd)
733
+ if absolute
734
+ return absolute
735
+ elsif file = env.find_in_path(cmd)
736
+ raise ExecutableNotFound.new(cmd), "`#{cmd}` resolves to #{file} which is not executable"
737
+ else
738
+ raise ExecutableNotFound.new(cmd), "cannot resolve `#{cmd}` to an executable in the workspace"
739
+ end
740
+ end
741
+ end
704
742
  end
705
743
 
706
744
  def self.workspace
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.3.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-04 00:00:00.000000000 Z
11
+ date: 2018-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -228,6 +228,7 @@ files:
228
228
  - ".gitattributes"
229
229
  - ".gitignore"
230
230
  - ".travis.yml"
231
+ - ".vscode/launch.json"
231
232
  - Gemfile
232
233
  - History.txt
233
234
  - README.md
@@ -274,13 +275,13 @@ files:
274
275
  - lib/autoproj/cli/reconfigure.rb
275
276
  - lib/autoproj/cli/reset.rb
276
277
  - lib/autoproj/cli/show.rb
277
- - lib/autoproj/cli/snapshot.rb
278
278
  - lib/autoproj/cli/status.rb
279
279
  - lib/autoproj/cli/switch_config.rb
280
280
  - lib/autoproj/cli/tag.rb
281
281
  - lib/autoproj/cli/test.rb
282
282
  - lib/autoproj/cli/update.rb
283
283
  - lib/autoproj/cli/versions.rb
284
+ - lib/autoproj/cli/which.rb
284
285
  - lib/autoproj/configuration.rb
285
286
  - lib/autoproj/default.osdeps
286
287
  - lib/autoproj/environment.rb
@@ -303,6 +304,7 @@ files:
303
304
  - lib/autoproj/ops/tools.rb
304
305
  - lib/autoproj/options.rb
305
306
  - lib/autoproj/os_package_installer.rb
307
+ - lib/autoproj/os_package_query.rb
306
308
  - lib/autoproj/os_package_resolver.rb
307
309
  - lib/autoproj/package_definition.rb
308
310
  - lib/autoproj/package_managers/apt_dpkg_manager.rb
@@ -322,8 +324,9 @@ files:
322
324
  - lib/autoproj/package_manifest.rb
323
325
  - lib/autoproj/package_selection.rb
324
326
  - lib/autoproj/package_set.rb
325
- - lib/autoproj/query.rb
327
+ - lib/autoproj/query_base.rb
326
328
  - lib/autoproj/reporter.rb
329
+ - lib/autoproj/source_package_query.rb
327
330
  - lib/autoproj/system.rb
328
331
  - lib/autoproj/templates/create-set/packages.autobuild
329
332
  - lib/autoproj/templates/create-set/source.yml
@@ -353,7 +356,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
353
356
  requirements:
354
357
  - - ">="
355
358
  - !ruby/object:Gem::Version
356
- version: 2.0.0
359
+ version: 2.1.0
357
360
  required_rubygems_version: !ruby/object:Gem::Requirement
358
361
  requirements:
359
362
  - - ">="
@@ -1,66 +0,0 @@
1
- require 'autoproj'
2
- require 'autoproj/cli/versions'
3
-
4
- module Autoproj
5
- module CLI
6
- class Snapshot
7
- include Ops::Tools
8
-
9
- attr_reader :manifest
10
-
11
- def initialize(manifest)
12
- @manifest = manifest
13
- end
14
-
15
- def parse_options(args)
16
- options = Hash.new
17
- parser = OptionParser.new do |opt|
18
- opt.on '-k', '--keep-going', "ignore packages that can't be snapshotted (the default is to terminate with an error)" do
19
- options[:keep_going] = true
20
- end
21
- end
22
- common_options(parser)
23
- remaining_args = parser.parse(args)
24
- return remaining_args, options
25
- end
26
-
27
- def run(target_dir, options)
28
- # First, copy the configuration directory to create target_dir
29
- #
30
- # This must be done first as the snapshot calls might copy stuff in
31
- # there
32
- if File.exist?(target_dir)
33
- raise ArgumentError, "#{target_dir} already exists"
34
- end
35
- FileUtils.cp_r Autoproj.config_dir, target_dir
36
-
37
- begin
38
- versions = Versions.new(manifest)
39
- versions_file = File.join(
40
- target_dir,
41
- Workspace::OVERRIDES_DIR,
42
- Versions::DEFAULT_VERSIONS_FILE_BASENAME)
43
-
44
- versions.run([],
45
- replace: true,
46
- package_sets: true,
47
- keep_going: options[:keep_going],
48
- output_file: versions_file)
49
- rescue ::Exception
50
- FileUtils.rm_rf target_dir
51
- raise
52
- end
53
-
54
- # Finally, remove the remotes/ directory from the generated
55
- # buildconf, it is obsolete now
56
- FileUtils.rm_rf File.join(target_dir, 'remotes')
57
-
58
- Autoproj.message "successfully created a snapshot of the current autoproj configuration in #{target_dir}"
59
- end
60
-
61
- def notify_env_sh_updated
62
- end
63
- end
64
- end
65
- end
66
-