Commit 0dc6fa95 authored by Kra Larivain's avatar Kra Larivain Committed by Fabio Pelosin

[Validator] Fix for paths which are symlink

This fixes pod lib lint due to Pathname.relative_path_from assuming no
symlinks in path while /tmp is actually a symlink  to /private/tmp
parent a493b10c
...@@ -31,7 +31,7 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -31,7 +31,7 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[#1643][https://github.com/CocoaPods/CocoaPods/pull/1643] [#1643][https://github.com/CocoaPods/CocoaPods/pull/1643]
* Pod lib lint now accepts multiple podspecs in the same folder. * Pod lib lint now accepts multiple podspecs in the same folder.
[Kra Larivain/OpenTable](https://github.com/opentable) [kra Larivain/OpenTable](https://github.com/opentable)
[#1635](https://github.com/CocoaPods/CocoaPods/pull/1635) [#1635](https://github.com/CocoaPods/CocoaPods/pull/1635)
* The `pod push` command will now silently test the upcoming CocoaPods trunk * The `pod push` command will now silently test the upcoming CocoaPods trunk
...@@ -93,6 +93,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -93,6 +93,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Carson McDonald](https://github.com/carsonmcdonald) [Carson McDonald](https://github.com/carsonmcdonald)
[#1628](https://github.com/CocoaPods/CocoaPods/issues/1628) [#1628](https://github.com/CocoaPods/CocoaPods/issues/1628)
* Fixed all issues caused by /tmp being a symlink to /private/tmp. This affected mostly pod lib lint, causing it to fail when the pod used prefix_header_* or when the pod headers imported .h using the namespaced syntax (e.g. #import <MyPod/Header.h>)
[kra Larivain/OpenTable](https://github.com/opentable)
[#1514](https://github.com/CocoaPods/CocoaPods/pull/1514)
## 0.28.0 ## 0.28.0
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.27.1...0.28.0) [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.27.1...0.28.0)
[CocoaPods-core](https://github.com/CocoaPods/Core/compare/0.27.1...0.28.0) [CocoaPods-core](https://github.com/CocoaPods/Core/compare/0.27.1...0.28.0)
......
...@@ -135,7 +135,7 @@ module Pod ...@@ -135,7 +135,7 @@ module Pod
end end
def podspecs_tmp_dir def podspecs_tmp_dir
Pathname.new('/tmp/CocoaPods/Lint_podspec') Pathname.new(File.join(Pathname.new('/tmp').realpath, '/CocoaPods/Lint_podspec'))
end end
end end
......
...@@ -177,7 +177,7 @@ module Pod ...@@ -177,7 +177,7 @@ module Pod
# @return [Pathname] the temporary directory used by the linter. # @return [Pathname] the temporary directory used by the linter.
# #
def validation_dir def validation_dir
Pathname.new('/tmp/CocoaPods/Lint') Pathname.new(File.join(Pathname.new('/tmp').realpath,'CocoaPods/Lint'))
end end
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
......
...@@ -89,6 +89,12 @@ module Pod ...@@ -89,6 +89,12 @@ module Pod
it "returns the directory where to store the documentation" do it "returns the directory where to store the documentation" do
@sandbox.documentation_dir.should == temporary_directory + 'Sandbox/Documentation' @sandbox.documentation_dir.should == temporary_directory + 'Sandbox/Documentation'
end end
it "handles symlinks in /tmp" do
tmp_sandbox = Pod::Sandbox.new("/tmp/CocoaPods")
tmp_sandbox.root.should.be == Pathname.new("/private/tmp/CocoaPods")
tmp_sandbox.implode
end
end end
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
......
...@@ -69,6 +69,13 @@ module Pod ...@@ -69,6 +69,13 @@ module Pod
sut.results.map(&:to_s).first.should.match /summary.*meaningful/ sut.results.map(&:to_s).first.should.match /summary.*meaningful/
sut.validated?.should.be.true sut.validated?.should.be.true
end end
it "handles symlinks" do
file = write_podspec(stub_podspec)
validator = Validator.new(file)
validator.validate
validator.validation_dir.should.be == Pathname.new("/private/tmp/CocoaPods/Lint")
end
end end
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
...@@ -136,7 +143,6 @@ module Pod ...@@ -136,7 +143,6 @@ module Pod
sut.validated?.should.be.true sut.validated?.should.be.true
end end
end end
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment