vanagon 0.11.2 → 0.11.3

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: 0a8deb8d9d92862103087ff392bce7075f1b999a
4
- data.tar.gz: b3d3744bd040bb78471170ad446ab70a918038d9
3
+ metadata.gz: '08bdc336ed173230734222c33f733c6c6e0998e9'
4
+ data.tar.gz: 425755b48dc1ef81986dc1ed65ab12f1884aff55
5
5
  SHA512:
6
- metadata.gz: e19349ee79f2bf7c48f35adbd7a18d7544d5b7cd60dffb62edfe93a02d21cb9583f903eb688dd0ab1a9c60362d107b70a0ba43407c4ebf2e7ebe972ce9244aaa
7
- data.tar.gz: 84253136c2c03f6253975532f61cb14a09f43aaa9ed27eeb641d9fc53d1e4aec53c4e688fe700b32e4edef4e263c907b3a332b4e88df62f9acb125f506a95421
6
+ metadata.gz: 02b3231742bd7937b2f790de2600e9f52f6244b4c6d03f3f3d63f5ff0021b8e0ee09d9d7a27c32cb2842077a8fe65dbc80b1c87745782d13a9cc2deb0d30322d
7
+ data.tar.gz: 9a268a0b5cfe23da58d0f47d9f4325efc9ed57c3c51130c12895a260cc15636aba58cdea6031fc43652282a3369e9f66e2cefb8302c75a55ead8fdc666f9badb
@@ -45,7 +45,7 @@ class Vanagon
45
45
  # Ensure that #url returns a URI object
46
46
  @url = URI.parse(url.to_s)
47
47
  @ref = opts[:ref]
48
- @workdir = workdir
48
+ @workdir = File.realpath(workdir)
49
49
 
50
50
  # We can test for Repo existence without cloning
51
51
  raise Vanagon::InvalidRepo, "#{url} not a valid Git repo" unless valid_remote?
@@ -32,7 +32,7 @@ class Vanagon
32
32
  end
33
33
 
34
34
  def cmd(platform)
35
- "#{platform.patch} --strip=#{@strip} --fuzz=#{@fuzz} --ignore-whitespace < $(workdir)/patches/#{File.basename(@path)}"
35
+ "#{platform.patch} --strip=#{@strip} --fuzz=#{@fuzz} --ignore-whitespace --no-backup-if-mismatch < $(workdir)/patches/#{File.basename(@path)}"
36
36
  end
37
37
  end
38
38
  end
@@ -58,10 +58,7 @@ Requires: <%= requires %>
58
58
  # did not specify a dependency on these.
59
59
  # In the future, we will supress pre/post scripts completely if there's nothing
60
60
  # specified by the project or the components.
61
- <%- if @platform.is_aix? -%>
62
- Requires: /bin/mkdir
63
- Requires: /bin/touch
64
- <%- else -%>
61
+ <%- unless @platform.is_aix? -%>
65
62
  Requires(pre): /bin/mkdir
66
63
  Requires(pre): /bin/touch
67
64
  Requires(post): /bin/mkdir
@@ -75,8 +75,8 @@ describe Vanagon::Component::Rules do
75
75
  expect(rule.recipe.first).to eq(
76
76
  [
77
77
  "cd /foo/bar",
78
- "/usr/bin/patch --strip=1 --fuzz=0 --ignore-whitespace < $(workdir)/patches/patch0",
79
- "/usr/bin/patch --strip=2 --fuzz=1 --ignore-whitespace < $(workdir)/patches/patch1"
78
+ "/usr/bin/patch --strip=1 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < $(workdir)/patches/patch0",
79
+ "/usr/bin/patch --strip=2 --fuzz=1 --ignore-whitespace --no-backup-if-mismatch < $(workdir)/patches/patch1"
80
80
  ].join(" && \\\n")
81
81
  )
82
82
  end
@@ -246,8 +246,8 @@ describe Vanagon::Component::Rules do
246
246
  Vanagon::Patch.new('/foo/postinstall/patch1', 4, 10, 'install', '/foo/quux'),
247
247
  ]
248
248
 
249
- expect(rule.recipe[1]).to eq("cd /foo/baz && /usr/bin/patch --strip=3 --fuzz=9 --ignore-whitespace < $(workdir)/patches/patch0")
250
- expect(rule.recipe[2]).to eq("cd /foo/quux && /usr/bin/patch --strip=4 --fuzz=10 --ignore-whitespace < $(workdir)/patches/patch1")
249
+ expect(rule.recipe[1]).to eq("cd /foo/baz && /usr/bin/patch --strip=3 --fuzz=9 --ignore-whitespace --no-backup-if-mismatch < $(workdir)/patches/patch0")
250
+ expect(rule.recipe[2]).to eq("cd /foo/quux && /usr/bin/patch --strip=4 --fuzz=10 --ignore-whitespace --no-backup-if-mismatch < $(workdir)/patches/patch1")
251
251
  end
252
252
 
253
253
  it_behaves_like "a rule that touches the target file"
@@ -17,6 +17,8 @@ describe "Vanagon::Component::Source::Git" do
17
17
  allow(Git)
18
18
  .to receive(:ls_remote)
19
19
  .and_return(true)
20
+
21
+ allow(File).to receive(:realpath).and_return(@workdir)
20
22
  end
21
23
 
22
24
  describe "#initialize" do
@@ -29,6 +31,13 @@ describe "Vanagon::Component::Source::Git" do
29
31
  expect { @klass.new(@url, ref: @ref_tag, workdir: @workdir) }
30
32
  .to raise_error(Vanagon::InvalidRepo)
31
33
  end
34
+
35
+ it "uses the realpath of the workdir if we're in a symlinked dir" do
36
+ expect(File).to receive(:realpath).and_return("/tmp/bar")
37
+ git_source = @klass.new(@local_url, ref: @ref_tag, workdir: "/tmp/foo")
38
+ expect(git_source.workdir)
39
+ .to eq('/tmp/bar')
40
+ end
32
41
  end
33
42
 
34
43
  describe "#dirname" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vanagon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-04 00:00:00.000000000 Z
11
+ date: 2017-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  version: '0'
238
238
  requirements: []
239
239
  rubyforge_project:
240
- rubygems_version: 2.2.5
240
+ rubygems_version: 2.5.2
241
241
  signing_key:
242
242
  specification_version: 3
243
243
  summary: All of your packages will fit into this van with this one simple trick.