fpm 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELIST CHANGED
@@ -1,3 +1,15 @@
1
+ 1.0.2 (January 10, 2013)
2
+ - rpm: No longer converts - to _ in dependency strings (#603, Bulat
3
+ Shakirzyanov)
4
+ - Handle Darwin/OSX tar invocations (now tries 'gnutar' and 'gtar'). (Jordan
5
+ Sissel)
6
+ - Process $HOME/.fpm, and $PWD/.fpm in the correct order and allow CLI flags
7
+ to override fpm config file settings. (#615, Jordan Sissel)
8
+ - Don't leave empty gem bin paths in packages that don't need them (#612,
9
+ Jordan Sissel)
10
+ - deb: Make --deb-compression=gz work correctly (#616, #617; Evan Krall,
11
+ Jason Yan)
12
+
1
13
  1.0.1 (December 7, 2013)
2
14
  - deb: Correctly handle --config-files given with a leading / (Jordan Sissel)
3
15
 
@@ -420,14 +420,18 @@ class FPM::Command < Clamp::Command
420
420
  # fpm initialization files, note the order of the following array is
421
421
  # important, try .fpm in users home directory first and then the current
422
422
  # directory
423
- rc_files = [File.join(ENV['HOME'],'.fpm'), '.fpm']
423
+ rc_files = [ ".fpm" ]
424
+ rc_files << File.join(ENV["HOME"], ".fpm") if ENV["HOME"]
424
425
 
425
426
  rc_files.each do |rc_file|
426
427
  if File.readable? rc_file
427
428
  @logger.warn("Loading flags from rc file #{rc_file}")
428
429
  File.readlines(rc_file).each do |line|
429
- Shellwords.shellsplit(line).each do |e|
430
- ARGV << e
430
+ # reverse becasue 'unshift' pushes onto the left side of the array.
431
+ Shellwords.shellsplit(line).reverse.each do |arg|
432
+ # Put '.fpm'-file flags *before* the command line flags
433
+ # so that we the CLI can override the .fpm flags
434
+ ARGV.unshift(arg)
431
435
  end
432
436
  end
433
437
  end
@@ -41,7 +41,7 @@ class FPM::Package::Deb < FPM::Package
41
41
  end
42
42
 
43
43
  option "--compression", "COMPRESSION", "The compression type to use, must " \
44
- "be one of #{COMPRESSION_TYPES.join(", ")}.", :default => "gzip" do |value|
44
+ "be one of #{COMPRESSION_TYPES.join(", ")}.", :default => "gz" do |value|
45
45
  if !COMPRESSION_TYPES.include?(value)
46
46
  raise ArgumentError, "deb compression value of '#{value}' is invalid. " \
47
47
  "Must be one of #{COMPRESSION_TYPES.join(", ")}"
@@ -328,7 +328,7 @@ class FPM::Package::Deb < FPM::Package
328
328
 
329
329
  # Tar up the staging_path into data.tar.{compression type}
330
330
  case self.attributes[:deb_compression]
331
- when "gzip", nil
331
+ when "gz", nil
332
332
  datatar = build_path("data.tar.gz")
333
333
  compression = "-z"
334
334
  when "bzip2"
@@ -186,6 +186,18 @@ class FPM::Package::Gem < FPM::Package
186
186
  ::FileUtils.mkdir_p(bin_path)
187
187
  args << gem_path
188
188
  safesystem(*args)
189
+
190
+ # Delete bin_path if it's empty, and any empty parents (#612)
191
+ # Above, we mkdir_p bin_path because rubygems aborts if the parent
192
+ # directory doesn't exist, for example:
193
+ # ERROR: While executing gem ... (Errno::ENOENT)
194
+ # No such file or directory - /tmp/something/weird/bin
195
+ tmp = bin_path
196
+ while ::Dir.entries(tmp).size == 2 || tmp == "/" # just [ "..", "." ] is an empty directory
197
+ @logger.info("Deleting empty bin_path", :path => tmp)
198
+ ::Dir.rmdir(tmp)
199
+ tmp = File.dirname(tmp)
200
+ end
189
201
  end # def install_to_staging
190
202
 
191
203
  # Sanitize package name.
@@ -106,8 +106,8 @@ class FPM::Package::PEAR < FPM::Package
106
106
  begin
107
107
  content = File.read(path).gsub(/#{Regexp.escape(staging_path)}/, "")
108
108
  File.write(path, content)
109
- rescue ArgumentError
110
- @logger.warn("error replacing staging_path in file", :replace_in => path)
109
+ rescue ArgumentError => e
110
+ @logger.warn("error replacing staging_path in file", :replace_in => path, :error => e)
111
111
  end
112
112
  end
113
113
  FileUtils.rm_r(path) if delete_these.include?(File.basename(path))
@@ -223,19 +223,6 @@ class FPM::Package::RPM < FPM::Package
223
223
  dep_ok
224
224
  end
225
225
 
226
- # Convert any dashes in version strings to underscores.
227
- self.dependencies = self.dependencies.collect do |dep|
228
- name, op, version = dep.split(/\s+/)
229
- if !version.nil? and version.include?("-")
230
- @logger.warn("Dependency package '#{name}' version '#{version}' " \
231
- "includes dashes, converting to underscores")
232
- version = version.gsub(/-/, "_")
233
- "#{name} #{op} #{version}"
234
- else
235
- dep
236
- end
237
- end
238
-
239
226
  # if --ignore-iteration-in-dependencies is true convert foo = X, to
240
227
  # foo >= X , foo < X+1
241
228
  if self.attributes[:rpm_ignore_iteration_in_dependencies?]
@@ -117,7 +117,11 @@ module FPM::Util
117
117
  when "SunOS"
118
118
  return "gtar"
119
119
  when "Darwin"
120
- return "gnutar"
120
+ # Try running gnutar, it was renamed(??) in homebrew to 'gtar' at some point, I guess? I don't know.
121
+ ["gnutar", "gtar"].each do |tar|
122
+ system("#{tar} > /dev/null 2> /dev/null")
123
+ return tar unless $?.exitstatus == 127
124
+ end
121
125
  else
122
126
  return "tar"
123
127
  end
@@ -1,3 +1,3 @@
1
1
  module FPM
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Jordan Sissel
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-12-08 00:00:00.000000000 Z
12
+ date: 2014-01-10 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: json
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ! '>='
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ! '>='
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: cabin
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ! '>='
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ! '>='
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: backports
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ! '>='
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ! '>='
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: arr-pm
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ~>
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :runtime
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - ~>
67
76
  - !ruby/object:Gem::Version
@@ -69,6 +78,7 @@ dependencies:
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: ftw
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ~>
74
84
  - !ruby/object:Gem::Version
@@ -76,6 +86,7 @@ dependencies:
76
86
  type: :runtime
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - ~>
81
92
  - !ruby/object:Gem::Version
@@ -83,6 +94,7 @@ dependencies:
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: clamp
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - ~>
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :runtime
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - ~>
95
108
  - !ruby/object:Gem::Version
@@ -97,6 +110,7 @@ dependencies:
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: childprocess
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
115
  - - ! '>='
102
116
  - !ruby/object:Gem::Version
@@ -104,6 +118,7 @@ dependencies:
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
123
  - - ! '>='
109
124
  - !ruby/object:Gem::Version
@@ -111,6 +126,7 @@ dependencies:
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: ffi
113
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
131
  - - ! '>='
116
132
  - !ruby/object:Gem::Version
@@ -118,6 +134,7 @@ dependencies:
118
134
  type: :runtime
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
121
138
  requirements:
122
139
  - - ! '>='
123
140
  - !ruby/object:Gem::Version
@@ -125,6 +142,7 @@ dependencies:
125
142
  - !ruby/object:Gem::Dependency
126
143
  name: rspec
127
144
  requirement: !ruby/object:Gem::Requirement
145
+ none: false
128
146
  requirements:
129
147
  - - ! '>='
130
148
  - !ruby/object:Gem::Version
@@ -132,6 +150,7 @@ dependencies:
132
150
  type: :development
133
151
  prerelease: false
134
152
  version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
135
154
  requirements:
136
155
  - - ! '>='
137
156
  - !ruby/object:Gem::Version
@@ -139,6 +158,7 @@ dependencies:
139
158
  - !ruby/object:Gem::Dependency
140
159
  name: insist
141
160
  requirement: !ruby/object:Gem::Requirement
161
+ none: false
142
162
  requirements:
143
163
  - - ~>
144
164
  - !ruby/object:Gem::Version
@@ -146,6 +166,7 @@ dependencies:
146
166
  type: :development
147
167
  prerelease: false
148
168
  version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
149
170
  requirements:
150
171
  - - ~>
151
172
  - !ruby/object:Gem::Version
@@ -153,6 +174,7 @@ dependencies:
153
174
  - !ruby/object:Gem::Dependency
154
175
  name: minitest
155
176
  requirement: !ruby/object:Gem::Requirement
177
+ none: false
156
178
  requirements:
157
179
  - - ! '>='
158
180
  - !ruby/object:Gem::Version
@@ -160,6 +182,7 @@ dependencies:
160
182
  type: :development
161
183
  prerelease: false
162
184
  version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
163
186
  requirements:
164
187
  - - ! '>='
165
188
  - !ruby/object:Gem::Version
@@ -167,6 +190,7 @@ dependencies:
167
190
  - !ruby/object:Gem::Dependency
168
191
  name: pry
169
192
  requirement: !ruby/object:Gem::Requirement
193
+ none: false
170
194
  requirements:
171
195
  - - ! '>='
172
196
  - !ruby/object:Gem::Version
@@ -174,6 +198,7 @@ dependencies:
174
198
  type: :development
175
199
  prerelease: false
176
200
  version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
177
202
  requirements:
178
203
  - - ! '>='
179
204
  - !ruby/object:Gem::Version
@@ -181,6 +206,7 @@ dependencies:
181
206
  - !ruby/object:Gem::Dependency
182
207
  name: stud
183
208
  requirement: !ruby/object:Gem::Requirement
209
+ none: false
184
210
  requirements:
185
211
  - - ! '>='
186
212
  - !ruby/object:Gem::Version
@@ -188,6 +214,7 @@ dependencies:
188
214
  type: :development
189
215
  prerelease: false
190
216
  version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
191
218
  requirements:
192
219
  - - ! '>='
193
220
  - !ruby/object:Gem::Version
@@ -241,26 +268,27 @@ files:
241
268
  homepage: https://github.com/jordansissel/fpm
242
269
  licenses:
243
270
  - MIT-like
244
- metadata: {}
245
271
  post_install_message:
246
272
  rdoc_options: []
247
273
  require_paths:
248
274
  - lib
249
275
  - lib
250
276
  required_ruby_version: !ruby/object:Gem::Requirement
277
+ none: false
251
278
  requirements:
252
279
  - - ! '>='
253
280
  - !ruby/object:Gem::Version
254
281
  version: '0'
255
282
  required_rubygems_version: !ruby/object:Gem::Requirement
283
+ none: false
256
284
  requirements:
257
285
  - - ! '>='
258
286
  - !ruby/object:Gem::Version
259
287
  version: '0'
260
288
  requirements: []
261
289
  rubyforge_project:
262
- rubygems_version: 2.1.10
290
+ rubygems_version: 1.8.23
263
291
  signing_key:
264
- specification_version: 4
292
+ specification_version: 3
265
293
  summary: fpm - package building and mangling
266
294
  test_files: []
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MjQyZmUyN2NhNjAxNjEzYjAyZWM2NDdkMDQ4NGY3ZmVhYjU5M2Q5OQ==
5
- data.tar.gz: !binary |-
6
- MWVkMWM1YjE1Mjk4NTU4MjJhM2FhNzI3YjEyMjUyMTA2Y2U2ZDNlNw==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- YjkyZWUyN2I5NjI4Y2ZiOThmYmQwZjI3YTRjNmNhODlhODYyODhhNmFjN2Uz
10
- YTc4MTExYWM2YzQ0ZTFkYWE5MWIwMWJlNTAzNzYxYmU2ODM2ODNlMzFmN2Mz
11
- N2I0ZTZhYThkZGY0NzIzZTIyN2RhNjMxNjM3YmNlZmM0ZTdkMzM=
12
- data.tar.gz: !binary |-
13
- MzNlNGU3YWFhMTRmYjc3ZThkYTMwNjFlZmE2NmVmZjhiOWU5MzJkZDNhMDdm
14
- N2RiMDhiYmQ5NDJkMTY5ODNlMzU3N2Y2ODNmZTdjOGZkYTk5MzczNGEyYTIz
15
- MmQyYjNmNmQ0OGExNTY5YjI0M2U4MjMwNmMyN2YzNzc0ZDNjNzA=