logstash-devutils 2.6.0-java → 2.6.2-java

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c290cf694538a9ee678b8c9120d9557551fc207b20b32e3a0ba4e0feb3401323
4
- data.tar.gz: 216f32b8afbc96f5f73c439d6bc0b7c9b865fc14ea121ba9808028dbdbeea373
3
+ metadata.gz: eaeaec6174b1598f32f8c0d1e5a0ce417b735eab237f5ea608eee10861bb5be6
4
+ data.tar.gz: 2ca9dbaeed76c02ab9dc99d58581928bdaa6a330b7da5aa02206d277cd140b62
5
5
  SHA512:
6
- metadata.gz: 45f671bfb3dce8899e6dab0b80214fc6c3773bf94bb7bf4510c64bd57c483ea456014272c0a12d9c219072ec7e1b0665081028212689c11c8c9e74c026549f76
7
- data.tar.gz: b6ea02d32ce43a98b1a80fb444b7b326b74d4add0495fee450a43f708e194cb932c72c1cd454d24303235e18b223384c4ee3207b0c1534a476f361ff78ab5b0e
6
+ metadata.gz: 21b60cf75fda26617855824a0b524b99941805e5283058add1652187437b5a18109a4c1bf97a92a948dbafa80bc1b775712883248e80030ce4fbf58a22abfd74
7
+ data.tar.gz: 9f32edbbb1919261a526e8d21eb5d4a177a2a96bd38e730ea5383a5b22b56beb79fe803f5df72360dc704d12c4e32dfc44dd1e36918877fbae5317f36cea76d8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 2.6.2
2
+ - Fix: in case of redirected HTTP downloads, return the hash code of the downloaded artifact. [#106](https://github.com/elastic/logstash-devutils/pull/106)
3
+ - Fix: changed the prefix extraction from tar.gz name to the extracted folder name. [#109](https://github.com/elastic/logstash-devutils/pull/109)
4
+
5
+ ## 2.6.1
6
+ - Fix: updated implementation of downloading of vendored artifacts to follow HTTP redirections. [#105](https://github.com/elastic/logstash-devutils/pull/105)
7
+
1
8
  ## 2.6.0
2
9
  - Removed SimpleCov configuration, as it will be moved directly to elastic/logstash [#103](https://github.com/elastic/logstash-devutils/pull/103)
3
10
 
@@ -53,7 +53,7 @@ ensure
53
53
  fd.close if fd
54
54
  end
55
55
 
56
- def download(url, output)
56
+ def download(url, output, redirect_hops = 1)
57
57
  uri = URI(url)
58
58
  digest = Digest::SHA1.new
59
59
  tmp = "#{output}.tmp"
@@ -61,6 +61,17 @@ def download(url, output)
61
61
  request = Net::HTTP::Get.new(uri.path)
62
62
  http.request(request) do |response|
63
63
  fail "HTTP fetch failed for #{url}. #{response}" if [200, 301].include?(response.code)
64
+ case response
65
+ when Net::HTTPRedirection, Net::HTTPFound then
66
+ location = response['location']
67
+ end
68
+
69
+ if location
70
+ fail "Too many redirects to follow" if redirect_hops < 0
71
+ puts "Follow redirect to: #{location}"
72
+ return download(location, output, redirect_hops - 1)
73
+ end
74
+
64
75
  size = (response["content-length"].to_i || -1).to_f
65
76
  count = 0
66
77
  File.open(tmp, "w") do |fd|
@@ -159,9 +170,10 @@ namespace "vendor" do
159
170
  @files.each do |file|
160
171
  download = file_fetch(file['url'], file['sha1'])
161
172
  if download =~ /.tar.gz/
162
- prefix = download.gsub('.tar.gz', '').gsub('vendor/', '')
163
173
  untar(download) do |entry|
164
174
  if !file['files'].nil?
175
+ # extraction folder name
176
+ prefix = entry.full_name.split("/").first
165
177
  next unless file['files'].include?(entry.full_name.gsub(prefix, ''))
166
178
  out = entry.full_name.split("/").last
167
179
  end
@@ -4,7 +4,7 @@ Gem::Specification.new do |spec|
4
4
  files = %x{git ls-files}.split("\n")
5
5
 
6
6
  spec.name = "logstash-devutils"
7
- spec.version = "2.6.0"
7
+ spec.version = "2.6.2"
8
8
  spec.license = "Apache-2.0"
9
9
  spec.authors = ["Elastic"]
10
10
  spec.email = "info@elastic.co"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-devutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.2
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-15 00:00:00.000000000 Z
11
+ date: 2024-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement