Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixes #554 do not map existing paths with = in them #556

Merged
merged 1 commit into from

2 participants

@r4um
Collaborator

No description provided.

@jordansissel jordansissel merged commit 589c402 into from
@jordansissel
Owner

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 19, 2013
  1. @r4um
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 1 deletion.
  1. +1 −1  lib/fpm/package/dir.rb
  2. +17 −0 spec/fpm/package/dir_spec.rb
View
2  lib/fpm/package/dir.rb
@@ -43,7 +43,7 @@ def input(path)
# This mapping should work the same way 'rsync -a' does
# Meaning 'rsync -a source dest'
# and 'source=dest' in fpm work the same as the above rsync
- if path =~ /.=./
+ if path =~ /.=./ && !File.exists?(chdir == '.' ? path : File.join(chdir, path))
origin, destination = path.split("=", 2)
if File.directory?(origin) && origin[-1,1] == "/"
View
17 spec/fpm/package/dir_spec.rb
@@ -97,5 +97,22 @@
insist { File }.exist?(File.join(output, expected_file))
end
end
+
+ it "should not map existing paths with = in them" do
+ File.write(File.join(tmpdir, "a=b"), "hello world")
+ subject.input(File.join(tmpdir, "a=b"))
+ subject.output(output)
+ insist { File }.exist?(File.join(output, tmpdir, "a=b"))
+ end
+
+ it "should not map existing paths with = in them and obey :chdir and :prefix attributes" do
+ Dir.mkdir(File.join(tmpdir, "a"))
+ File.write(File.join(tmpdir,"a", "a=b"), "hello world")
+ subject.attributes[:chdir] = tmpdir
+ subject.attributes[:prefix] = "/foo"
+ subject.input(File.join("a", "a=b"))
+ subject.output(output)
+ insist { File }.exist?(File.join(output, "foo", "a", "a=b"))
+ end
end
end # describe FPM::Package::Dir
Something went wrong with that request. Please try again.