Commit 3f5f1952 authored by Samuel Giddins's avatar Samuel Giddins

[PathList] Wait to resolve symlinks until checking header ACL

parent 94bc8557
...@@ -182,8 +182,8 @@ module Pod ...@@ -182,8 +182,8 @@ module Pod
native_target = target.native_target_for_spec(consumer.spec) native_target = target.native_target_for_spec(consumer.spec)
headers = file_accessor.headers headers = file_accessor.headers
public_headers = file_accessor.public_headers public_headers = file_accessor.public_headers.map(&:realpath)
private_headers = file_accessor.private_headers private_headers = file_accessor.private_headers.map(&:realpath)
other_source_files = file_accessor.source_files.reject { |sf| SOURCE_FILE_EXTENSIONS.include?(sf.extname) } other_source_files = file_accessor.source_files.reject { |sf| SOURCE_FILE_EXTENSIONS.include?(sf.extname) }
{ {
......
...@@ -88,7 +88,7 @@ module Pod ...@@ -88,7 +88,7 @@ module Pod
# @return [Array<Pathname>] # @return [Array<Pathname>]
# #
def glob(patterns, options = {}) def glob(patterns, options = {})
relative_glob(patterns, options).map { |p| (root + p).realpath } relative_glob(patterns, options).map { |p| root.join(p) }
end end
# The list of relative paths that are case insensitively matched by a # The list of relative paths that are case insensitively matched by a
......
...@@ -192,6 +192,13 @@ module Pod ...@@ -192,6 +192,13 @@ module Pod
Resources/sub_dir Resources/sub_dir
) )
end end
it 'can glob for exact matches' do
paths = @path_list.relative_glob('libBananalib.a').map(&:to_s)
paths.sort.should == %w(
libBananalib.a
)
end
end end
describe 'Reading file system' do describe 'Reading file system' do
...@@ -291,14 +298,27 @@ module Pod ...@@ -291,14 +298,27 @@ module Pod
@path_list.instance_variable_set(:@files, nil) @path_list.instance_variable_set(:@files, nil)
File.symlink(@tmpfile, @symlink_file) File.symlink(@tmpfile, @symlink_file)
@path_list.files.map(&:to_s).include?('Classes/symlinked.h').should == true @path_list.files.map(&:to_s).should.include?('Classes/symlinked.h')
end
it 'includes symlinked file with a different basename' do
orange_h = @path_list.root.join('Classes', 'Orange.h')
File.symlink('Banana.h', orange_h)
begin
@path_list.glob('Classes/Orange.h').should == [
orange_h,
]
ensure
FileUtils.remove_entry(orange_h)
end
end end
it 'includes symlinked dir' do it 'includes symlinked dir' do
@path_list.instance_variable_set(:@dirs, nil) @path_list.instance_variable_set(:@dirs, nil)
File.symlink(@tmpdir, @symlink_dir) File.symlink(@tmpdir, @symlink_dir)
@path_list.dirs.map(&:to_s).include?('Classes/symlinked').should == true @path_list.dirs.map(&:to_s).should.include?('Classes/symlinked')
end end
it 'doesn\'t include file in symlinked dir' do it 'doesn\'t include file in symlinked dir' do
...@@ -306,7 +326,7 @@ module Pod ...@@ -306,7 +326,7 @@ module Pod
@path_list.instance_variable_set(:@dirs, nil) @path_list.instance_variable_set(:@dirs, nil)
File.symlink(@tmpdir, @symlink_dir) File.symlink(@tmpdir, @symlink_dir)
@path_list.files.map(&:to_s).include?('Classes/symlinked/someheader.h').should == false @path_list.files.map(&:to_s).should.not.include?('Classes/symlinked/someheader.h')
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