fpm-cookery 0.30.0 → 0.30.1

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: 5d4a540ee8894e347b9b30df41f55735f670f565
4
- data.tar.gz: 974940d490281d11761d8e079e6c0f49df7f968b
3
+ metadata.gz: 01f2d979c1ed4c88bda487ea7612442470a985a7
4
+ data.tar.gz: 2e343014f3158e19916a2f8cfaf26f714c2f6c28
5
5
  SHA512:
6
- metadata.gz: 6b287616baef2e572014cf0ba9736191b0e50a363e25c54ae05d6f96854e8cf3774b74dc0b6a6c72cf43185798eedcc98bf8c88c359a3e48c9eededb1df73948
7
- data.tar.gz: 22e6f563aa586c7e771f3fa9c1c172bde1a0fdd5ae420e4c2ea5352f2a83d31136beef972a57f6e5d737f8e4af95a0ebb780bc9eb0fa8d5a91be64414191e27b
6
+ metadata.gz: ab8313c80b7df62b75c51d811b52f2dd935629714313dfe623e8d0682b7a3f931170a25ea3803b8922c1077e7ec44372a3ecad3719745d5d2a4b9af1f5938626
7
+ data.tar.gz: 25cfca9d6af24b0c3566b5df6ff7be51246ab046cee4ec02b5492613f2f4e54d312ac66d08bc1a497e7a1ec583f8efce6b03c720c1005df1fcbc11f276114315
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.30.1 (2015-09-17)
2
+ * Do not extract the source again if it has been extraced in a previous run. (#100)
3
+ * Allow passing a `Path` object to the `Path#/` method. (#127)
4
+
1
5
  # v0.30.0 (2015-09-10)
2
6
  * Add more lifecylce hooks:
3
7
  * `before_package_create`
@@ -114,7 +114,17 @@ module FPM
114
114
  recipe.builddir.mkdir
115
115
  Dir.chdir(recipe.builddir) do
116
116
  recipe.run_lifecycle_hook(:before_source_extraction)
117
- extracted_source = source.extract
117
+ extract_cookie = extract_cookie_name(package_name)
118
+
119
+ # Do not extract source again because it might destroy changes
120
+ # that have been made to the source. (like patches)
121
+ if File.exists?(extract_cookie)
122
+ extracted_source = File.read(extract_cookie).chomp
123
+ Log.debug "Extract cookie exists, using existing source directory: #{extracted_source}"
124
+ else
125
+ extracted_source = source.extract
126
+ File.open(extract_cookie, 'w', 0644) {|f| f.puts(extracted_source) }
127
+ end
118
128
 
119
129
  if recipe.extracted_source
120
130
  Log.debug "Using custom extracted source dir: #{recipe.builddir(recipe.extracted_source)}"
@@ -123,6 +133,8 @@ module FPM
123
133
 
124
134
  recipe.run_lifecycle_hook(:after_source_extraction, recipe.builddir(extracted_source))
125
135
 
136
+ Log.info "Using source directory: #{extracted_source}"
137
+
126
138
  Dir.chdir(extracted_source) do
127
139
  #Source::Patches.new(recipe.patches).apply!
128
140
 
@@ -164,6 +176,10 @@ module FPM
164
176
  ENV.replace(env)
165
177
  end
166
178
 
179
+ def extract_cookie_name(name)
180
+ (recipe.builddir/".extract-cookie-#{name.gsub(/[^\w]/,'_')}").to_s
181
+ end
182
+
167
183
  def build_cookie_name(name)
168
184
  (recipe.builddir/".build-cookie-#{name.gsub(/[^\w]/,'_')}").to_s
169
185
  end
@@ -18,7 +18,7 @@ module FPM
18
18
  end
19
19
 
20
20
  def /(path)
21
- self + (path || '').gsub(%r{^/}, '')
21
+ self + (path || '').to_s.gsub(%r{^/}, '')
22
22
  end
23
23
 
24
24
  def =~(regex)
@@ -1,5 +1,5 @@
1
1
  module FPM
2
2
  module Cookery
3
- VERSION = '0.30.0'
3
+ VERSION = '0.30.1'
4
4
  end
5
5
  end
data/spec/path_spec.rb CHANGED
@@ -54,6 +54,12 @@ describe "Path" do
54
54
  end
55
55
  end
56
56
 
57
+ describe "with a Path argument" do
58
+ it "returns a new concatenated path object" do
59
+ expect((path/path).to_s).to eq('/foo/foo')
60
+ end
61
+ end
62
+
57
63
  describe "with a nil argument" do
58
64
  it "does not modify the path" do
59
65
  expect((path/nil).to_s).to eq('/foo')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fpm-cookery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.0
4
+ version: 0.30.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernd Ahlers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-10 00:00:00.000000000 Z
11
+ date: 2015-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec