fpm-fry 0.4.3 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/fpm/fry/command/cook.rb +1 -1
- data/lib/fpm/fry/plugin/service.rb +3 -5
- data/lib/fpm/fry/source/patched.rb +1 -1
- data/lib/fpm/fry/stream_parser.rb +47 -20
- data/lib/fpm/fry/templates/debian/after_remove.erb +1 -1
- data/lib/fpm/fry/templates/debian/before_remove.erb +1 -1
- metadata +19 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4911dfb40c91dd585e0ccbbad499a4d71eebadd4c00846b982ed100b186c963f
|
4
|
+
data.tar.gz: 7122bfa7728cb976d3b12010e63be177ccc23d00c360c4830317369f1d1012f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e1ef45f2c7b25b759e3f170b0a3a41d745e686a8a008da43494f6c53166f9695b241f3f2e45dab5fafacfd18a88ae5320e3e7831c4114d5a5e0cbbea08cf10c
|
7
|
+
data.tar.gz: fbe991bb53e481eab8293c0631079af94795f60dc6381635448fac81aaea0b879fe97e50860688654795a820d2813fab581bc06881223514c289bdd70b9dd42f
|
data/lib/fpm/fry/command/cook.rb
CHANGED
@@ -197,7 +197,7 @@ module FPM; module Fry
|
|
197
197
|
)
|
198
198
|
|
199
199
|
client.post(
|
200
|
-
path: client.url('containers',container,'attach?stderr=1&stdout=1&stream=1'),
|
200
|
+
path: client.url('containers',container,'attach?stderr=1&stdout=1&stream=1&logs=1'),
|
201
201
|
body: '',
|
202
202
|
expects: [200],
|
203
203
|
middlewares: [
|
@@ -10,11 +10,9 @@ module FPM::Fry::Plugin ; module Service
|
|
10
10
|
|
11
11
|
def render(file)
|
12
12
|
_erbout = ""
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
)
|
17
|
-
eval(erb.src,nil,File.join(File.dirname(__FILE__),'..','templates',file))
|
13
|
+
path = File.join(File.dirname(__FILE__),'..','templates',file)
|
14
|
+
erb = ERB.new(IO.read(path), trim_mode: "-")
|
15
|
+
eval erb.src, nil, path
|
18
16
|
return _erbout
|
19
17
|
end
|
20
18
|
|
@@ -44,7 +44,7 @@ module FPM; module Fry ; module Source
|
|
44
44
|
base = File.expand_path(inner.prefix, base)
|
45
45
|
end
|
46
46
|
package.patches.each do |patch|
|
47
|
-
cmd = ['patch','-p1','-i',patch[:file]]
|
47
|
+
cmd = ['patch','-t','-p1','-i',patch[:file]]
|
48
48
|
chdir = base
|
49
49
|
if patch.key? :chdir
|
50
50
|
given_chdir = File.expand_path(patch[:chdir],workdir)
|
@@ -16,38 +16,56 @@ module FPM; module Fry
|
|
16
16
|
if datum[:response]
|
17
17
|
# probably mocked
|
18
18
|
if datum[:response][:body]
|
19
|
-
|
19
|
+
headers = datum[:response][:headers]
|
20
|
+
fake_socket = StringIO.new(datum[:response][:body])
|
21
|
+
parse_response_data(fake_socket, headers)
|
20
22
|
end
|
21
|
-
return @stack.response_call(datum)
|
22
23
|
else
|
23
|
-
socket = datum
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}
|
36
|
-
|
24
|
+
socket, headers = extract_socket_and_headers(datum)
|
25
|
+
parse_response_data(socket, headers)
|
26
|
+
end
|
27
|
+
@stack.response_call(datum)
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def extract_socket_and_headers(datum)
|
33
|
+
socket = datum[:connection].send(:socket)
|
34
|
+
begin
|
35
|
+
line = socket.readline
|
36
|
+
match = /^HTTP\/\d+\.\d+\s(\d{3})\s/.match(line)
|
37
|
+
end while !match
|
38
|
+
status = match[1].to_i
|
39
|
+
|
40
|
+
headers = Excon::Headers.new
|
41
|
+
datum[:response] = {
|
42
|
+
:body => '',
|
43
|
+
:headers => headers,
|
44
|
+
:status => status,
|
45
|
+
:remote_ip => socket.respond_to?(:remote_ip) && socket.remote_ip,
|
46
|
+
}
|
47
|
+
Excon::Response.parse_headers(socket, datum)
|
48
|
+
|
49
|
+
[socket, headers]
|
50
|
+
end
|
37
51
|
|
52
|
+
def parse_response_data(socket, headers)
|
53
|
+
if headers["Transfer-Encoding"] == "chunked"
|
54
|
+
@parser.parse_chunked(socket)
|
55
|
+
else
|
38
56
|
@parser.parse(socket)
|
39
|
-
return @stack.response_call(datum)
|
40
57
|
end
|
41
58
|
end
|
42
59
|
|
43
60
|
end
|
44
61
|
|
45
|
-
attr :out, :err
|
62
|
+
attr :out, :err, :streams
|
46
63
|
|
47
64
|
def initialize(out, err)
|
48
65
|
@out, @err = out, err
|
49
66
|
@state = :null
|
50
67
|
@left = 0
|
68
|
+
@streams = { 1 => out, 2 => err }
|
51
69
|
end
|
52
70
|
|
53
71
|
def new(stack)
|
@@ -55,8 +73,6 @@ module FPM; module Fry
|
|
55
73
|
end
|
56
74
|
|
57
75
|
def parse(socket)
|
58
|
-
left = 0
|
59
|
-
streams = {1 => out, 2 => err}
|
60
76
|
loop do
|
61
77
|
type = read_exactly(socket,4){|part|
|
62
78
|
if part.bytesize == 0
|
@@ -94,5 +110,16 @@ module FPM; module Fry
|
|
94
110
|
return buf
|
95
111
|
end
|
96
112
|
|
113
|
+
def parse_chunked(socket)
|
114
|
+
loop do
|
115
|
+
line = socket.readline
|
116
|
+
chunk_size = line.chomp.to_i(16)
|
117
|
+
break if chunk_size.zero?
|
118
|
+
chunk = socket.read(chunk_size)
|
119
|
+
parse(StringIO.new(chunk))
|
120
|
+
line = socket.readline
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
97
124
|
end
|
98
125
|
end ; end
|
metadata
CHANGED
@@ -1,17 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fpm-fry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxime Lagresle
|
8
8
|
- Stefan Kaes
|
9
9
|
- Sebastian Brandt
|
10
10
|
- Hannes Georg
|
11
|
-
|
11
|
+
- Julian Tabel
|
12
|
+
- Dennis Konert
|
13
|
+
autorequire:
|
12
14
|
bindir: bin
|
13
15
|
cert_chain: []
|
14
|
-
date:
|
16
|
+
date: 2022-07-29 00:00:00.000000000 Z
|
15
17
|
dependencies:
|
16
18
|
- !ruby/object:Gem::Dependency
|
17
19
|
name: excon
|
@@ -19,42 +21,28 @@ dependencies:
|
|
19
21
|
requirements:
|
20
22
|
- - "~>"
|
21
23
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
24
|
+
version: 0.71.0
|
23
25
|
type: :runtime
|
24
26
|
prerelease: false
|
25
27
|
version_requirements: !ruby/object:Gem::Requirement
|
26
28
|
requirements:
|
27
29
|
- - "~>"
|
28
30
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
31
|
+
version: 0.71.0
|
30
32
|
- !ruby/object:Gem::Dependency
|
31
33
|
name: fpm
|
32
34
|
requirement: !ruby/object:Gem::Requirement
|
33
35
|
requirements:
|
34
36
|
- - "~>"
|
35
37
|
- !ruby/object:Gem::Version
|
36
|
-
version: '1.
|
38
|
+
version: '1.13'
|
37
39
|
type: :runtime
|
38
40
|
prerelease: false
|
39
41
|
version_requirements: !ruby/object:Gem::Requirement
|
40
42
|
requirements:
|
41
43
|
- - "~>"
|
42
44
|
- !ruby/object:Gem::Version
|
43
|
-
version: '1.
|
44
|
-
- !ruby/object:Gem::Dependency
|
45
|
-
name: json
|
46
|
-
requirement: !ruby/object:Gem::Requirement
|
47
|
-
requirements:
|
48
|
-
- - "~>"
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: '1.8'
|
51
|
-
type: :runtime
|
52
|
-
prerelease: false
|
53
|
-
version_requirements: !ruby/object:Gem::Requirement
|
54
|
-
requirements:
|
55
|
-
- - "~>"
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: '1.8'
|
45
|
+
version: '1.13'
|
58
46
|
- !ruby/object:Gem::Dependency
|
59
47
|
name: rake
|
60
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,32 +95,32 @@ dependencies:
|
|
107
95
|
name: coveralls
|
108
96
|
requirement: !ruby/object:Gem::Requirement
|
109
97
|
requirements:
|
110
|
-
- - "
|
98
|
+
- - ">="
|
111
99
|
- !ruby/object:Gem::Version
|
112
|
-
version:
|
100
|
+
version: 0.8.23
|
113
101
|
type: :development
|
114
102
|
prerelease: false
|
115
103
|
version_requirements: !ruby/object:Gem::Requirement
|
116
104
|
requirements:
|
117
|
-
- - "
|
105
|
+
- - ">="
|
118
106
|
- !ruby/object:Gem::Version
|
119
|
-
version:
|
107
|
+
version: 0.8.23
|
120
108
|
- !ruby/object:Gem::Dependency
|
121
109
|
name: simplecov
|
122
110
|
requirement: !ruby/object:Gem::Requirement
|
123
111
|
requirements:
|
124
|
-
- - "
|
112
|
+
- - ">="
|
125
113
|
- !ruby/object:Gem::Version
|
126
114
|
version: '0'
|
127
115
|
type: :development
|
128
116
|
prerelease: false
|
129
117
|
version_requirements: !ruby/object:Gem::Requirement
|
130
118
|
requirements:
|
131
|
-
- - "
|
119
|
+
- - ">="
|
132
120
|
- !ruby/object:Gem::Version
|
133
121
|
version: '0'
|
134
122
|
description: deep-fried package builder
|
135
|
-
email:
|
123
|
+
email: dennis.konert@new-work.se
|
136
124
|
executables:
|
137
125
|
- fpm-fry
|
138
126
|
extensions: []
|
@@ -194,7 +182,7 @@ homepage: https://github.com/xing/fpm-fry
|
|
194
182
|
licenses:
|
195
183
|
- MIT
|
196
184
|
metadata: {}
|
197
|
-
post_install_message:
|
185
|
+
post_install_message:
|
198
186
|
rdoc_options: []
|
199
187
|
require_paths:
|
200
188
|
- lib
|
@@ -209,9 +197,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
197
|
- !ruby/object:Gem::Version
|
210
198
|
version: '0'
|
211
199
|
requirements: []
|
212
|
-
|
213
|
-
|
214
|
-
signing_key:
|
200
|
+
rubygems_version: 3.3.15
|
201
|
+
signing_key:
|
215
202
|
specification_version: 4
|
216
203
|
summary: FPM Fry
|
217
204
|
test_files: []
|