autoproj 1.9.4 → 1.9.5.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -116,10 +116,6 @@ module Autoproj
116
116
  File.join(root_dir, ".remotes")
117
117
  end
118
118
 
119
- # Return the directory in which RubyGems package should be installed
120
- def self.gem_home
121
- ENV['AUTOPROJ_GEM_HOME'] || File.join(root_dir, ".gems")
122
- end
123
119
 
124
120
  def self.env_inherit(*names)
125
121
  Autobuild.env_inherit(*names)
@@ -135,15 +131,30 @@ module Autoproj
135
131
  File.join(result, name)
136
132
  end
137
133
 
134
+ # @deprecated use isolate_environment instead
135
+ def self.set_initial_env
136
+ isolate_environment
137
+ end
138
+
138
139
  # Initializes the environment variables to a "sane default"
139
140
  #
140
141
  # Use this in autoproj/init.rb to make sure that the environment will not
141
142
  # get polluted during the build.
142
- def self.set_initial_env
143
+ def self.isolate_environment
143
144
  Autobuild.env_inherit = false
144
- Autoproj.env_set 'RUBYOPT', "-rubygems"
145
- Autobuild.env_push_path 'GEM_PATH', Autoproj.gem_home
146
- Autobuild.env_push_path 'PATH', "#{Autoproj.gem_home}/bin", "/usr/local/bin", "/usr/bin", "/bin"
145
+ Autobuild.env_push_path 'PATH', "/usr/local/bin", "/usr/bin", "/bin"
146
+ end
147
+
148
+ def self.prepare_environment
149
+ # Set up some important autobuild parameters
150
+ env_inherit 'PATH', 'PKG_CONFIG_PATH', 'RUBYLIB', \
151
+ 'LD_LIBRARY_PATH', 'CMAKE_PREFIX_PATH', 'PYTHONPATH'
152
+
153
+ env_set 'AUTOPROJ_CURRENT_ROOT', Autoproj.root_dir
154
+ env_set 'RUBYOPT', "-rubygems"
155
+ Autoproj::OSDependencies::PACKAGE_HANDLERS.each do |pkg_mng|
156
+ pkg_mng.initialize_environment
157
+ end
147
158
  end
148
159
 
149
160
  class << self
@@ -154,10 +165,8 @@ module Autoproj
154
165
 
155
166
  # Create the env.sh script in +subdir+. In general, +subdir+ should be nil.
156
167
  def self.export_env_sh(subdir = nil)
157
- # Make sure that we have the environment of all selected packages
158
- if Autoproj.manifest # we don't have a manifest if we are bootstrapping
159
- Autoproj::CmdLine.update_environment
160
- end
168
+ # Make sure that we have as much environment as possible
169
+ Autoproj::CmdLine.update_environment
161
170
 
162
171
  filename = if subdir
163
172
  File.join(Autoproj.root_dir, subdir, ENV_FILENAME)
@@ -180,10 +189,13 @@ module Autoproj
180
189
  end
181
190
 
182
191
  File.open(filename, "w") do |io|
192
+ io.write <<-EOF
193
+ if test -n "$AUTOPROJ_CURRENT_ROOT" && test "$AUTOPROJ_CURRENT_ROOT" != "#{Autoproj.root_dir}"; then
194
+ echo "the env.sh from $AUTOPROJ_CURRENT_ROOT is already loaded. Start a new shell before sourcing this one"
195
+ return
196
+ fi
197
+ EOF
183
198
  Autobuild.export_env_sh(io)
184
- if Autobuild.environment.has_key?('GEM_PATH')
185
- io.puts "export GEM_PATH=$GEM_PATH:#{Gem.default_path.join(":")}"
186
- end
187
199
  end
188
200
  end
189
201
 
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "1.9.4"
2
+ VERSION = "1.9.5.rc1"
3
3
  end
@@ -0,0 +1,42 @@
1
+ $LOAD_PATH.unshift File.expand_path('../lib', File.dirname(__FILE__))
2
+ require 'test/unit'
3
+ require 'autoproj'
4
+ require 'flexmock/test_unit'
5
+
6
+ class TC_OSDependencies_Pip < Test::Unit::TestCase
7
+ include Autoproj
8
+
9
+ attr_reader :pip_manager
10
+
11
+ def setup
12
+ Autoproj::OSDependencies.operating_system = [['test', 'debian', 'default'], ['v1.0', 'v1', 'default']]
13
+
14
+ @pip_manager = PackageManagers::PipManager.new
15
+ Autobuild.programs['pip'] = 'mypip'
16
+ super
17
+ end
18
+
19
+ def teardown
20
+ super
21
+ Autobuild.programs['pip'] = nil
22
+ end
23
+
24
+ def test_install_packages
25
+ subprocess = flexmock(Autobuild::Subprocess)
26
+
27
+ packages = ['pkg0', 'pkg1', 'pkg2']
28
+ subprocess.should_receive(:run).
29
+ with(any, any, 'mypip', 'install', '--user', 'pkg0', 'pkg1','pkg2').once
30
+ pip_manager.install(packages)
31
+ end
32
+
33
+ def test_install_packaes_disabled_and_not_silent
34
+ subprocess = flexmock(Autobuild::Subprocess)
35
+
36
+ pip_manager.enabled = false
37
+ pip_manager.silent = false
38
+ subprocess.should_receive(:run).never
39
+ flexmock(STDIN).should_receive(:readline).once.and_return
40
+ pip_manager.install([['pkg0']])
41
+ end
42
+ end
@@ -29,6 +29,7 @@ class TC_OSDependencies < Test::Unit::TestCase
29
29
  osdeps.package_handlers.clear
30
30
  osdeps.package_handlers['apt-dpkg'] = osdeps.os_package_handler
31
31
  osdeps.package_handlers['gem'] = flexmock(PackageManagers::Manager.new(['gem']))
32
+ osdeps.package_handlers['pip'] = flexmock(PackageManagers::Manager.new(['pip']))
32
33
  flexmock(osdeps)
33
34
  end
34
35
 
@@ -311,6 +312,11 @@ class TC_OSDependencies < Test::Unit::TestCase
311
312
  osdeps = create_osdep(data)
312
313
  expected = [[osdeps.package_handlers['gem'], FOUND_PACKAGES, ['gempkg', 'gempkg1']]]
313
314
  assert_equal expected, osdeps.resolve_package('pkg')
315
+
316
+ data = { 'pkg' => 'pip' }
317
+ osdeps = create_osdep(data)
318
+ expected = [[osdeps.package_handlers['pip'], FOUND_PACKAGES, ['pkg']]]
319
+ assert_equal expected, osdeps.resolve_package('pkg')
314
320
  end
315
321
 
316
322
  def test_resolve_osindep_packages_specific
@@ -344,7 +350,7 @@ class TC_OSDependencies < Test::Unit::TestCase
344
350
 
345
351
  def test_resolve_mixed_os_and_osindep_dependencies
346
352
  data = { 'pkg' =>
347
- { 'test' => { 'default' => ['ospkg', 'gem' => 'gempkg'] }
353
+ { 'test' => { 'default' => 'ospkg', 'gem' => 'gempkg' }
348
354
  }
349
355
  }
350
356
 
metadata CHANGED
@@ -1,101 +1,105 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: autoproj
3
- version: !ruby/object:Gem::Version
4
- version: 1.9.4
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ hash: 1083816473
5
+ prerelease: 6
6
+ segments:
7
+ - 1
8
+ - 9
9
+ - 5
10
+ - rc
11
+ - 1
12
+ version: 1.9.5.rc1
6
13
  platform: ruby
7
- authors:
14
+ authors:
8
15
  - Rock Core Developers
9
16
  autorequire:
10
17
  bindir: bin
11
18
  cert_chain: []
12
- date: 2013-07-15 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
19
+
20
+ date: 2013-07-26 00:00:00 Z
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
15
23
  name: autobuild
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: 1.7.0
22
- type: :runtime
23
24
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
+ requirement: &id001 !ruby/object:Gem::Requirement
25
26
  none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ hash: 11
31
+ segments:
32
+ - 1
33
+ - 7
34
+ - 0
29
35
  version: 1.7.0
30
- - !ruby/object:Gem::Dependency
31
- name: utilrb
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: 1.6.0
38
36
  type: :runtime
37
+ version_requirements: *id001
38
+ - !ruby/object:Gem::Dependency
39
+ name: utilrb
39
40
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
+ requirement: &id002 !ruby/object:Gem::Requirement
41
42
  none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ hash: 15
47
+ segments:
48
+ - 1
49
+ - 6
50
+ - 0
45
51
  version: 1.6.0
46
- - !ruby/object:Gem::Dependency
47
- name: highline
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: 1.5.0
54
52
  type: :runtime
53
+ version_requirements: *id002
54
+ - !ruby/object:Gem::Dependency
55
+ name: highline
55
56
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
+ requirement: &id003 !ruby/object:Gem::Requirement
57
58
  none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ hash: 3
63
+ segments:
64
+ - 1
65
+ - 5
66
+ - 0
61
67
  version: 1.5.0
62
- - !ruby/object:Gem::Dependency
68
+ type: :runtime
69
+ version_requirements: *id003
70
+ - !ruby/object:Gem::Dependency
63
71
  name: rdoc
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ~>
68
- - !ruby/object:Gem::Version
69
- version: '4.0'
70
- type: :development
71
72
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ~>
76
- - !ruby/object:Gem::Version
77
- version: '4.0'
78
- - !ruby/object:Gem::Dependency
79
- name: hoe
80
- requirement: !ruby/object:Gem::Requirement
73
+ requirement: &id004 !ruby/object:Gem::Requirement
81
74
  none: false
82
- requirements:
75
+ requirements:
83
76
  - - ~>
84
- - !ruby/object:Gem::Version
85
- version: '3.6'
77
+ - !ruby/object:Gem::Version
78
+ hash: 27
79
+ segments:
80
+ - 4
81
+ - 0
82
+ version: "4.0"
86
83
  type: :development
84
+ version_requirements: *id004
85
+ - !ruby/object:Gem::Dependency
86
+ name: hoe
87
87
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
88
+ requirement: &id005 !ruby/object:Gem::Requirement
89
89
  none: false
90
- requirements:
90
+ requirements:
91
91
  - - ~>
92
- - !ruby/object:Gem::Version
93
- version: '3.6'
94
- description: autoproj is a manager for sets of software packages. It allows the user
95
- to import and build packages from source, still using the underlying distribution's
96
- native package manager for software that is available on it.
92
+ - !ruby/object:Gem::Version
93
+ hash: 9
94
+ segments:
95
+ - 3
96
+ - 7
97
+ version: "3.7"
98
+ type: :development
99
+ version_requirements: *id005
100
+ description: autoproj is a manager for sets of software packages. It allows the user to import and build packages from source, still using the underlying distribution's native package manager for software that is available on it.
97
101
  email: rock-dev@dfki.de
98
- executables:
102
+ executables:
99
103
  - alocate
100
104
  - amake
101
105
  - aup
@@ -113,12 +117,13 @@ executables:
113
117
  - autoproj_bootstrap.in
114
118
  - autoproj_stress_test
115
119
  extensions: []
116
- extra_rdoc_files:
120
+
121
+ extra_rdoc_files:
117
122
  - History.txt
118
123
  - Manifest.txt
119
124
  - README.txt
120
125
  - samples/autoproj/README.txt
121
- files:
126
+ files:
122
127
  - History.txt
123
128
  - Manifest.txt
124
129
  - README.txt
@@ -176,37 +181,49 @@ files:
176
181
  - test/test_manifest.rb
177
182
  - test/test_os_dependencies.rb
178
183
  - test/test_package_manifest.rb
184
+ - test/package_managers/test_pip.rb
179
185
  - .gemtest
180
186
  homepage: http://rock-robotics.org/documentation/autoproj
181
- licenses: []
187
+ licenses:
188
+ - MIT
182
189
  post_install_message:
183
- rdoc_options:
190
+ rdoc_options:
184
191
  - --main
185
192
  - README.txt
186
- require_paths:
193
+ require_paths:
187
194
  - lib
188
- required_ruby_version: !ruby/object:Gem::Requirement
195
+ required_ruby_version: !ruby/object:Gem::Requirement
189
196
  none: false
190
- requirements:
191
- - - ! '>='
192
- - !ruby/object:Gem::Version
193
- version: '0'
194
- required_rubygems_version: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ hash: 3
201
+ segments:
202
+ - 0
203
+ version: "0"
204
+ required_rubygems_version: !ruby/object:Gem::Requirement
195
205
  none: false
196
- requirements:
197
- - - ! '>='
198
- - !ruby/object:Gem::Version
199
- version: '0'
206
+ requirements:
207
+ - - ">"
208
+ - !ruby/object:Gem::Version
209
+ hash: 25
210
+ segments:
211
+ - 1
212
+ - 3
213
+ - 1
214
+ version: 1.3.1
200
215
  requirements: []
216
+
201
217
  rubyforge_project: autobuild
202
- rubygems_version: 1.8.23
218
+ rubygems_version: 1.8.24
203
219
  signing_key:
204
220
  specification_version: 3
205
221
  summary: Easy installation and management of sets of software packages
206
- test_files:
207
- - test/test_os_dependencies.rb
208
- - test/test_debian.rb
222
+ test_files:
209
223
  - test/test_manifest.rb
210
224
  - test/package_managers/test_apt_dpkg_manager.rb
211
225
  - test/package_managers/test_gem.rb
226
+ - test/package_managers/test_pip.rb
227
+ - test/test_debian.rb
212
228
  - test/test_package_manifest.rb
229
+ - test/test_os_dependencies.rb