autobuild 1.5.30 → 1.5.31

Sign up to get free protection for your applications and to get access to all the features.
data/Changes.txt CHANGED
@@ -1,3 +1,11 @@
1
+ == Version 1.5.31
2
+ * allow to override the type export policy for oroGen >= 1.1
3
+ * allow to provide CMAKE_MODULE_PATH in the cmake handler. Unfortunately, cmake
4
+ does not support setting this through environment variables, so we have to
5
+ pass it as -D
6
+ * make ignore_errors work for updates as well. We obviously still have to fail
7
+ on checkout
8
+
1
9
  == Version 1.5.30
2
10
  * make the autotools handler behave more normally, calling "configure" without
3
11
  --no-create and not calling config.status before make by default. The old
@@ -184,7 +184,12 @@ module Autobuild
184
184
  remote_commit = `git show-ref -s refs/heads/#{local_branch}`.chomp
185
185
  end
186
186
  else
187
- remote_commit = fetch_remote(package)
187
+ remote_commit =
188
+ begin fetch_remote(package)
189
+ rescue Exception => e
190
+ fallback(e, package, :status, package, only_local)
191
+ end
192
+
188
193
  if !remote_commit
189
194
  return
190
195
  end
@@ -197,6 +202,7 @@ module Autobuild
197
202
  end
198
203
  status
199
204
  end
205
+
200
206
  end
201
207
 
202
208
  # Checks if the current branch is the target branch. Expects that the
@@ -6,6 +6,29 @@ require 'autobuild/exceptions'
6
6
  # after the import can be given in the +:patches+ option.
7
7
  module Autobuild
8
8
  class Importer
9
+ # call-seq:
10
+ # Autobuild::Importer.fallback { |package, importer| ... }
11
+ #
12
+ # If called, registers the given block as a fallback mechanism for failing
13
+ # imports.
14
+ #
15
+ # Fallbacks are tried in reverse order with the failing importer object as
16
+ # argument. The first valid importer object that has been returned will be
17
+ # used instead.
18
+ #
19
+ # It is the responsibility of the fallback handler to make sure that it does
20
+ # not do infinite recursions and stuff like that.
21
+ def self.fallback(&block)
22
+ @fallback_handlers.unshift(block)
23
+ end
24
+
25
+ class << self
26
+ # The set of handlers registered by Importer.fallback
27
+ attr_reader :fallback_handlers
28
+ end
29
+
30
+ @fallback_handlers = Array.new
31
+
9
32
  # Instances of the Importer::Status class represent the status of a current
10
33
  # checkout w.r.t. the remote repository.
11
34
  class Status
@@ -58,16 +81,22 @@ class Importer
58
81
  def import(package)
59
82
  srcdir = package.srcdir
60
83
  if File.directory?(srcdir)
61
- if Autobuild.do_update
62
- package.progress "updating %s"
63
- update(package)
64
- patch(package)
65
- package.updated = true
66
- else
67
- if Autobuild.verbose
68
- puts " not updating #{package.name}"
69
- end
70
- return
84
+ package.isolate_errors(false) do
85
+ if Autobuild.do_update
86
+ package.progress "updating %s"
87
+ begin
88
+ update(package)
89
+ patch(package)
90
+ package.updated = true
91
+ rescue Exception => e
92
+ fallback(e, package, :import, package)
93
+ end
94
+ else
95
+ if Autobuild.verbose
96
+ puts " not updating #{package.name}"
97
+ end
98
+ return
99
+ end
71
100
  end
72
101
 
73
102
  elsif File.exists?(srcdir)
@@ -78,11 +107,26 @@ class Importer
78
107
  checkout(package)
79
108
  patch(package)
80
109
  package.updated = true
81
- rescue Autobuild::Exception
110
+ rescue Autobuild::Exception => e
111
+ FileUtils.rm_rf package.srcdir
112
+ fallback(e, package, :import, package)
113
+ rescue Exception
82
114
  FileUtils.rm_rf package.srcdir
83
115
  raise
84
116
  end
85
117
  end
118
+
119
+ end
120
+
121
+ # Tries to find a fallback importer because of the given error.
122
+ def fallback(error, package, *args, &block)
123
+ Importer.fallback_handlers.each do |handler|
124
+ fallback_importer = handler.call(package, self)
125
+ if fallback_importer.kind_of?(Importer)
126
+ return fallback_importer.send(*args, &block)
127
+ end
128
+ end
129
+ raise error
86
130
  end
87
131
 
88
132
  private
@@ -106,6 +106,7 @@ module Autobuild
106
106
  @provides = Array.new
107
107
  @parallel_build_level = nil
108
108
  @statistics = Hash.new
109
+ @failures = Array.new
109
110
 
110
111
  if Hash === spec
111
112
  name, depends = spec.to_a.first
@@ -173,12 +174,12 @@ module Autobuild
173
174
 
174
175
  # Returns true if one of the operations applied on this package failed
175
176
  def failed?
176
- !!@failure
177
+ @failed
177
178
  end
178
179
 
179
180
  # If something failed on this package, returns the corresponding
180
181
  # exception object. Otherwise, returns nil
181
- attr_reader :failure
182
+ attr_reader :failures
182
183
 
183
184
  # If Autobuild.ignore_errors is set, an exception raised from within the
184
185
  # provided block will be filtered out, only displaying a message instead
@@ -187,13 +188,16 @@ module Autobuild
187
188
  # Moreover, the package will be marked as "failed" and isolate_errors
188
189
  # will subsequently be a noop. I.e. if +build+ fails, +install+ will do
189
190
  # nothing.
190
- def isolate_errors
191
+ def isolate_errors(mark_as_failed = true)
191
192
  # Don't do anything if we already have failed
192
193
  return if failed?
193
194
 
194
195
  begin yield
195
196
  rescue Exception => e
196
- @failure = e
197
+ @failures << e
198
+ if mark_as_failed
199
+ @failed = true
200
+ end
197
201
 
198
202
  if Autobuild.ignore_errors
199
203
  lines = e.to_s.split("\n")
@@ -18,7 +18,10 @@ module Autobuild
18
18
  def full_reconfigures?
19
19
  @full_reconfigures
20
20
  end
21
+
22
+ attr_reader :module_path
21
23
  end
24
+ @module_path = []
22
25
  @full_reconfigures = true
23
26
 
24
27
  # a key => value association of defines for CMake
@@ -114,6 +117,7 @@ module Autobuild
114
117
  if File.exists?(cmake_cache)
115
118
  all_defines = defines.dup
116
119
  all_defines['CMAKE_INSTALL_PREFIX'] = prefix
120
+ all_defines['CMAKE_MODULE_PATH'] = "#{CMake.module_path.join(";")}"
117
121
  cache = File.read(cmake_cache)
118
122
  did_change = all_defines.any? do |name, value|
119
123
  cache_line = cache.each_line.find do |line|
@@ -154,7 +158,8 @@ module Autobuild
154
158
  raise ConfigException, "#{srcdir} contains no CMakeLists.txt file"
155
159
  end
156
160
 
157
- command = [ "cmake", "-DCMAKE_INSTALL_PREFIX=#{prefix}" ]
161
+ command = [ "cmake", "-DCMAKE_INSTALL_PREFIX=#{prefix}", "-DCMAKE_MODULE_PATH=#{CMake.module_path.join(";")}" ]
162
+
158
163
  defines.each do |name, value|
159
164
  command << "-D#{name}=#{value}"
160
165
  end
@@ -165,6 +165,11 @@ module Autobuild
165
165
  end
166
166
  end
167
167
 
168
+ class << self
169
+ attr_accessor :default_type_export_policy
170
+ end
171
+ @default_type_export_policy = :used
172
+
168
173
  def self.orogen_bin
169
174
  if @orogen_bin
170
175
  @orogen_bin
@@ -319,8 +324,13 @@ module Autobuild
319
324
  end
320
325
  cmdline << orogen_file
321
326
 
322
- if (version = Orogen.orogen_version) && (version >= "1.0")
323
- cmdline << "--parallel-build=#{parallel_build_level}"
327
+ if (version = Orogen.orogen_version)
328
+ if version >= "1.0"
329
+ cmdline << "--parallel-build=#{parallel_build_level}"
330
+ end
331
+ if version >= "1.1"
332
+ cmdline << "--type-export-policy=#{Orogen.default_type_export_policy}"
333
+ end
324
334
  end
325
335
 
326
336
  progress "generating oroGen project %s"
@@ -83,7 +83,7 @@ module Autobuild
83
83
  errors = []
84
84
  Autobuild::Package.each do |name, pkg|
85
85
  if pkg.failed?
86
- errors << pkg.failure
86
+ errors.concat(pkg.failures)
87
87
  end
88
88
  end
89
89
 
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.5.30" unless defined? Autobuild::VERSION
2
+ VERSION = "1.5.31" unless defined? Autobuild::VERSION
3
3
  end
4
4
 
5
5
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autobuild
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 30
10
- version: 1.5.30
9
+ - 31
10
+ version: 1.5.31
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sylvain Joyeux
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-09 00:00:00 +01:00
18
+ date: 2011-01-04 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -81,37 +81,21 @@ dependencies:
81
81
  type: :runtime
82
82
  version_requirements: *id004
83
83
  - !ruby/object:Gem::Dependency
84
- name: rubyforge
84
+ name: hoe
85
85
  prerelease: false
86
86
  requirement: &id005 !ruby/object:Gem::Requirement
87
87
  none: false
88
88
  requirements:
89
89
  - - ">="
90
90
  - !ruby/object:Gem::Version
91
- hash: 7
91
+ hash: 47
92
92
  segments:
93
93
  - 2
94
+ - 8
94
95
  - 0
95
- - 4
96
- version: 2.0.4
96
+ version: 2.8.0
97
97
  type: :development
98
98
  version_requirements: *id005
99
- - !ruby/object:Gem::Dependency
100
- name: hoe
101
- prerelease: false
102
- requirement: &id006 !ruby/object:Gem::Requirement
103
- none: false
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- hash: 19
108
- segments:
109
- - 2
110
- - 7
111
- - 0
112
- version: 2.7.0
113
- type: :development
114
- version_requirements: *id006
115
99
  description: |-
116
100
  This work is licensed under the GPLv2 license. See License.txt for details
117
101