autoproj 2.0.0.rc11 → 2.0.0.rc12
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.
- checksums.yaml +4 -4
- data/Rakefile +1 -4
- data/autoproj.gemspec +1 -0
- data/bin/autoproj_bootstrap +29 -4
- data/bin/autoproj_bootstrap.in +3 -0
- data/bin/autoproj_install +29 -4
- data/bin/autoproj_install.in +3 -0
- data/lib/autoproj/cli/base.rb +7 -5
- data/lib/autoproj/cli/main.rb +14 -3
- data/lib/autoproj/configuration.rb +1 -1
- data/lib/autoproj/find_workspace.rb +6 -6
- data/lib/autoproj/ops/install.rb +26 -4
- data/lib/autoproj/version.rb +1 -1
- data/lib/autoproj/workspace.rb +19 -6
- metadata +16 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3783d15f79e9891de1d0aad451928d94ba3f5868
|
4
|
+
data.tar.gz: 8cd5d53de5bc10304e7327de923739c69b2f7311
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d21fb154c3098bf0455dcf38d0b243907497dfa30039a03d67e219ef8b1f94fc3d79ebc1f2f86ba42228d1c2fad3585b7cbf2e78abb83020a3c9b1be651cc40a
|
7
|
+
data.tar.gz: 2c729c154c16dccca56ca4eaeed705758302eacb7e6e9b49228bc687ad3579942f8dbbe1e0f01d41b4b4ea470dcc189094270b6632149e892d01f4c413d4319b
|
data/Rakefile
CHANGED
@@ -13,12 +13,9 @@ desc "generate the bootstrap script"
|
|
13
13
|
task 'bootstrap' do
|
14
14
|
require 'yaml'
|
15
15
|
autoproj_ops_install = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'ops', 'install.rb'))
|
16
|
-
|
17
16
|
# Since we are using gsub to replace the content in the bootstrap file,
|
18
17
|
# we have to quote all \
|
19
|
-
|
20
|
-
text.gsub! /\\/, '\\\\\\\\'
|
21
|
-
end
|
18
|
+
autoproj_ops_install.gsub! /\\/, '\\\\\\\\'
|
22
19
|
|
23
20
|
%w{bootstrap install}.each do |install_script|
|
24
21
|
bootstrap_code = File.read(File.join(Dir.pwd, 'bin', "autoproj_#{install_script}.in")).
|
data/autoproj.gemspec
CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_runtime_dependency "utilrb", ">= 2.0"
|
25
25
|
s.add_runtime_dependency "thor", '~> 0.19.0', '>= 0.19.1'
|
26
26
|
s.add_runtime_dependency 'concurrent-ruby'
|
27
|
+
s.add_runtime_dependency 'tty-screen', '>= 0.4.0'
|
27
28
|
s.add_development_dependency "flexmock", ">= 2.0.0"
|
28
29
|
s.add_development_dependency "minitest", ">= 5.0", "~> 5.0"
|
29
30
|
s.add_development_dependency "fakefs"
|
data/bin/autoproj_bootstrap
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
if RUBY_VERSION < "2.0.0"
|
4
4
|
STDERR.puts "autoproj requires Ruby >= 2.0.0"
|
5
5
|
exit 1
|
6
|
+
elsif ENV['AUTOPROJ_CURRENT_ROOT'] && (ENV['AUTOPROJ_CURRENT_ROOT'] != Dir.pwd)
|
7
|
+
STDERR.puts "it seems that you've already loaded an env.sh script in this console, open a new console and try again"
|
8
|
+
exit 1
|
6
9
|
end
|
7
10
|
|
8
11
|
require 'pathname'
|
@@ -28,6 +31,9 @@ module Autoproj
|
|
28
31
|
attr_reader :env
|
29
32
|
# The configuration hash
|
30
33
|
attr_reader :config
|
34
|
+
# A set of options that should be passed to autoproj when calling it
|
35
|
+
# in a subprocess
|
36
|
+
attr_reader :autoproj_options
|
31
37
|
|
32
38
|
def initialize(root_dir)
|
33
39
|
@root_dir = root_dir
|
@@ -37,6 +43,8 @@ module Autoproj
|
|
37
43
|
@gemfile = default_gemfile_contents
|
38
44
|
end
|
39
45
|
|
46
|
+
@autoproj_options = Array.new
|
47
|
+
|
40
48
|
@env = Hash.new
|
41
49
|
env['RUBYLIB'] = []
|
42
50
|
env['GEM_PATH'] = []
|
@@ -45,6 +53,10 @@ module Autoproj
|
|
45
53
|
env['BUNDLE_GEMFILE'] = []
|
46
54
|
|
47
55
|
load_config
|
56
|
+
if config['ruby_executable'] != Gem.ruby
|
57
|
+
raise "this autoproj installation was already bootstrapped using #{config['ruby_executable']}, but you are currently running under #{Gem.ruby}. Changing the ruby interpreter in a given workspace is not supported"
|
58
|
+
end
|
59
|
+
|
48
60
|
@local = false
|
49
61
|
end
|
50
62
|
|
@@ -200,8 +212,19 @@ module Autoproj
|
|
200
212
|
opt.on '--prefer-os-independent-packages', 'prefer OS-independent packages (such as a RubyGem) over their OS-packaged equivalent (e.g. the thor gem vs. the ruby-thor debian package)' do
|
201
213
|
@prefer_indep_over_os_packages = true
|
202
214
|
end
|
215
|
+
opt.on '--[no-]color', 'do not use colored output (enabled by default if the terminal supports it)' do |color|
|
216
|
+
if color then autoproj_options << "--color"
|
217
|
+
else autoproj_options << '--no-color'
|
218
|
+
end
|
219
|
+
end
|
220
|
+
opt.on '--[no-]progress', 'do not use progress output (enabled by default if the terminal supports it)' do |color|
|
221
|
+
if color then autoproj_options << "--progress"
|
222
|
+
else autoproj_options << '--no-progress'
|
223
|
+
end
|
224
|
+
end
|
203
225
|
end
|
204
|
-
options.parse(ARGV)
|
226
|
+
args = options.parse(ARGV)
|
227
|
+
autoproj_options + args
|
205
228
|
end
|
206
229
|
|
207
230
|
def install_bundler
|
@@ -446,7 +469,7 @@ module Autoproj
|
|
446
469
|
|
447
470
|
def run_autoproj(*args)
|
448
471
|
system env_for_child.merge('BUNDLE_GEMFILE' => autoproj_gemfile_path),
|
449
|
-
Gem.ruby, autoproj_path, *args
|
472
|
+
Gem.ruby, autoproj_path, *args, *autoproj_options
|
450
473
|
end
|
451
474
|
|
452
475
|
def stage1
|
@@ -468,8 +491,10 @@ module Autoproj
|
|
468
491
|
require 'autobuild'
|
469
492
|
puts "saving env.sh and .autoproj/env.sh"
|
470
493
|
save_env_sh(*vars)
|
471
|
-
puts "calling autoproj envsh"
|
472
|
-
system(Gem.ruby, autoproj_path, 'envsh')
|
494
|
+
puts "calling autoproj envsh #{autoproj_options}"
|
495
|
+
if !system(Gem.ruby, autoproj_path, 'envsh', *autoproj_options)
|
496
|
+
exit 1
|
497
|
+
end
|
473
498
|
end
|
474
499
|
end
|
475
500
|
end
|
data/bin/autoproj_bootstrap.in
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
if RUBY_VERSION < "2.0.0"
|
4
4
|
STDERR.puts "autoproj requires Ruby >= 2.0.0"
|
5
5
|
exit 1
|
6
|
+
elsif ENV['AUTOPROJ_CURRENT_ROOT'] && (ENV['AUTOPROJ_CURRENT_ROOT'] != Dir.pwd)
|
7
|
+
STDERR.puts "it seems that you've already loaded an env.sh script in this console, open a new console and try again"
|
8
|
+
exit 1
|
6
9
|
end
|
7
10
|
|
8
11
|
AUTOPROJ_OPS_INSTALL
|
data/bin/autoproj_install
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
if RUBY_VERSION < "2.0.0"
|
4
4
|
STDERR.puts "autoproj requires Ruby >= 2.0.0"
|
5
5
|
exit 1
|
6
|
+
elsif ENV['AUTOPROJ_CURRENT_ROOT'] && (ENV['AUTOPROJ_CURRENT_ROOT'] != Dir.pwd)
|
7
|
+
STDERR.puts "it seems that you've already loaded an env.sh script in this console, open a new console and try again"
|
8
|
+
exit 1
|
6
9
|
end
|
7
10
|
|
8
11
|
require 'pathname'
|
@@ -28,6 +31,9 @@ module Autoproj
|
|
28
31
|
attr_reader :env
|
29
32
|
# The configuration hash
|
30
33
|
attr_reader :config
|
34
|
+
# A set of options that should be passed to autoproj when calling it
|
35
|
+
# in a subprocess
|
36
|
+
attr_reader :autoproj_options
|
31
37
|
|
32
38
|
def initialize(root_dir)
|
33
39
|
@root_dir = root_dir
|
@@ -37,6 +43,8 @@ module Autoproj
|
|
37
43
|
@gemfile = default_gemfile_contents
|
38
44
|
end
|
39
45
|
|
46
|
+
@autoproj_options = Array.new
|
47
|
+
|
40
48
|
@env = Hash.new
|
41
49
|
env['RUBYLIB'] = []
|
42
50
|
env['GEM_PATH'] = []
|
@@ -45,6 +53,10 @@ module Autoproj
|
|
45
53
|
env['BUNDLE_GEMFILE'] = []
|
46
54
|
|
47
55
|
load_config
|
56
|
+
if config['ruby_executable'] != Gem.ruby
|
57
|
+
raise "this autoproj installation was already bootstrapped using #{config['ruby_executable']}, but you are currently running under #{Gem.ruby}. Changing the ruby interpreter in a given workspace is not supported"
|
58
|
+
end
|
59
|
+
|
48
60
|
@local = false
|
49
61
|
end
|
50
62
|
|
@@ -200,8 +212,19 @@ module Autoproj
|
|
200
212
|
opt.on '--prefer-os-independent-packages', 'prefer OS-independent packages (such as a RubyGem) over their OS-packaged equivalent (e.g. the thor gem vs. the ruby-thor debian package)' do
|
201
213
|
@prefer_indep_over_os_packages = true
|
202
214
|
end
|
215
|
+
opt.on '--[no-]color', 'do not use colored output (enabled by default if the terminal supports it)' do |color|
|
216
|
+
if color then autoproj_options << "--color"
|
217
|
+
else autoproj_options << '--no-color'
|
218
|
+
end
|
219
|
+
end
|
220
|
+
opt.on '--[no-]progress', 'do not use progress output (enabled by default if the terminal supports it)' do |color|
|
221
|
+
if color then autoproj_options << "--progress"
|
222
|
+
else autoproj_options << '--no-progress'
|
223
|
+
end
|
224
|
+
end
|
203
225
|
end
|
204
|
-
options.parse(ARGV)
|
226
|
+
args = options.parse(ARGV)
|
227
|
+
autoproj_options + args
|
205
228
|
end
|
206
229
|
|
207
230
|
def install_bundler
|
@@ -446,7 +469,7 @@ module Autoproj
|
|
446
469
|
|
447
470
|
def run_autoproj(*args)
|
448
471
|
system env_for_child.merge('BUNDLE_GEMFILE' => autoproj_gemfile_path),
|
449
|
-
Gem.ruby, autoproj_path, *args
|
472
|
+
Gem.ruby, autoproj_path, *args, *autoproj_options
|
450
473
|
end
|
451
474
|
|
452
475
|
def stage1
|
@@ -468,8 +491,10 @@ module Autoproj
|
|
468
491
|
require 'autobuild'
|
469
492
|
puts "saving env.sh and .autoproj/env.sh"
|
470
493
|
save_env_sh(*vars)
|
471
|
-
puts "calling autoproj envsh"
|
472
|
-
system(Gem.ruby, autoproj_path, 'envsh')
|
494
|
+
puts "calling autoproj envsh #{autoproj_options}"
|
495
|
+
if !system(Gem.ruby, autoproj_path, 'envsh', *autoproj_options)
|
496
|
+
exit 1
|
497
|
+
end
|
473
498
|
end
|
474
499
|
end
|
475
500
|
end
|
data/bin/autoproj_install.in
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
if RUBY_VERSION < "2.0.0"
|
4
4
|
STDERR.puts "autoproj requires Ruby >= 2.0.0"
|
5
5
|
exit 1
|
6
|
+
elsif ENV['AUTOPROJ_CURRENT_ROOT'] && (ENV['AUTOPROJ_CURRENT_ROOT'] != Dir.pwd)
|
7
|
+
STDERR.puts "it seems that you've already loaded an env.sh script in this console, open a new console and try again"
|
8
|
+
exit 1
|
6
9
|
end
|
7
10
|
|
8
11
|
AUTOPROJ_OPS_INSTALL
|
data/lib/autoproj/cli/base.rb
CHANGED
@@ -9,7 +9,7 @@ class Base
|
|
9
9
|
attr_reader :ws
|
10
10
|
|
11
11
|
def initialize(ws = nil)
|
12
|
-
@ws = (ws || Workspace.
|
12
|
+
@ws = (ws || Workspace.default)
|
13
13
|
end
|
14
14
|
|
15
15
|
# Normalizes the arguments given by the user on the command line
|
@@ -126,11 +126,14 @@ def self.validate_options(args, options)
|
|
126
126
|
silent: false,
|
127
127
|
verbose: false,
|
128
128
|
debug: false,
|
129
|
-
color:
|
130
|
-
progress:
|
129
|
+
color: TTY::Screen.color?,
|
130
|
+
progress: TTY::Screen.color?,
|
131
131
|
parallel: nil
|
132
132
|
|
133
133
|
Autoproj.silent = options[:silent]
|
134
|
+
Autobuild.color = options[:color]
|
135
|
+
Autobuild.progress_display_enabled = options[:progress]
|
136
|
+
|
134
137
|
if options[:verbose]
|
135
138
|
Autoproj.verbose = true
|
136
139
|
Autobuild.verbose = true
|
@@ -145,13 +148,12 @@ def self.validate_options(args, options)
|
|
145
148
|
Autobuild.debug = true
|
146
149
|
end
|
147
150
|
|
148
|
-
|
151
|
+
|
149
152
|
if level = options[:parallel]
|
150
153
|
Autobuild.parallel_build_level = Integer(level)
|
151
154
|
remaining[:parallel] = Integer(level)
|
152
155
|
end
|
153
156
|
|
154
|
-
Autobuild.progress_display_enabled = options[:progress]
|
155
157
|
return args, remaining
|
156
158
|
end
|
157
159
|
end
|
data/lib/autoproj/cli/main.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'thor'
|
2
|
+
require 'tty-screen'
|
2
3
|
require 'autoproj/cli/main_test'
|
3
4
|
|
4
5
|
module Autoproj
|
@@ -18,9 +19,12 @@ class Main < Thor
|
|
18
19
|
class_option :silent, type: :boolean,
|
19
20
|
desc: 'tell autoproj to not display anything',
|
20
21
|
default: false
|
22
|
+
class_option :color, type: :boolean,
|
23
|
+
desc: 'enables or disables colored display (enabled by default if the terminal supports it)',
|
24
|
+
default: TTY::Screen.color?
|
21
25
|
class_option :progress, type: :boolean,
|
22
|
-
desc: 'enables or disables progress display (enabled by default)',
|
23
|
-
default:
|
26
|
+
desc: 'enables or disables progress display (enabled by default if the terminal supports it)',
|
27
|
+
default: TTY::Screen.color?
|
24
28
|
|
25
29
|
no_commands do
|
26
30
|
def run_autoproj_cli(filename, classname, report_options, *args)
|
@@ -338,7 +342,14 @@ def upgrade
|
|
338
342
|
hide: true
|
339
343
|
def install_stage2(root_dir, *vars)
|
340
344
|
require 'autoproj/ops/install'
|
341
|
-
Autoproj::Ops::Install.new(root_dir)
|
345
|
+
ops = Autoproj::Ops::Install.new(root_dir)
|
346
|
+
if options[:color] then ops.autoproj_options << "--color"
|
347
|
+
else ops.autoproj_options << "--no-color"
|
348
|
+
end
|
349
|
+
if options[:progress] then ops.autoproj_options << "--progress"
|
350
|
+
else ops.autoproj_options << "--no-progress"
|
351
|
+
end
|
352
|
+
ops.stage2(*vars)
|
342
353
|
end
|
343
354
|
end
|
344
355
|
end
|
@@ -254,7 +254,7 @@ def validate_ruby_executable
|
|
254
254
|
if has_value_for?('ruby_executable')
|
255
255
|
expected = get('ruby_executable')
|
256
256
|
if expected != actual
|
257
|
-
raise ConfigError.new, "this autoproj installation was bootstrapped using #{expected}, but you are currently running under #{actual}.
|
257
|
+
raise ConfigError.new, "this autoproj installation was bootstrapped using #{expected}, but you are currently running under #{actual}. Changing the Ruby executable for in an existing autoproj workspace is unsupported"
|
258
258
|
end
|
259
259
|
else
|
260
260
|
set('ruby_executable', actual, true)
|
@@ -3,21 +3,21 @@
|
|
3
3
|
|
4
4
|
module Autoproj
|
5
5
|
# The base path from which we search for workspaces
|
6
|
-
def self.
|
6
|
+
def self.default_find_base_dir
|
7
7
|
ENV['AUTOPROJ_CURRENT_ROOT'] || Dir.pwd
|
8
8
|
end
|
9
9
|
|
10
10
|
# Looks for the autoproj workspace that is related to a given directory
|
11
11
|
#
|
12
12
|
# @return [String,nil]
|
13
|
-
def self.find_workspace_dir(base_dir =
|
13
|
+
def self.find_workspace_dir(base_dir = default_find_base_dir)
|
14
14
|
find_v2_workspace_dir(base_dir)
|
15
15
|
end
|
16
16
|
|
17
17
|
# Looks for the autoproj prefix that contains a given directory
|
18
18
|
#
|
19
19
|
# @return [String,nil]
|
20
|
-
def self.find_prefix_dir(base_dir =
|
20
|
+
def self.find_prefix_dir(base_dir = default_find_base_dir)
|
21
21
|
find_v2_prefix_dir(base_dir)
|
22
22
|
end
|
23
23
|
|
@@ -57,19 +57,19 @@ def self.find_v2_root_dir(base_dir, config_field_name)
|
|
57
57
|
end
|
58
58
|
|
59
59
|
# {#find_workspace_dir} for v2 workspaces
|
60
|
-
def self.find_v2_workspace_dir(base_dir =
|
60
|
+
def self.find_v2_workspace_dir(base_dir = default_find_base_dir)
|
61
61
|
find_v2_root_dir(base_dir, 'workspace')
|
62
62
|
end
|
63
63
|
|
64
64
|
# {#find_prefix_dir} for v2 workspaces
|
65
|
-
def self.find_v2_prefix_dir(base_dir =
|
65
|
+
def self.find_v2_prefix_dir(base_dir = default_find_base_dir)
|
66
66
|
find_v2_root_dir(base_dir, 'prefix')
|
67
67
|
end
|
68
68
|
|
69
69
|
# {#find_workspace_dir} for v1 workspaces
|
70
70
|
#
|
71
71
|
# Note that for v1 workspaces {#find_prefix_dir} cannot be implemented
|
72
|
-
def self.find_v1_workspace_dir(base_dir =
|
72
|
+
def self.find_v1_workspace_dir(base_dir = default_find_base_dir)
|
73
73
|
path = Pathname.new(base_dir)
|
74
74
|
while !path.root?
|
75
75
|
if (path + "autoproj").exist?
|
data/lib/autoproj/ops/install.rb
CHANGED
@@ -21,6 +21,9 @@ class UnexpectedBinstub < RuntimeError; end
|
|
21
21
|
attr_reader :env
|
22
22
|
# The configuration hash
|
23
23
|
attr_reader :config
|
24
|
+
# A set of options that should be passed to autoproj when calling it
|
25
|
+
# in a subprocess
|
26
|
+
attr_reader :autoproj_options
|
24
27
|
|
25
28
|
def initialize(root_dir)
|
26
29
|
@root_dir = root_dir
|
@@ -30,6 +33,8 @@ def initialize(root_dir)
|
|
30
33
|
@gemfile = default_gemfile_contents
|
31
34
|
end
|
32
35
|
|
36
|
+
@autoproj_options = Array.new
|
37
|
+
|
33
38
|
@env = Hash.new
|
34
39
|
env['RUBYLIB'] = []
|
35
40
|
env['GEM_PATH'] = []
|
@@ -38,6 +43,10 @@ def initialize(root_dir)
|
|
38
43
|
env['BUNDLE_GEMFILE'] = []
|
39
44
|
|
40
45
|
load_config
|
46
|
+
if config['ruby_executable'] != Gem.ruby
|
47
|
+
raise "this autoproj installation was already bootstrapped using #{config['ruby_executable']}, but you are currently running under #{Gem.ruby}. Changing the ruby interpreter in a given workspace is not supported"
|
48
|
+
end
|
49
|
+
|
41
50
|
@local = false
|
42
51
|
end
|
43
52
|
|
@@ -193,8 +202,19 @@ def parse_options(args = ARGV)
|
|
193
202
|
opt.on '--prefer-os-independent-packages', 'prefer OS-independent packages (such as a RubyGem) over their OS-packaged equivalent (e.g. the thor gem vs. the ruby-thor debian package)' do
|
194
203
|
@prefer_indep_over_os_packages = true
|
195
204
|
end
|
205
|
+
opt.on '--[no-]color', 'do not use colored output (enabled by default if the terminal supports it)' do |color|
|
206
|
+
if color then autoproj_options << "--color"
|
207
|
+
else autoproj_options << '--no-color'
|
208
|
+
end
|
209
|
+
end
|
210
|
+
opt.on '--[no-]progress', 'do not use progress output (enabled by default if the terminal supports it)' do |color|
|
211
|
+
if color then autoproj_options << "--progress"
|
212
|
+
else autoproj_options << '--no-progress'
|
213
|
+
end
|
214
|
+
end
|
196
215
|
end
|
197
|
-
options.parse(ARGV)
|
216
|
+
args = options.parse(ARGV)
|
217
|
+
autoproj_options + args
|
198
218
|
end
|
199
219
|
|
200
220
|
def install_bundler
|
@@ -439,7 +459,7 @@ def autoproj_path
|
|
439
459
|
|
440
460
|
def run_autoproj(*args)
|
441
461
|
system env_for_child.merge('BUNDLE_GEMFILE' => autoproj_gemfile_path),
|
442
|
-
Gem.ruby, autoproj_path, *args
|
462
|
+
Gem.ruby, autoproj_path, *args, *autoproj_options
|
443
463
|
end
|
444
464
|
|
445
465
|
def stage1
|
@@ -461,8 +481,10 @@ def stage2(*vars)
|
|
461
481
|
require 'autobuild'
|
462
482
|
puts "saving env.sh and .autoproj/env.sh"
|
463
483
|
save_env_sh(*vars)
|
464
|
-
puts "calling autoproj envsh"
|
465
|
-
system(Gem.ruby, autoproj_path, 'envsh')
|
484
|
+
puts "calling autoproj envsh #{autoproj_options}"
|
485
|
+
if !system(Gem.ruby, autoproj_path, 'envsh', *autoproj_options)
|
486
|
+
exit 1
|
487
|
+
end
|
466
488
|
end
|
467
489
|
end
|
468
490
|
end
|
data/lib/autoproj/version.rb
CHANGED
data/lib/autoproj/workspace.rb
CHANGED
@@ -53,11 +53,6 @@ def self.from_pwd
|
|
53
53
|
# @raise [NotWorkspace] if dir is not within an autoproj workspace
|
54
54
|
def self.from_dir(dir)
|
55
55
|
if path = Autoproj.find_workspace_dir(dir)
|
56
|
-
# Make sure that the currently loaded env.sh is actually us
|
57
|
-
env = autoproj_current_root
|
58
|
-
if env && env != path
|
59
|
-
raise MismatchingWorkspace, "the current environment is for #{env}, but you are in #{path}, make sure you are loading the right #{ENV_FILENAME} script !"
|
60
|
-
end
|
61
56
|
Workspace.new(path)
|
62
57
|
elsif find_v1_workspace_dir(dir)
|
63
58
|
raise OutdatedWorkspace, "#{dir} looks like a v1 workspace, run autoproj upgrade before continuing"
|
@@ -69,7 +64,9 @@ def self.from_dir(dir)
|
|
69
64
|
def self.from_environment
|
70
65
|
if path = Autoproj.find_workspace_dir
|
71
66
|
from_dir(path)
|
72
|
-
elsif
|
67
|
+
elsif envvar = ENV['AUTOPROJ_CURRENT_ROOT']
|
68
|
+
raise NotWorkspace, "AUTOPROJ_CURRENT_ROOT is currently set to #{envvar}, but that is not an Autoproj workspace"
|
69
|
+
elsif Autoproj.find_v1_workspace_dir(dir = Autoproj.default_find_base_dir)
|
73
70
|
raise OutdatedWorkspace, "#{dir} looks like a v1 workspace, run autoproj upgrade before continuing"
|
74
71
|
else
|
75
72
|
raise NotWorkspace, "not in an Autoproj installation, and no env.sh has been loaded so far"
|
@@ -82,6 +79,22 @@ def self.in_autoproj_project?(path)
|
|
82
79
|
!!Autoproj.find_workspace_dir(path)
|
83
80
|
end
|
84
81
|
|
82
|
+
# Returns the default workspace
|
83
|
+
#
|
84
|
+
# It uses the AUTOPROJ_CURRENT_ROOT environment variable if available,
|
85
|
+
# falling back to the current directory
|
86
|
+
#
|
87
|
+
# @raise MismatchingWorkspace if the workspace pointed by
|
88
|
+
# AUTOPROJ_CURRENT_ROOT does not match the one containing the current
|
89
|
+
# directory
|
90
|
+
def self.default
|
91
|
+
ws = from_environment
|
92
|
+
if (from_pwd = Autoproj.find_workspace_dir(Dir.pwd)) && (from_pwd != ws.root_dir)
|
93
|
+
raise MismatchingWorkspace, "the current environment points to #{ws.root_dir}, but you are in #{from_pwd}, make sure you are loading the right #{ENV_FILENAME} script !"
|
94
|
+
end
|
95
|
+
ws
|
96
|
+
end
|
97
|
+
|
85
98
|
def load(*args)
|
86
99
|
set_as_main_workspace
|
87
100
|
flag, Autoproj.warn_deprecated_level = Autoproj.warn_deprecated_level, 1
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autoproj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.rc12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
@@ -72,6 +72,20 @@ dependencies:
|
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: tty-screen
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 0.4.0
|
82
|
+
type: :runtime
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 0.4.0
|
75
89
|
- !ruby/object:Gem::Dependency
|
76
90
|
name: flexmock
|
77
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -273,9 +287,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
287
|
version: 1.3.1
|
274
288
|
requirements: []
|
275
289
|
rubyforge_project:
|
276
|
-
rubygems_version: 2.2.
|
290
|
+
rubygems_version: 2.2.2
|
277
291
|
signing_key:
|
278
292
|
specification_version: 4
|
279
293
|
summary: Easy installation and management of sets of software packages
|
280
294
|
test_files: []
|
281
|
-
has_rdoc:
|