autoproj 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ = Version 1.1.2
2
+ * fix version detection on Debian, lsb-release cannot be trusted there.
3
+ * update already installed Gem
4
+ * update autobuild and autoproj themselves if needed
5
+
1
6
  = Version 1.1.1
2
7
  * better general error reporting
3
8
  * small fixes w.r.t. bootstrapping
data/Rakefile CHANGED
@@ -25,6 +25,16 @@ begin
25
25
  ['rdoc', '>= 2.4.0']
26
26
  end
27
27
 
28
+ Rake.clear_tasks(/dist:publish_docs/)
29
+ task 'publish_docs' => 'doc' do
30
+ if !system('doc/update_github')
31
+ raise "cannot update the gh-pages branch for GitHub"
32
+ end
33
+ if !system('git', 'push', 'origin', 'gh-pages')
34
+ raise "cannot push the documentation"
35
+ end
36
+ end
37
+
28
38
  desc "generate the bootstrap script"
29
39
  task 'bootstrap' do
30
40
  osdeps_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'osdeps.rb'))
data/bin/autoproj CHANGED
@@ -297,6 +297,13 @@ begin
297
297
  Autobuild::Reporting << MailReporter.new(mail_config)
298
298
  end
299
299
 
300
+ # First things first, see if we need to update ourselves
301
+ osdeps = Autoproj::OSDependencies.load_default
302
+ if osdeps.install(%w{autobuild autoproj})
303
+ # We updated autobuild or autoproj themselves ... Restart !
304
+ exec($0, *ARGV)
305
+ end
306
+
300
307
  manifest_path = File.join(Autoproj.config_dir, 'manifest')
301
308
  # Load the installation's manifest a first time, to check if we should
302
309
  # update it ... We assume that the OS dependencies for this VCS is already
@@ -63,8 +63,14 @@ module Autoproj
63
63
  if @operating_system
64
64
  return @operating_system
65
65
  elsif data = os_from_lsb
66
- @operating_system = data
67
- else
66
+ if data[0] != "debian"
67
+ # Fall back to reading debian_version, as
68
+ # sid is listed as lenny by lsb-release
69
+ @operating_system = data
70
+ end
71
+ end
72
+
73
+ if !@operating_system
68
74
  # Need to do some heuristics unfortunately
69
75
  @operating_system =
70
76
  if File.exists?('/etc/debian_version')
@@ -84,9 +90,9 @@ module Autoproj
84
90
  def os_from_lsb
85
91
  distributor = `lsb_release -i -s`
86
92
  return unless $?.success?
87
- distributor = distributor.chomp
88
- codename = `lsb_release -c -s`.chomp
89
- version = `lsb_release -r -s`.chomp
93
+ distributor = distributor.chomp.downcase
94
+ codename = `lsb_release -c -s`.chomp.downcase
95
+ version = `lsb_release -r -s`.chomp.downcase
90
96
 
91
97
  return [distributor, [codename, version]]
92
98
  end
@@ -184,6 +190,8 @@ module Autoproj
184
190
  def install(packages)
185
191
  osdeps, gems = partition_packages(packages)
186
192
 
193
+ did_something = false
194
+
187
195
  # Ideally, we would feed the OS dependencies to rosdep.
188
196
  # Unfortunately, this is C++ code and I don't want to install the
189
197
  # whole ROS stack just for rosdep ...
@@ -200,18 +208,31 @@ module Autoproj
200
208
  File.open('osdeps.sh', 'w') do |file|
201
209
  file.write shell_script
202
210
  end
211
+ Autobuild.progress "installing/updating OS dependencies: #{osdeps.join(", ")}"
203
212
  begin
204
213
  Autobuild::Subprocess.run 'autoproj', 'osdeps', 'bash', './osdeps.sh'
205
214
  ensure
206
215
  FileUtils.rm_f 'osdeps.sh'
207
216
  end
217
+ did_something ||= true
208
218
  end
209
219
 
210
220
  # Don't install gems that are already there ...
211
221
  gems.delete_if do |name|
212
222
  version_requirements = Gem::Requirement.default
213
- available = Gem.source_index.find_name(name, version_requirements)
214
- !available.empty?
223
+ installed = Gem.source_index.find_name(name, version_requirements)
224
+ if !installed.empty? && Autobuild.do_update
225
+ # Look if we can update the package ...
226
+ dep = Gem::Dependency.new(name, version_requirements)
227
+ remote = Gem::SpecFetcher.fetcher
228
+ available = remote.find_matching(dep)
229
+ installed_version = installed.map(&:version).max
230
+ available_version = available.map { |(name, v), source| v }.max
231
+ needs_update = (available_version > installed_version)
232
+ !needs_update
233
+ else
234
+ !installed.empty?
235
+ end
215
236
  end
216
237
 
217
238
  # Now install what is left
@@ -220,8 +241,12 @@ module Autoproj
220
241
  STDERR.puts "Installing rubygems dependencies with"
221
242
  STDERR.puts "gem install #{gems.join(" ")}"
222
243
  end
244
+ Autobuild.progress "installing/updating RubyGems dependencies: #{gems.join(", ")}"
223
245
  Autobuild::Subprocess.run 'autoproj', 'osdeps', 'gem', 'install', *gems
246
+ did_something ||= true
224
247
  end
248
+
249
+ did_something
225
250
  end
226
251
  end
227
252
  end
@@ -232,45 +257,46 @@ DEFS = <<EODEFS
232
257
  # The following definitions are needed to bootstrap autoproj
233
258
  ruby:
234
259
  debian,ubuntu:
235
- 9.04,lenny:
260
+ 9.04,squeeze/sid:
236
261
  - ruby1.8-dev
237
262
  - ruby1.8
238
263
  - libopenssl-ruby1.8
239
264
 
240
265
  build-essential:
241
266
  debian,ubuntu:
242
- 9.04,lenny: build-essential
267
+ 9.04,squeeze/sid: build-essential
243
268
 
244
269
  libxml2:
245
270
  debian,ubuntu:
246
- 9.04,lenny: libxml2-dev
271
+ 9.04,squeeze/sid: libxml2-dev
247
272
  libxslt:
248
273
  debian,ubuntu:
249
- 9.04,lenny: libxslt1-dev
274
+ 9.04,squeeze/sid: libxslt1-dev
250
275
 
276
+ autobuild: gem
251
277
  autoproj: gem
252
278
 
253
279
  # The following definitions are for the VCS and build systems
254
280
  git:
255
- debian,ubuntu:
256
- 9.04,lenny: git-core
281
+ debian,ubuntu: git-core
257
282
 
258
283
  svn:
259
- debian,ubuntu:
260
- 9.04,lenny: svn
284
+ debian,ubuntu: svn
261
285
 
262
286
  cmake:
263
- debian,ubuntu:
264
- 9.04,lenny: cmake
287
+ debian,ubuntu: cmake
265
288
 
266
289
  autotools:
267
- debian,ubuntu:
268
- 9.04,lenny: [automake1.9, autoconf]
290
+ debian,ubuntu: [automake1.9, autoconf]
291
+
292
+ lsb_release:
293
+ debian,ubuntu: lsb-release
294
+
269
295
 
270
296
 
271
297
  EODEFS
272
298
 
273
- PACKAGES = %w{ruby libxml2 libxslt build-essential}
299
+ PACKAGES = %w{ruby libxml2 libxslt build-essential lsb_release}
274
300
  USER_PACKAGES = %w{autoproj}
275
301
 
276
302
  packages = PACKAGES.dup
@@ -1,38 +1,39 @@
1
1
  # The following definitions are needed to bootstrap autoproj
2
2
  ruby:
3
3
  debian,ubuntu:
4
- 9.04,lenny:
4
+ 9.04,squeeze/sid:
5
5
  - ruby1.8-dev
6
6
  - ruby1.8
7
7
  - libopenssl-ruby1.8
8
8
 
9
9
  build-essential:
10
10
  debian,ubuntu:
11
- 9.04,lenny: build-essential
11
+ 9.04,squeeze/sid: build-essential
12
12
 
13
13
  libxml2:
14
14
  debian,ubuntu:
15
- 9.04,lenny: libxml2-dev
15
+ 9.04,squeeze/sid: libxml2-dev
16
16
  libxslt:
17
17
  debian,ubuntu:
18
- 9.04,lenny: libxslt1-dev
18
+ 9.04,squeeze/sid: libxslt1-dev
19
19
 
20
+ autobuild: gem
20
21
  autoproj: gem
21
22
 
22
23
  # The following definitions are for the VCS and build systems
23
24
  git:
24
- debian,ubuntu:
25
- 9.04,lenny: git-core
25
+ debian,ubuntu: git-core
26
26
 
27
27
  svn:
28
- debian,ubuntu:
29
- 9.04,lenny: svn
28
+ debian,ubuntu: svn
30
29
 
31
30
  cmake:
32
- debian,ubuntu:
33
- 9.04,lenny: cmake
31
+ debian,ubuntu: cmake
34
32
 
35
33
  autotools:
36
- debian,ubuntu:
37
- 9.04,lenny: [automake1.9, autoconf]
34
+ debian,ubuntu: [automake1.9, autoconf]
35
+
36
+ lsb_release:
37
+ debian,ubuntu: lsb-release
38
+
38
39
 
@@ -29,8 +29,14 @@ module Autoproj
29
29
  if @operating_system
30
30
  return @operating_system
31
31
  elsif data = os_from_lsb
32
- @operating_system = data
33
- else
32
+ if data[0] != "debian"
33
+ # Fall back to reading debian_version, as
34
+ # sid is listed as lenny by lsb-release
35
+ @operating_system = data
36
+ end
37
+ end
38
+
39
+ if !@operating_system
34
40
  # Need to do some heuristics unfortunately
35
41
  @operating_system =
36
42
  if File.exists?('/etc/debian_version')
@@ -50,9 +56,9 @@ module Autoproj
50
56
  def os_from_lsb
51
57
  distributor = `lsb_release -i -s`
52
58
  return unless $?.success?
53
- distributor = distributor.chomp
54
- codename = `lsb_release -c -s`.chomp
55
- version = `lsb_release -r -s`.chomp
59
+ distributor = distributor.chomp.downcase
60
+ codename = `lsb_release -c -s`.chomp.downcase
61
+ version = `lsb_release -r -s`.chomp.downcase
56
62
 
57
63
  return [distributor, [codename, version]]
58
64
  end
@@ -150,6 +156,8 @@ module Autoproj
150
156
  def install(packages)
151
157
  osdeps, gems = partition_packages(packages)
152
158
 
159
+ did_something = false
160
+
153
161
  # Ideally, we would feed the OS dependencies to rosdep.
154
162
  # Unfortunately, this is C++ code and I don't want to install the
155
163
  # whole ROS stack just for rosdep ...
@@ -166,18 +174,31 @@ module Autoproj
166
174
  File.open('osdeps.sh', 'w') do |file|
167
175
  file.write shell_script
168
176
  end
177
+ Autobuild.progress "installing/updating OS dependencies: #{osdeps.join(", ")}"
169
178
  begin
170
179
  Autobuild::Subprocess.run 'autoproj', 'osdeps', 'bash', './osdeps.sh'
171
180
  ensure
172
181
  FileUtils.rm_f 'osdeps.sh'
173
182
  end
183
+ did_something ||= true
174
184
  end
175
185
 
176
186
  # Don't install gems that are already there ...
177
187
  gems.delete_if do |name|
178
188
  version_requirements = Gem::Requirement.default
179
- available = Gem.source_index.find_name(name, version_requirements)
180
- !available.empty?
189
+ installed = Gem.source_index.find_name(name, version_requirements)
190
+ if !installed.empty? && Autobuild.do_update
191
+ # Look if we can update the package ...
192
+ dep = Gem::Dependency.new(name, version_requirements)
193
+ remote = Gem::SpecFetcher.fetcher
194
+ available = remote.find_matching(dep)
195
+ installed_version = installed.map(&:version).max
196
+ available_version = available.map { |(name, v), source| v }.max
197
+ needs_update = (available_version > installed_version)
198
+ !needs_update
199
+ else
200
+ !installed.empty?
201
+ end
181
202
  end
182
203
 
183
204
  # Now install what is left
@@ -186,8 +207,12 @@ module Autoproj
186
207
  STDERR.puts "Installing rubygems dependencies with"
187
208
  STDERR.puts "gem install #{gems.join(" ")}"
188
209
  end
210
+ Autobuild.progress "installing/updating RubyGems dependencies: #{gems.join(", ")}"
189
211
  Autobuild::Subprocess.run 'autoproj', 'osdeps', 'gem', 'install', *gems
212
+ did_something ||= true
190
213
  end
214
+
215
+ did_something
191
216
  end
192
217
  end
193
218
  end
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
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: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-16 00:00:00 +02:00
12
+ date: 2009-10-20 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency