Commit fdfcf455 authored by Samuel E. Giddins's avatar Samuel E. Giddins

[Installer] Make pod source locking robust against prefixed target names

parent 73757064
...@@ -347,7 +347,7 @@ module Pod ...@@ -347,7 +347,7 @@ module Pod
return unless config.lock_pod_source? return unless config.lock_pod_source?
return unless @pod_installers return unless @pod_installers
@pod_installers.each do |installer| @pod_installers.each do |installer|
pod_target = pod_targets.detect {|target| target.name == installer.name} pod_target = pod_targets.find { |target| target.pod_name == installer.name }
installer.lock_files!(pod_target.file_accessors) installer.lock_files!(pod_target.file_accessors)
end end
end end
......
...@@ -33,7 +33,8 @@ module Pod ...@@ -33,7 +33,8 @@ module Pod
"<#{self.class} sandbox=#{sandbox.root} pod=#{root_spec.name}" "<#{self.class} sandbox=#{sandbox.root} pod=#{root_spec.name}"
end end
# @return [String] The name of the pod this is installing # @return [String] The name of the pod this installer is installing.
#
def name def name
root_spec.name root_spec.name
end end
...@@ -72,19 +73,13 @@ module Pod ...@@ -72,19 +73,13 @@ module Pod
# @return [void] # @return [void]
# #
def lock_files!(file_accessors) def lock_files!(file_accessors)
if local? return if local?
return
end
file_accessors.each do |file_accessor| file_accessors.each do |file_accessor|
file_accessor.source_files.each do |source_file| file_accessor.source_files.each do |source_file|
if File.exist?(source_file) next unless source_file.exist?
file = source_file.open new_permissions = source_file.stat.mode & ~0222
# Only remove write permission, since some pods (like Crashlytics) source_file.chmod(new_permissions)
# have executable files.
new_permissions = File.stat(file).mode & ~0222
File.chmod(new_permissions, file)
end
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