autoproj 2.7.1 → 2.8.0

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.
Files changed (44) hide show
  1. checksums.yaml +5 -5
  2. data/Rakefile +31 -1
  3. data/autoproj.gemspec +2 -0
  4. data/bin/alocate +3 -5
  5. data/bin/alog +3 -3
  6. data/bin/amake +3 -4
  7. data/bin/aup +4 -3
  8. data/bin/autoproj +1 -6
  9. data/bin/autoproj_bootstrap +153 -47
  10. data/bin/autoproj_install +153 -47
  11. data/lib/autoproj/autobuild_extensions/dsl.rb +5 -0
  12. data/lib/autoproj/bash_completion.rb +26 -0
  13. data/lib/autoproj/cli/base.rb +4 -4
  14. data/lib/autoproj/cli/build.rb +2 -3
  15. data/lib/autoproj/cli/main.rb +52 -2
  16. data/lib/autoproj/cli/main_global.rb +39 -0
  17. data/lib/autoproj/cli/osdeps.rb +2 -1
  18. data/lib/autoproj/cli/update.rb +13 -1
  19. data/lib/autoproj/configuration.rb +14 -2
  20. data/lib/autoproj/environment.rb +48 -31
  21. data/lib/autoproj/ops/install.rb +153 -47
  22. data/lib/autoproj/shell_completion.rb +164 -0
  23. data/lib/autoproj/templates/helpers.bash.erb +79 -0
  24. data/lib/autoproj/templates/helpers.zsh.erb +38 -0
  25. data/lib/autoproj/templates/main.bash.erb +35 -0
  26. data/lib/autoproj/templates/main.zsh.erb +9 -0
  27. data/lib/autoproj/templates/subcommand.bash.erb +50 -0
  28. data/lib/autoproj/templates/subcommand.zsh.erb +51 -0
  29. data/lib/autoproj/version.rb +1 -1
  30. data/lib/autoproj/workspace.rb +97 -19
  31. data/lib/autoproj/zsh_completion.rb +43 -0
  32. data/shell/autoproj_bash +67 -0
  33. data/shell/autoproj_zsh +26 -0
  34. data/shell/completion/alocate_bash +68 -0
  35. data/shell/completion/alocate_zsh +22 -0
  36. data/shell/completion/alog_bash +61 -0
  37. data/shell/completion/alog_zsh +20 -0
  38. data/shell/completion/amake_bash +77 -0
  39. data/shell/completion/amake_zsh +27 -0
  40. data/shell/completion/aup_bash +89 -0
  41. data/shell/completion/aup_zsh +34 -0
  42. data/shell/completion/autoproj_bash +1556 -0
  43. data/shell/completion/autoproj_zsh +1005 -0
  44. metadata +51 -3
@@ -0,0 +1,43 @@
1
+ require 'autoproj/shell_completion'
2
+
3
+ module Autoproj
4
+ # This class generates shell completion for code for a given Thor subclasss
5
+ class ZshCompletion < ShellCompletion
6
+ MAIN_FUNCTION_TEMPLATE = 'main.zsh.erb'
7
+ SUBCOMMAND_FUNCTION_TEMPLATE = 'subcommand.zsh.erb'
8
+
9
+ def setup_file_completion(metadata)
10
+ metadata[:completer] = '_files'
11
+ end
12
+
13
+ def setup_executable_completion(metadata)
14
+ metadata[:completer] = '_path_commands'
15
+ end
16
+
17
+ def setup_package_completion(metadata)
18
+ metadata[:completer] = '_autoproj_installed_packages'
19
+ end
20
+
21
+ def disable_completion(metadata)
22
+ metadata[:completer] = ':'
23
+ end
24
+
25
+ def quote(s)
26
+ escaped = s.gsub(/'/, "''")
27
+ %('#{escaped}')
28
+ end
29
+
30
+ def bracket(s)
31
+ %([#{s}])
32
+ end
33
+
34
+ def escape_option_names(names)
35
+ if names.size == 1
36
+ names.first
37
+ else
38
+ '{' + names.join(',') + '}'
39
+ end
40
+ end
41
+ end
42
+ end
43
+
@@ -1,3 +1,5 @@
1
+ #!/usr/bin/env bash
2
+
1
3
  function acd {
2
4
  local pkg_path
3
5
  pkg_path=$(autoproj locate $1)
@@ -10,3 +12,68 @@ function acd {
10
12
  return 0
11
13
  fi
12
14
  }
15
+
16
+ type -p _get_comp_words_by_ref || return 1
17
+
18
+ _autoproj_installed_packages() {
19
+ local packages="`ruby 2>/dev/null <<EOF
20
+ begin
21
+ require 'autoproj'
22
+
23
+ path = Autoproj.workspace.installation_manifest_path
24
+ manifest = Autoproj::InstallationManifest.new(path)
25
+
26
+ manifest.load
27
+ manifest.each_package { |pkg| puts pkg.name }
28
+ rescue
29
+ end
30
+ EOF`"
31
+
32
+ COMPREPLY=( $( compgen -W "$packages" -- "$cur" ) )
33
+ }
34
+
35
+ _autoproj_subcommands() {
36
+ local subcommands="$1"
37
+
38
+ local counter=$((command_pos + 1))
39
+ while [ "$counter" -lt "$cword" ]; do
40
+ case "${words[$counter]}" in
41
+ $(_autoproj_to_extglob "$subcommands") )
42
+ subcommand_pos=$counter
43
+ local subcommand=${words[$counter]}
44
+ local completions_func=_autoproj_${command}_${subcommand//-/_}
45
+ declare -F "$completions_func" >/dev/null && "$completions_func"
46
+ return 0
47
+ ;;
48
+ esac
49
+ (( counter++ ))
50
+ done
51
+ return 1
52
+ }
53
+
54
+ _autoproj_to_alternatives() {
55
+ local parts=( $1 )
56
+ local IFS='|'
57
+ echo "${parts[*]}"
58
+ }
59
+
60
+ _autoproj_to_extglob() {
61
+ local extglob=$( _autoproj_to_alternatives "$1" )
62
+ echo "@($extglob)"
63
+ }
64
+
65
+ _acd()
66
+ {
67
+ local cur prev words cword
68
+ _get_comp_words_by_ref -n : cur prev words cword
69
+ case "$cword" in
70
+ 1)
71
+ _autoproj_installed_packages
72
+ ;;
73
+ *)
74
+ COMPREPLY=()
75
+ ;;
76
+ esac
77
+ }
78
+
79
+ complete -F _acd acd
@@ -1,3 +1,5 @@
1
+ #!/usr/bin/env bash
2
+
1
3
  function acd {
2
4
  local pkg_path
3
5
  pkg_path=$(autoproj locate $1)
@@ -10,3 +12,27 @@ function acd {
10
12
  return 0
11
13
  fi
12
14
  }
15
+
16
+ _autoproj_installed_packages() {
17
+ ruby 2>/dev/null <<EOF | while IFS= read -r; do packages+=("$REPLY"); done
18
+
19
+ begin
20
+ require 'autoproj'
21
+
22
+ path = Autoproj.workspace.installation_manifest_path
23
+ manifest = Autoproj::InstallationManifest.new(path)
24
+
25
+ manifest.load
26
+ manifest.each_package { |pkg| puts pkg.name }
27
+ rescue
28
+ end
29
+ EOF
30
+
31
+ compadd -a packages
32
+ }
33
+
34
+ _acd () {
35
+ _arguments -s "1:package:_autoproj_installed_packages"
36
+ }
37
+
38
+ compdef _acd acd
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env bash
2
+
3
+ __alocate_alocate()
4
+ {
5
+ __alocate
6
+ }
7
+
8
+ _alocate()
9
+ {
10
+ local cur prev words cword
11
+ local command='alocate'
12
+ local counter=1
13
+
14
+ _get_comp_words_by_ref -n : cur prev words cword
15
+
16
+ while [ "$counter" -lt "$cword" ]; do
17
+ case "${words[$counter]}" in
18
+ -*)
19
+ break
20
+ ;;
21
+ *)
22
+ command="${words[$counter]}"
23
+ break
24
+ ;;
25
+ esac
26
+ (( counter++ ))
27
+ done
28
+
29
+ local completions_func=__alocate_${command//-/_}
30
+ $completions_func
31
+ }
32
+
33
+ __alocate() {
34
+ local options="
35
+ --verbose
36
+ --no-verbose
37
+ --debug
38
+ --no-debug
39
+ --silent
40
+ --no-silent
41
+ --color
42
+ --no-color
43
+ --progress
44
+ --no-progress
45
+ --cache
46
+ --no-cache
47
+ --prefix
48
+ --no-prefix
49
+ -p
50
+ --build
51
+ --no-build
52
+ -b
53
+ --log
54
+ -l
55
+ "
56
+
57
+ case "$cur" in
58
+ -*)
59
+ COMPREPLY=($(compgen -W "$options" -- ${cur}))
60
+ ;;
61
+ *)
62
+ _autoproj_installed_packages
63
+ ;;
64
+ esac
65
+ }
66
+
67
+
68
+ complete -F _alocate alocate
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env zsh
2
+
3
+ _alocate() {
4
+ __alocate
5
+ }
6
+
7
+ __alocate() {
8
+ _arguments \
9
+ {--verbose,--no-verbose}'[turns verbose output]' \
10
+ {--debug,--no-debug}'[turns debugging output]' \
11
+ {--silent,--no-silent}'[tell autoproj to not display anything]' \
12
+ {--color,--no-color}'[enables or disables colored display (enabled by default if the terminal supports it)]' \
13
+ {--progress,--no-progress}'[enables or disables progress display (enabled by default if the terminal supports it)]' \
14
+ {--cache,--no-cache}'[controls whether the resolution should be done by loading the whole configuration (false, slow) or through a cache file (the default)]' \
15
+ {--prefix,--no-prefix,-p}'[outputs the package''s prefix directory instead of its source directory]' \
16
+ {--build,--no-build,-b}'[outputs the package''s build directory instead of its source directory]' \
17
+ {--log,-l}'[outputs the path to a package''s log file]' \
18
+ '*:arg:_autoproj_installed_packages'
19
+ }
20
+
21
+
22
+ compdef _alocate alocate
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env bash
2
+
3
+ __alog_alog()
4
+ {
5
+ __alog
6
+ }
7
+
8
+ _alog()
9
+ {
10
+ local cur prev words cword
11
+ local command='alog'
12
+ local counter=1
13
+
14
+ _get_comp_words_by_ref -n : cur prev words cword
15
+
16
+ while [ "$counter" -lt "$cword" ]; do
17
+ case "${words[$counter]}" in
18
+ -*)
19
+ break
20
+ ;;
21
+ *)
22
+ command="${words[$counter]}"
23
+ break
24
+ ;;
25
+ esac
26
+ (( counter++ ))
27
+ done
28
+
29
+ local completions_func=__alog_${command//-/_}
30
+ $completions_func
31
+ }
32
+
33
+ __alog() {
34
+ local options="
35
+ --verbose
36
+ --no-verbose
37
+ --debug
38
+ --no-debug
39
+ --silent
40
+ --no-silent
41
+ --color
42
+ --no-color
43
+ --progress
44
+ --no-progress
45
+ --since
46
+ --diff
47
+ --no-diff
48
+ "
49
+
50
+ case "$cur" in
51
+ -*)
52
+ COMPREPLY=($(compgen -W "$options" -- ${cur}))
53
+ ;;
54
+ *)
55
+
56
+ ;;
57
+ esac
58
+ }
59
+
60
+
61
+ complete -F _alog alog
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env zsh
2
+
3
+ _alog() {
4
+ __alog
5
+ }
6
+
7
+ __alog() {
8
+ _arguments \
9
+ {--verbose,--no-verbose}'[turns verbose output]' \
10
+ {--debug,--no-debug}'[turns debugging output]' \
11
+ {--silent,--no-silent}'[tell autoproj to not display anything]' \
12
+ {--color,--no-color}'[enables or disables colored display (enabled by default if the terminal supports it)]' \
13
+ {--progress,--no-progress}'[enables or disables progress display (enabled by default if the terminal supports it)]' \
14
+ --since'[show what got updated since the given version]' \
15
+ {--diff,--no-diff}'[show the difference between two stages in the log]' \
16
+ '*:arg::'
17
+ }
18
+
19
+
20
+ compdef _alog alog
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env bash
2
+
3
+ __amake_amake()
4
+ {
5
+ __amake
6
+ }
7
+
8
+ _amake()
9
+ {
10
+ local cur prev words cword
11
+ local command='amake'
12
+ local counter=1
13
+
14
+ _get_comp_words_by_ref -n : cur prev words cword
15
+
16
+ while [ "$counter" -lt "$cword" ]; do
17
+ case "${words[$counter]}" in
18
+ -*)
19
+ break
20
+ ;;
21
+ *)
22
+ command="${words[$counter]}"
23
+ break
24
+ ;;
25
+ esac
26
+ (( counter++ ))
27
+ done
28
+
29
+ local completions_func=__amake_${command//-/_}
30
+ $completions_func
31
+ }
32
+
33
+ __amake() {
34
+ local options="
35
+ --verbose
36
+ --no-verbose
37
+ --debug
38
+ --no-debug
39
+ --silent
40
+ --no-silent
41
+ --color
42
+ --no-color
43
+ --progress
44
+ --no-progress
45
+ --keep-going
46
+ --no-keep-going
47
+ -k
48
+ --force
49
+ --no-force
50
+ --rebuild
51
+ --no-rebuild
52
+ --osdeps
53
+ --no-osdeps
54
+ --deps
55
+ --no-deps
56
+ --parallel
57
+ -p
58
+ --auto-exclude
59
+ --no-auto-exclude
60
+ --tool
61
+ --no-tool
62
+ --confirm
63
+ --no-confirm
64
+ "
65
+
66
+ case "$cur" in
67
+ -*)
68
+ COMPREPLY=($(compgen -W "$options" -- ${cur}))
69
+ ;;
70
+ *)
71
+ _autoproj_installed_packages
72
+ ;;
73
+ esac
74
+ }
75
+
76
+
77
+ complete -F _amake amake
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env zsh
2
+
3
+ _amake() {
4
+ __amake
5
+ }
6
+
7
+ __amake() {
8
+ _arguments \
9
+ {--verbose,--no-verbose}'[turns verbose output]' \
10
+ {--debug,--no-debug}'[turns debugging output]' \
11
+ {--silent,--no-silent}'[tell autoproj to not display anything]' \
12
+ {--color,--no-color}'[enables or disables colored display (enabled by default if the terminal supports it)]' \
13
+ {--progress,--no-progress}'[enables or disables progress display (enabled by default if the terminal supports it)]' \
14
+ {--keep-going,--no-keep-going,-k}'[do not stop on build or checkout errors]' \
15
+ {--force,--no-force}'[force reconfiguration-build cycle on the requested packages, even if they do not seem to need it]' \
16
+ {--rebuild,--no-rebuild}'[clean and build the requested packages]' \
17
+ {--osdeps,--no-osdeps}'[controls whether missing osdeps should be installed. In rebuild mode, also controls whether the osdeps should be reinstalled or not (the default is to reinstall them)]' \
18
+ {--deps,--no-deps}'[controls whether the operation should apply to the package''s dependencies as well. -n is a shortcut for --no-deps]' \
19
+ {--parallel,-p}'[maximum number of parallel jobs]' \
20
+ {--auto-exclude,--no-auto-exclude}'[if true, packages that fail to import will be excluded from the build]' \
21
+ {--tool,--no-tool}'[act as a build tool, transparently passing the subcommand''s outputs to STDOUT]' \
22
+ {--confirm,--no-confirm}'[--force and --rebuild will ask confirmation if applied to the whole workspace. Use --no-confirm to disable this confirmation]' \
23
+ '*:arg:_autoproj_installed_packages'
24
+ }
25
+
26
+
27
+ compdef _amake amake
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env bash
2
+
3
+ __aup_aup()
4
+ {
5
+ __aup
6
+ }
7
+
8
+ _aup()
9
+ {
10
+ local cur prev words cword
11
+ local command='aup'
12
+ local counter=1
13
+
14
+ _get_comp_words_by_ref -n : cur prev words cword
15
+
16
+ while [ "$counter" -lt "$cword" ]; do
17
+ case "${words[$counter]}" in
18
+ -*)
19
+ break
20
+ ;;
21
+ *)
22
+ command="${words[$counter]}"
23
+ break
24
+ ;;
25
+ esac
26
+ (( counter++ ))
27
+ done
28
+
29
+ local completions_func=__aup_${command//-/_}
30
+ $completions_func
31
+ }
32
+
33
+ __aup() {
34
+ local options="
35
+ --verbose
36
+ --no-verbose
37
+ --debug
38
+ --no-debug
39
+ --silent
40
+ --no-silent
41
+ --color
42
+ --no-color
43
+ --progress
44
+ --no-progress
45
+ --keep-going
46
+ --no-keep-going
47
+ -k
48
+ --config
49
+ --no-config
50
+ --bundler
51
+ --no-bundler
52
+ --autoproj
53
+ --no-autoproj
54
+ --osdeps
55
+ --no-osdeps
56
+ --from
57
+ --checkout-only
58
+ --no-checkout-only
59
+ -c
60
+ --local
61
+ --no-local
62
+ --osdeps-filter-uptodate
63
+ --no-osdeps-filter-uptodate
64
+ --deps
65
+ --no-deps
66
+ --reset
67
+ --no-reset
68
+ --force-reset
69
+ --no-force-reset
70
+ --retry-count
71
+ --parallel
72
+ -p
73
+ --mainline
74
+ --auto-exclude
75
+ --no-auto-exclude
76
+ "
77
+
78
+ case "$cur" in
79
+ -*)
80
+ COMPREPLY=($(compgen -W "$options" -- ${cur}))
81
+ ;;
82
+ *)
83
+ _autoproj_installed_packages
84
+ ;;
85
+ esac
86
+ }
87
+
88
+
89
+ complete -F _aup aup