autobuild 1.7.12.rc2 → 1.7.12.rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8234de2ac14d70f6a0ba20323e943201239e53f6
4
- data.tar.gz: a88615940aa5ef63a19453dae31428cafecc1094
3
+ metadata.gz: a04618bec2f92c5374c80a7166bdb174144169de
4
+ data.tar.gz: 5c17a0d85b9f02af76105a7c143588d8a9e9da97
5
5
  SHA512:
6
- metadata.gz: 421bb6eb83d12e2b506e1e32418cf86e54c182b2f34eaf3a4be170d1dad7500853766d1b3cdb43ccc0273aa60986b9b48b6b73b0df661f32eb13efe3ce490d25
7
- data.tar.gz: 96d4d1d69a2c084d6fb056508c9d099a4a8e56f55ab39e52aff63314aca44925a6b740e96166e8e9b22d54d7624e609e54414862292eefb6505c07e01c7dacf0
6
+ metadata.gz: 4f6feaf5fcbfc5fcb55c4bbe64e424cbfeec1e54a597d0fc21dae920799e0a4cf47e98707f6b70457d97fa7c47ec4e07165f6cdc3b36b42a369e7f32d8a1c79b
7
+ data.tar.gz: 4e11f1f217942cd23a0651ffd01fedba0a25852e994724b9b11180a81c976cd8f6ca01adce161399ae954588a458fdc0df3bd72f617dd0966ecdb4ec356858dd
@@ -52,8 +52,23 @@ module Autobuild
52
52
 
53
53
  # Sets the directory in which files get cached
54
54
  attr_writer :cachedir
55
- end
56
55
 
56
+ # The timeout (in seconds) used during downloading.
57
+ #
58
+ # With wget, it is the timeout used for DNS resolution, connection and
59
+ # idle time (time without receiving data)
60
+ #
61
+ # It defaults to 5s
62
+ attr_accessor :timeout
63
+
64
+ # The number of time we should retry downloading if the underlying tool
65
+ # supports it (wget does).
66
+ #
67
+ # It defaults to 1 as autobuild has its own retry mechanism
68
+ attr_accessor :retries
69
+ end
70
+ @retries = 1
71
+ @timeout = 10
57
72
  @cachedir = nil
58
73
 
59
74
  # Returns the unpack mode from the file name
@@ -161,7 +176,14 @@ module Autobuild
161
176
  if(WINDOWS)
162
177
  get_url_on_windows(@url, "#{cachefile}.partial")
163
178
  else
164
- Subprocess.run(package, :import, Autobuild.tool('wget'), '-q', '-P', cachedir, @url, '-O', "#{cachefile}.partial")
179
+ additional_options = []
180
+ if timeout = self.timeout
181
+ additional_options << "--timeout" << timeout
182
+ end
183
+ if retries = self.retries
184
+ additional_options << "--tries" << retries
185
+ end
186
+ Subprocess.run(package, :import, Autobuild.tool('wget'), '-q', '-P', cachedir, *additional_options, @url, '-O', "#{cachefile}.partial")
165
187
  end
166
188
  rescue Exception
167
189
  FileUtils.rm_f "#{cachefile}.partial"
@@ -205,6 +227,20 @@ module Autobuild
205
227
  # is the same than the source dir
206
228
  def archive_dir; @options[:archive_dir] || tardir end
207
229
 
230
+ # The number of time we should retry downloading if the underlying tool
231
+ # supports it (wget does).
232
+ #
233
+ # It defaults to the global ArchiveImporter.retries
234
+ attr_accessor :retries
235
+
236
+ # The timeout (in seconds) used during downloading.
237
+ #
238
+ # With wget, it is the timeout used for DNS resolution, connection and
239
+ # idle time (time without receiving data)
240
+ #
241
+ # It defaults to the global ArchiveImporter.timeout
242
+ attr_accessor :timeout
243
+
208
244
  # Creates a new importer which downloads +url+ in +cachedir+ and unpacks it. The following options
209
245
  # are allowed:
210
246
  # [:cachedir] the cache directory. Defaults to "#{Autobuild.prefix}/cache"
@@ -220,6 +256,8 @@ module Autobuild
220
256
  @options[:update_cached_file] = false
221
257
  end
222
258
  @cachedir = @options[:cachedir] || ArchiveImporter.cachedir
259
+ @retries = @options[:retries] || ArchiveImporter.retries
260
+ @timeout = @options[:timeout] || ArchiveImporter.timeout
223
261
 
224
262
  relocate(url)
225
263
  end
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.7.12.rc2" unless defined? Autobuild::VERSION
2
+ VERSION = "1.7.12.rc3" unless defined? Autobuild::VERSION
3
3
  end
4
4
 
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autobuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.12.rc2
4
+ version: 1.7.12.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-14 00:00:00.000000000 Z
11
+ date: 2014-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake